decode

Decodes a WAV or Ogg Vorbis file held in bytes, recognized by its header, into float samples at the file's own sample rate.

WAV files in any format SDL reads are converted to float. Files with more than two channels are mixed down to stereo; Ogg Vorbis files with more than two channels are rejected. An Ogg file cut short decodes up to the cut. bytes is only read during the call and never retained.

Has no sample because it needs a sound file.

Throws

if bytes is empty, is neither a WAV nor an Ogg Vorbis file, is corrupt, or is too long to hold in one array.