wavex v0.10.0 Wavex.Chunk.BAE

Read a Broadcast Audio Extension chunk.

Link to this section Summary

Functions

Read a Broadcast Audio Extension chunk

Link to this section Types

Link to this type t()
t() :: %Wavex.Chunk.BAE{
  description: binary(),
  loudness_range: integer(),
  loudness_value: integer(),
  max_momentary_loudness: integer(),
  max_short_term_loudness: integer(),
  max_true_peak_level: integer(),
  origination_date: Date.t(),
  origination_time: Time.t(),
  originator: binary(),
  originator_reference: binary(),
  size: non_neg_integer(),
  time_reference_high: non_neg_integer(),
  time_reference_low: non_neg_integer(),
  umid: <<_::512>>,
  version: non_neg_integer()
}

Link to this section Functions

Read a Broadcast Audio Extension chunk.

Examples

Reading a version 0 chunk.

iex> binary = <<
...>   0x62, 0x65, 0x78, 0x74, 0x5C, 0x02, 0x00, 0x00,
...>   0x53, 0x69, 0x6E, 0x65, 0x20, 0x57, 0x61, 0x76,
...>   0x65, 0x20, 0x46, 0x69, 0x6C, 0x65, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x54, 0x6F, 0x6E, 0x65, 0x73, 0x2E, 0x65, 0x78,
...>   0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x32, 0x30, 0x31, 0x37, 0x2D, 0x30, 0x36, 0x2D,
...>   0x30, 0x33, 0x31, 0x33, 0x3A, 0x34, 0x32, 0x3A,
...>   0x31, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...>   0x00, 0x00, 0x00, 0x00
...> >>
iex> wave = Wavex.Chunk.BAE.read(binary)
iex> match?(
...>   {:ok,
...>    %Wavex.Chunk.BAE{
...>      description: "Sine Wave File",
...>      loudness_range: 0,
...>      loudness_value: 0,
...>      max_momentary_loudness: 0,
...>      max_short_term_loudness: 0,
...>      max_true_peak_level: 0,
...>      origination_date: ~D[2017-06-03],
...>      origination_time: ~T[13:42:10],
...>      originator: "Tones.exe",
...>      originator_reference: "",
...>      size: 604,
...>      time_reference_high: 0,
...>      time_reference_low: 0,
...>      umid: _,
...>      version: 0
...>    }, ""},
...>   wave
...> )
true