isobmff-builder-0.11.2.0: A (bytestring-) builder for the ISO-14496-12 base media file format

Safe HaskellNone
LanguageHaskell2010

Data.ByteString.Mp4.AudioStreaming

Description

A single-track AAC audio streaming utility wrapping AudioFile for streaming via e.g. DASH.

Synopsis

Documentation

data StreamingContext Source #

Contains a sample in the ISO14496 style interpretation, i.e. a smallish buffer of e.g. 20ms audio data or a single video frame. A sample has some kind of time or at least order associated to it. TODO not right now, add it

Also a sample has a duration measured as the sampleCount. TODO make this a real data type, and possible refactor this to be a seperate issue from filling stream gaps and determining the offsets and the decoding time stamp.

Contains the configuration and state for the creation of a DASH audio stream.

data AacMp4StreamConfig Source #

Initialisation segment parameters of an aac audio stream mp4 file.

data AacMp4TrackFragment Source #

Media fragment segment parameters of an aac audio stream mp4 file.

buildAacMp4TrackFragment :: AacMp4TrackFragment -> Builder Source #

Convert a 'AacMp4TrackFragment record to a generic Boxes collection.

buildAacMp4StreamInit :: AacMp4StreamConfig -> Builder Source #

Convert a AacMp4StreamConfig record to a generic Boxes collection.

getStreamBaseTime :: StreamingContext -> Word64 Source #

Return the current base decoding time

getStreamSequence :: StreamingContext -> Word32 Source #

Return the current sequence number

streamInitINTERNAL_TESTING :: String -> NominalDiffTime -> Bool -> SamplingFreqTable -> ChannelConfigTable -> IO (InitSegment, StreamingContext) Source #

Initiate the StreamingContext and create the MP4 init segment. This lives in IO because it read the current time from the real world.

streamInitUtc :: String -> UTCTime -> UTCTime -> NominalDiffTime -> Bool -> SamplingFreqTable -> ChannelConfigTable -> (InitSegment, StreamingContext) Source #

Initiate the StreamingContext and create the MP4 init segment. This lives in IO because it read the current time from the real world.

streamNextSample :: Word32 -> ByteString -> StreamingContext -> (Maybe Segment, StreamingContext) Source #

Enqueue a sample, if enough samples are accumulated, generate the next segment

streamFlush :: StreamingContext -> (Maybe Segment, StreamingContext) Source #

Enqueue a sample, if enough samples are accumulated, generate the next segment