Skip to content

tryphon/go-faac

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Go FAAC

Go binding for libfaac. See AudioCoding.com for more info about FAAC.

Usage

sampleRate := 48000
channelCount := 2

faacEncoder := faac.Open(sampleRate, channelCount)
config := faac.EncoderConfiguration{
	BitRate:     48000,
	InputFormat: faac.InputFloat,
}

err := faacEncoder.SetConfiguration(&config)
if err != nil {
   // ...
}

encodedBytes = faacEncoder.OutputBuffer()
var interleavedFloats = []float

// fill interleavedFloats for floats between +/- 32768.0
// len(interleavedFloats) must be (less than) faacEncoder.InputSamples()
// ...

encodedByteCount := faacEncoder.EncodeFloats(
	interleavedFloats,
	encodedBytes)

if encodedByteCount > 0 {
	writer.write encoder.encodedBytes[0:encodedByteCount]
}

faacEncoder.Close()

Releases

No releases published

Packages

No packages published

Languages