For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).
Python function
encode_wav_bytes
encode_wav_bytes()
max.serve.media.encode_wav_bytes(samples, sample_rate)
Encodes a float waveform as a 16-bit PCM WAV payload.
16-bit is what the format’s ubiquitous reader path expects and what every client can play; a generative model’s own noise floor sits well above the quantization step, so the width costs nothing audible.
-
Parameters:
-
Returns:
-
The complete WAV file, header included.
-
Raises:
-
ValueError – If the waveform is not 2D, has no channels or no samples, or the sample rate is not positive.
-
Return type: