Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gen2brain/aac-go
Go bindings for vo-aacenc
https://github.com/gen2brain/aac-go
aac aac-audio golang golang-bindings
Last synced: about 1 month ago
JSON representation
Go bindings for vo-aacenc
- Host: GitHub
- URL: https://github.com/gen2brain/aac-go
- Owner: gen2brain
- License: apache-2.0
- Created: 2018-03-06T03:49:40.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-19T10:22:05.000Z (almost 2 years ago)
- Last Synced: 2024-11-01T02:22:00.582Z (about 2 months ago)
- Topics: aac, aac-audio, golang, golang-bindings
- Language: Go
- Size: 213 KB
- Stars: 59
- Watchers: 5
- Forks: 11
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: COPYING
Awesome Lists containing this project
README
## aac-go
[![Build Status](https://github.com/gen2brain/aac-go/actions/workflows/build.yml/badge.svg)](https://github.com/gen2brain/aac-go/actions)
[![GoDoc](https://godoc.org/github.com/gen2brain/aac-go?status.svg)](https://godoc.org/github.com/gen2brain/aac-go)
[![Go Report Card](https://goreportcard.com/badge/github.com/gen2brain/aac-go?branch=master)](https://goreportcard.com/report/github.com/gen2brain/aac-go)`aac-go` provides AAC codec encoder based on [VisualOn AAC encoder](https://github.com/mstorsjo/vo-aacenc) library.
### Installation
go get -u github.com/gen2brain/aac-go
### Examples
See [micgrab](https://github.com/gen2brain/aac-go/blob/master/examples/micgrab/micgrab.go) example.
### Usage
```go
package mainimport (
"bytes"
"os""github.com/gen2brain/aac-go"
"github.com/youpy/go-wav"
)func main() {
file, err := os.Open("test.wav")
if err != nil {
panic(err)
}wreader := wav.NewReader(file)
f, err := wreader.Format()
if err != nil {
panic(err)
}buf := bytes.NewBuffer(make([]byte, 0))
opts := &aac.Options{}
opts.SampleRate = int(f.SampleRate)
opts.NumChannels = int(f.NumChannels)enc, err := aac.NewEncoder(buf, opts)
if err != nil {
panic(err)
}err = enc.Encode(wreader)
if err != nil {
panic(err)
}err = enc.Close()
if err != nil {
panic(err)
}err = os.WriteFile("test.aac", buf.Bytes(), 0644)
if err != nil {
panic(err)
}
}
```## More
For H.264 encoder see [x264-go](https://github.com/gen2brain/x264-go).