Skip to content

Commit

Permalink
Merge pull request #2 from membraneframework/metadata
Browse files Browse the repository at this point in the history
Frame Metadata
  • Loading branch information
bblaszkow06 committed Jun 5, 2019
2 parents 47d315b + b2a769d commit 356737a
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
27 changes: 27 additions & 0 deletions lib/membrane_caps_audio_flac/frame_metadata.ex
@@ -0,0 +1,27 @@
defmodule Membrane.Caps.Audio.FLAC.FrameMetadata do
@moduledoc """
Module defining metadata struct for FLAC buffers with audio frames.
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
3 changes: 2 additions & 1 deletion mix.exs
Expand Up @@ -22,7 +22,8 @@ defmodule Membrane.Caps.Audio.FLAC.Mixfile do
[
main: "readme",
extras: ["README.md"],
source_ref: "v#{@version}"
source_ref: "v#{@version}",
nest_modules_by_prefix: [Membrane.Caps.Audio.FLAC]
]
end

Expand Down

0 comments on commit 356737a

Please sign in to comment.