wavex v0.10.0 Wavex.Utils
Miscellaneous utilities.
Link to this section Summary
Functions
Read max_bytes
bytes, or until a null byte is encountered
Verify a FourCC (four character code)
Link to this section Functions
Read max_bytes
bytes, or until a null byte is encountered.
Examples
iex> Wavex.Utils.take_until_null(<<1, 2, 3, 4, 5, 6, 7, 8, 9>>)
<<1, 2, 3, 4, 5, 6, 7, 8, 9>>
iex> Wavex.Utils.take_until_null(<<1, 2, 0, 4, 5, 6, 7, 8, 9>>)
<<1, 2>>
Link to this function
verify_four_cc(arg1, arg2)
verify_four_cc(<<_::32>>, <<_::32>>) :: :ok | {:error, Wavex.Error.UnexpectedFourCC.t()}
Verify a FourCC (four character code).
Examples
iex> Wavex.Utils.verify_four_cc("RIFF", "RIFF")
:ok
iex> Wavex.Utils.verify_four_cc("RIFX", "RIFF")
{:error, %UnexpectedFourCC{expected: "RIFF", actual: "RIFX"}}