Membrane MPEG Audio format v0.3.0 Membrane.MPEGAudio View Source

This module implements struct for caps representing MPEG audio stream.

See MPEG Frame header documentation

Link to this section Summary

Functions

Returns the size of a frame in bytes. The result does not include the size of a header

Returns the size of MPEG audio frame header (4 bytes)

Returns amount of raw audio samples that are in the frame for given version/layer combination

Returns one ‘silent’ frame along with its caps

Link to this section Types

Link to this type bitrate_t() View Source
bitrate_t() :: pos_integer() | :free
Link to this type channel_mode_t() View Source
channel_mode_t() :: :stereo | :joint_stereo | :dual_channel | :single_channel
Link to this type copyright_t() View Source
copyright_t() :: boolean()
Link to this type crc_enabled_t() View Source
crc_enabled_t() :: boolean()
Link to this type emphasis_mode_t() View Source
emphasis_mode_t() :: :none | :emphasis_50_15 | :reserved | :ccit_j_17
Link to this type layer_t() View Source
layer_t() :: :layer1 | :layer2 | :layer3
Link to this type mode_extension_t() View Source
mode_extension_t() :: :mode0 | :mode1 | :mode2 | :mode3 | nil
Link to this type original_t() View Source
original_t() :: boolean()
Link to this type padding_enabled_t() View Source
padding_enabled_t() :: boolean()
Link to this type private_t() View Source
private_t() :: boolean()
Link to this type sample_rate_t() View Source
sample_rate_t() :: pos_integer()
Link to this type t() View Source
t() :: %Membrane.MPEGAudio{
  bitrate: bitrate_t(),
  channel_mode: channel_mode_t(),
  channels: term(),
  copyright: copyright_t(),
  crc_enabled: crc_enabled_t(),
  emphasis_mode: emphasis_mode_t(),
  layer: layer_t(),
  mode_extension: mode_extension_t(),
  original: original_t(),
  padding_enabled: padding_enabled_t(),
  private: private_t(),
  sample_rate: sample_rate_t(),
  version: version_t()
}
Link to this type version_t() View Source
version_t() :: :v1 | :v2 | :v2_5

Link to this section Functions

Link to this function frame_size(mpeg_audio) View Source
frame_size(caps :: t()) :: pos_integer()

Returns the size of a frame in bytes. The result does not include the size of a header.

Link to this function header_size() View Source
header_size() :: 4

Returns the size of MPEG audio frame header (4 bytes).

Link to this function samples_per_frame(atom1, atom2) View Source
samples_per_frame(version_t(), layer_t()) :: pos_integer()

Returns amount of raw audio samples that are in the frame for given version/layer combination.

Inlined by the compiler.

Link to this function sound_of_silence() View Source
sound_of_silence() :: {binary(), t()}

Returns one ‘silent’ frame along with its caps.

Inlined by the compiler.