Skip to content

Commit

Permalink
Add frame metadata struct
Browse files Browse the repository at this point in the history
  • Loading branch information
bblaszkow06 committed Jun 3, 2019
1 parent 47d315b commit 0d74328
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions lib/membrane_caps_audio_flac/metadata.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
defmodule Membrane.Caps.Audio.FLAC.Metadata do
@moduledoc """
Module defining metadata struct for FLAC buffers.
Based on contents of [frame header](https://xiph.org/flac/format.html#frame_header)
"""

@type t() :: %__MODULE__{
channels: 1..8,
channel_mode: :independent | :left_side | :right_side | :mid_side,
sample_rate: pos_integer,
sample_size: 4 | 8 | 12 | 16 | 20 | 24 | 32,
samples: pos_integer,
starting_sample_number: non_neg_integer()
}

@enforce_keys [
:channels,
:channel_mode,
:sample_rate,
:sample_size,
:samples,
:starting_sample_number
]

defstruct @enforce_keys
end

0 comments on commit 0d74328

Please sign in to comment.