View Source Infer.Audio (Infer v0.2.4)

Audio type matchers based on the magic number

Link to this section Summary

Functions

Takes the binary file contents as arguments. Returns true if it's a aac.

Takes the binary file contents as arguments. Returns true if it's an aiff.

Takes the binary file contents as arguments. Returns true if it's a amr.

Takes the binary file contents as arguments. Returns true if it's a flac.

Takes the binary file contents as arguments. Returns true if it's a m4a.

Takes the binary file contents as arguments. Returns true if it's a midi.

Takes the binary file contents as arguments. Returns true if it's a mp3.

Takes the binary file contents as arguments. Returns true if it's a ogg.

Takes the binary file contents as arguments. Returns true if it's a wav.

Link to this section Functions

Specs

aac?(binary()) :: boolean()

Takes the binary file contents as arguments. Returns true if it's a aac.

Specs

aiff?(binary()) :: boolean()

Takes the binary file contents as arguments. Returns true if it's an aiff.

Specs

amr?(binary()) :: boolean()

Takes the binary file contents as arguments. Returns true if it's a amr.

Specs

flac?(binary()) :: boolean()

Takes the binary file contents as arguments. Returns true if it's a flac.

Specs

m4a?(binary()) :: boolean()

Takes the binary file contents as arguments. Returns true if it's a m4a.

examples

Examples

iex> binary = File.read!("test/audio/sample.m4a")
iex> Infer.Audio.m4a?(binary)
true

Specs

midi?(binary()) :: boolean()

Takes the binary file contents as arguments. Returns true if it's a midi.

Specs

mp3?(binary()) :: boolean()

Takes the binary file contents as arguments. Returns true if it's a mp3.

examples

Examples

iex> binary = File.read!("test/audio/sample.mp3")
iex> Infer.Audio.mp3?(binary)
true

Specs

ogg?(binary()) :: boolean()

Takes the binary file contents as arguments. Returns true if it's a ogg.

Specs

wav?(binary()) :: boolean()

Takes the binary file contents as arguments. Returns true if it's a wav.