This element is responsible for parsing audio in RawAudio format. The Parser ensures that output buffers have whole samples.
By default, the parser doesn't ensure that each output buffer holds
the same number of samples, it only re-aligns buffers to whole samples.
When chunk_duration is set, the parser additionally re-chunks the stream,
so that every output buffer carries exactly chunk_duration worth of audio.
Element options
Passed via struct Membrane.RawAudioParser.t/0
assumed_input_stream_formatRawAudio.t() | nilDefault value:
nil
The format of the stream to assume if the stream format received on the input pad isMembrane.RemoteStream.t/0. Whennil, the format received on the input pad is used. When both formats are instances ofMembrane.RawAudio.t/0, the parser expects them to be identical.overwrite_pts?boolean()Default value:
false
If set to true, RawAudioParser will add timestamps based on payload duration. The first buffer's timestamp value can be specified with thepts_offsetoption and defaults to 0.pts_offsetnon_neg_integer()Default value:
0
If set to a value different than 0, RawAudioParser will start timestamps from this offset. Only valid when:overwrite_pts?is set to true.chunk_durationMembrane.Time.t() | nilDefault value:
nil
When set, output buffers are re-chunked so that each one carries exactlychunk_durationworth of audio. Bytes that don't fill a whole chunk are buffered until enough data arrives. The trailing remainder is flushed as a (possibly shorter) buffer at end of stream.When
nil(the default), the parser only re-aligns buffers to whole samples and otherwise passes them through unchanged.
Pads
:input
Accepted formats:
Membrane.RawAudioMembrane.RemoteStream| Direction: | :input |
| Availability: | :always |
| Flow control: | :auto |
:output
Accepted formats:
Membrane.RawAudio| Direction: | :output |
| Availability: | :always |
| Flow control: | :auto |
Summary
Types
Struct containing options for Membrane.RawAudioParser
Types
@type t() :: %Membrane.RawAudioParser{ assumed_input_stream_format: Membrane.RawAudio.t() | nil, chunk_duration: Membrane.Time.t() | nil, overwrite_pts?: boolean(), pts_offset: non_neg_integer() }
Struct containing options for Membrane.RawAudioParser
Functions
@spec options() :: keyword()
Returns description of options available for this module