wavex v0.2.1 Wavex.RIFFHeader

Reading a RIFF header.

Link to this section Summary

Functions

Read a RIFF header

Link to this section Types

Link to this type t()
t() :: %Wavex.RIFFHeader{size: pos_integer()}

Link to this section Functions

Read a RIFF header.

Examples

sapp.org, 2018-04-30, Microsoft WAVE soundfile format

iex> Wavex.RIFFHeader.read(<<
...>   0x52, 0x49, 0x46, 0x46, #  R     I     F     F
...>   0x24, 0x08, 0x00, 0x00, #  38
...>   0x57, 0x41, 0x56, 0x45  #  W     A     V     E
...> >>)
{:ok, %Wavex.RIFFHeader{size: 2084}, ""}

iex> Wavex.RIFFHeader.read(<<"RIFX", 0, 0, 0, 0, "WAVE">>)
{:error, %Wavex.Error.UnexpectedID{expected: "RIFF", actual: "RIFX"}}