codec.decode_wav
result = codec.decode_wav(src, [channel=])
Input: src, channel · Output: result
What it is
Decodes a WAV file. Same arguments and same two return forms as codec.decode_flac. Integer WAV is normalised by 2^(bits-1), exactly as FLAC is, so the same recording in either container gives the same numbers. Float WAV passes through untouched — it is already in -1.0 ..= 1.0, and rescaling it would be the one case where normalising changes the data — and reports bits as none, because a float format has a width but no quantisation step.
Overloads
One call shape — this function is not overloaded.
| Code | Input | Output | Description |
result = codec.decode_wav(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
From the documentation, and run by the build -- the output and the figure below are what the engine actually produced. Simplest first.
import codec
a = codec.decode_wav("take.wav") # a stereo file
codec.write_wav("take24.wav", a.channels, depth = 24)
codec.write_wav("take16.wav", a.channels, depth = 16, dither = "tpdf")
not run by the build — this one needs something the repository cannot supply · from file-io
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.