Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shenjinti/go722
A G722 codec encode/decode writtren by golang
https://github.com/shenjinti/go722
Last synced: 2 days ago
JSON representation
A G722 codec encode/decode writtren by golang
- Host: GitHub
- URL: https://github.com/shenjinti/go722
- Owner: shenjinti
- License: other
- Created: 2024-10-17T03:10:39.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-10-18T00:36:22.000Z (3 months ago)
- Last Synced: 2024-11-10T17:11:51.258Z (2 months ago)
- Language: Go
- Homepage:
- Size: 19.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go722
This is a simple G722 codec implementation in Go.
## Installation
```bash
go get github.com/shenjinti/go722
```## Usage Example
```go
func TestEncoder(t *testing.T) {
encoder := NewG722Encoder(Rate64000, G722_DEFAULT)
pcm := make([]byte, 160)
g722Bytes := encoder.Encode(pcm)
assert.NotNil(t, g722Bytes)
assert.Equal(t, 40, len(g722Bytes))}
func TestDecoder(t *testing.T) {
encoder := NewG722Decoder(Rate64000, G722_DEFAULT)
g722Bytes := make([]byte, 80)
pcm := encoder.Decode(g722Bytes)
assert.NotNil(t, pcm)
assert.Equal(t, 320, len(pcm))
}
```