Skip to main content

stream_wav

Function stream_wav 

Source
pub fn stream_wav(path: &Path) -> Option<Receiver<Vec<i16>>>
Expand description

Loads a 16-bit stereo 44.1 kHz WAV as interleaved f32 samples. Streams the PCM data of a 16-bit WAV file in half-second chunks of interleaved samples, looping forever, from a background thread. Only a few chunks are buffered (the channel is bounded), so memory stays small and nothing large is allocated at level start. The thread exits when the receiver is dropped.