Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/winlinvip/go-opus
Golang binding for libopus(https://github.com/winlinvip/opus)
https://github.com/winlinvip/go-opus
Last synced: about 1 month ago
JSON representation
Golang binding for libopus(https://github.com/winlinvip/opus)
- Host: GitHub
- URL: https://github.com/winlinvip/go-opus
- Owner: winlinvip
- License: mit
- Created: 2018-07-12T05:25:52.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-07-18T01:53:20.000Z (over 6 years ago)
- Last Synced: 2024-06-20T03:54:50.343Z (6 months ago)
- Language: Go
- Size: 155 KB
- Stars: 9
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-opus
Golang binding for libopus(https://github.com/winlinvip/opus)
## Usage
First, get the source code:
```
go get -d github.com/winlinvip/go-opus
```Then, compile the opus:
```
cd $GOPATH/src/github.com/winlinvip/go-opus &&
(git clone https://github.com/winlinvip/opus.git opus-lib && cd opus-lib &&
bash autogen.sh && ./configure --prefix=`pwd`/objs && make && make install)
```Done, import and use the package:
* [ExampleOpusDecoder_RAW](opus/example_test.go#L24), decode the aac frame to PCM samples.
There are an example of AAC audio packets in ADTS:
* [avatar aac over ADTS](https://github.com/winlinvip/go-opus/blob/master/doc/adts_data.go), user can use this file to decode to PCM then encode.
To run all examples:
```
cd $GOPATH/src/github.com/winlinvip/go-opus && go test ./...
```## Opus Tools
To generate opus file from wav:
```
cd $GOPATH/src/github.com/winlinvip/go-opus &&
(git clone https://github.com/winlinvip/opusfile.git && cd opusfile &&
export PKG_CONFIG_PATH=`pwd`/../opus-lib/objs/lib/pkgconfig &&
bash autogen.sh && ./configure --prefix=`pwd`/objs --disable-http && make && make install) &&
(git clone https://github.com/winlinvip/libopusenc.git && cd libopusenc &&
bash autogen.sh && ./configure --prefix=`pwd`/objs && make && make install) &&
(git clone https://github.com/winlinvip/opus-tools.git && cd opus-tools &&
export PKG_CONFIG_PATH=`pwd`/../opus-lib/objs/lib/pkgconfig:`pwd`/../opusfile/objs/lib/pkgconfig:`pwd`/../libopusenc/objs/lib/pkgconfig &&
bash autogen.sh && ./configure --prefix=`pwd`/objs && make && make install)
```Winlin 2018