wavex v0.2.7 Wavex.DataChunk

Reading a data chunk.

Link to this section Summary

Link to this section Types

Link to this type t()
t() :: %Wavex.DataChunk{data: binary(), size: non_neg_integer()}

Link to this section Functions

Link to this function read(binary, block_align)

Read a data chunk.

Examples

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

iex> Wavex.DataChunk.read(<<
...>   0x64, 0x61, 0x74, 0x61, #  d     a     t     a
...>   0x02, 0x00, 0x00, 0x00, #  2
...>   0x00, 0x00, 0x00, 0x00, #  0
...>   0x00, 0x00, 0x00, 0x00  #  0
...> >>, 4)
{:ok, %Wavex.DataChunk{size: 2, data: <<0, 0, 0, 0, 0, 0, 0, 0>>}}