platforms.audio_mime module

Conservative magic-byte detection for generically labelled audio uploads.

platforms.audio_mime.sniff_audio_mimetype(data, filename='')

Best-effort audio MIME type from container signatures, else None.

This deliberately requires magic-byte evidence. A filename suffix by itself is not enough to turn arbitrary binary data into an audio part; the suffix is consulted only to disambiguate containers that can also hold video (Ogg and ISO-BMFF/MP4).

Return type:

str | None

Parameters: