Skip to main content

Module audio_format

Module audio_format 

Source
Expand description

Magic-byte sniffing and MIME mapping for supported guest audio containers.

Constants§

AUDIO_FORMAT_FLAC
FLAC lossless.
AUDIO_FORMAT_MP3
MP3 (MPEG-1/2 Audio Layer III).
AUDIO_FORMAT_OGG
Ogg (Vorbis, Opus, etc.).
AUDIO_FORMAT_UNKNOWN
Unknown or not recognized as a supported Oxide audio format.
AUDIO_FORMAT_WAV
WAV / RIFF WAVE.
AUDIO_HTTP_ACCEPT
Accept header sent with super::capabilities URL fetches so servers can pick a codec/container.

Functions§

is_likely_non_audio_document
MIME types that usually indicate an HTML/JSON error body rather than a media stream.
mime_to_audio_format
Map a Content-Type (or similar) value to an AUDIO_FORMAT_* constant, or AUDIO_FORMAT_UNKNOWN.
sniff_audio_format
Inspect leading bytes (and minimal MP3 frame sync after ID3) to guess the container/codec.