codec.decode_mp3
result = codec.decode_mp3(src, [channel=])
Input: src, channel · Output: result
What it is
Decodes an MP3 file. Same arguments and same two return forms as codec.decode_flac. bits is always none: MP3 is lossy, its output is real numbers rather than a quantised grid, and a plausible 16 there would invite arithmetic that means nothing. MP3 has no header — only a run of frames — so a file that is not MP3 fails by finding no frames rather than by rejecting a magic number, and the error says so.
Overloads
One call shape — this function is not overloaded.
| Code | Input | Output | Description |
result = codec.decode_mp3(src, [channel=]) | src —not documented yetchannel Signal or Record, optionalReturns a Signal for a single series — a mono file, or any file with channel= — and otherwise a Record with fs, bits, frames and channels, exactly as codec.decode_flac does. | result Signal or Record | Returns a Signal for a single series — a mono file, or any file with channel= — and otherwise a Record with fs, bits, frames and channels, exactly as codec.decode_flac does. |
Examples
No documentation example calls this form yet. The File I/O chapter is where one belongs.
How it works
One body for all three. They differ only in which decoder runs, because qu_codec gives them a common Audio -- so the shape a script gets back cannot drift between formats, which is the thing that would actually hurt.
From the note above this builtin in the interpreter, where the reasoning was written down as it was built.