Giter Site home page Giter Site logo

adts-reader's Introduction

adts-reader

A Rust parser for the Audio Data Transport Stream framing format used to carry encoded AAC audio data.

crates.io version Documentation

๐Ÿ‘‰ NB This is not an AAC decoder, nor is it able to parse the syntax of the AAC bitstream within the ADTS payload.

Calling code should,

  • Provide an implementation of AdtsConsumer which will recieve callbacks as ADTS frame payloads are found
  • Pass buffers containing ADTS data into the AdtsParser::push() method

Incremental parsing

The byte slice passed to push() need not end exactly at the boundry of an ADTS frame. Partial ADTS data remaining at the end of the given slice will be buffered internally in the parser, and the continuation of the ADTS data must be provided in the subsequent call to push(). This construction is intended to make it convinient to pass payloads of the individual MPEG Transport Stream packets in which ADTS data is commonly embedded, without having to pay the cost of reassembling entire PES packets.

Encoder configuration

ADTS frames include header data indicating the AAC encoder configuration, which will be made available to the calling code through the provided implementation of AdtsConsumer::new_config().

Configuration data is provided at stream start, and to simplify calling code the parser will only call AdtsConsumer::new_config() again if and when the audio configuration is found to change.

Supported ADTS syntax

  • Fixed header fields
    • mpeg_version
    • protection
    • audio_object_type
    • sampling_frequency
    • private_bit
    • channel_configuration
    • originality
    • home
  • Variable header fields data
    • copyright_identifier / copyright_number - deriving these values is not supported, since I've not seen any example bitstreams that use them
    • buffer_fullness
    • number_of_blocks
    • crc - not currently available (also, the CRC does not apply to all payload bytes; cyclic reduncancy check requires AAC bitstream parsing)
  • AAC payload data
    • A &[u8] byte slice containing a complete ADTS frame payload (which might be composed of one or more AAC blocks, per number_of_blocks)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.