MCPcopy Index your code
hub / github.com/Comcast/gaad

github.com/Comcast/gaad @v1.0.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.0.0 ↗ · + Follow
153 symbols 466 edges 10 files 83 documented · 54%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

GoDoc Build Status Go Report Card

GAAD (Go Advanced Audio Decoder)

Package currently provides AAC parsing capabilities. This package performs a full parse of AAC-LC and HE-AACv1 bitstreams. Bitstreams with Parametric Stereo (HE-AACv2) are not yet supported, but AAC bitstream data and SBR data will be extracted. The AAC decode from the parsed data to LPCM (.wav) is not yet implemented. Please help us expand and test this library!

AACParser

This package currently supports AAC audio data contained in an ADTS header. All available data is returned in the adts struct and can be accessed as nested objects as presented in the AAC specification. All parameter names should be verbatim from the AAC specification, if you find an issue with this please file a bug or submit a pull request.

AAC Types

Type Description CODEC
AACLC AAC mp4a.40.2
HEAAC AAC + SBR mp4a.40.5
HEAACv2 AAC + SBR + PS mp4a.40.29

where: + SBR = Spectral band replication + PS = Parametric Stereo

Usage

var []byte buf
buf = <ADTS+AAC data>

// Parsing the buffer
adts, err := gaad.ParseADTS(buf)

// Looping through top level elements and accessing sub-elements
var sbr bool
if adts.Fill_elements != nil {
    for _, e := range adts.Fill_elements {
        if e.Extension_payload != nil &&
            e.Extension_payload.Extension_type == gaad.EXT_SBR_DATA {
            sbr = true
        }
    }
}

VBR vs CBR

VBR (Variable bitrate) and CBR (Constant bitrate) is derived from the bitstream_type attribute in the adif_header section. It is VBR if bitstream_type is true, and CBR otherwise.

References

ISO/IEC STANDARD 14496-3

Title         : Coding of audio-visual objects — Part 3: Audio
File          : ISO_14496-3-4th-Edition.pdf
Edition       : Fourth edition (2009-09-01)
Relevant Sections
    - Page 64   : 1.6.5 Signaling of SBR
    - Page 120  : 1.A.2 AAC Interchange formats
    - Page 489  : 4.4.2 GA bitstream payloads

Related Books

  • Video Demystified (5th Edition) http://my.safaribooksonline.com/book/-/9780750683951

Related Links

  • http://www.mp4ra.org/codecs.html

Core symbols most depended-on inside this repo

ReadBitsAsUInt8
called by 132
bitreader/bitreader.go
ReadBitAsBool
called by 70
bitreader/bitreader.go
ReadBit
called by 22
bitreader/bitreader.go
SkipBits
called by 20
bitreader/bitreader.go
BitsLeft
called by 18
bitreader/bitreader.go
ReadBits
called by 18
bitreader/bitreader.go
NewBitReader
called by 14
bitreader/bitreader.go
ReadBitsToByteArray
called by 10
bitreader/bitreader.go

Shape

Method 66
Function 45
Struct 41
TypeAlias 1

Languages

Go100%

Modules by API surface

aacparser.go86 symbols
bitreader/bitreader.go26 symbols
bitreader/bitreader_test.go13 symbols
aacparser_test.go9 symbols
aachuffmanutil.go7 symbols
aacsbrtables.go6 symbols
aacutils.go3 symbols
aacwindowgrouping_test.go2 symbols
aacwindowgrouping.go1 symbols

For agents

$ claude mcp add gaad \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact