Skip to main content

Module convert

Module convert 

Source
Expand description

Zero-copy audio sample format conversion.

Provides utilities for converting between i16 PCM sample slices and raw byte slices using [bytemuck] (zero-copy reinterpret casts), and for wrapping owned byte vectors as shared [Bytes] handles for zero-copy fan-out.

Functionsยง

bytes_to_i16
Convert raw bytes to i16 PCM samples (zero-copy via bytemuck).
i16_to_bytes
Convert a slice of i16 PCM samples to raw bytes (zero-copy via bytemuck).
i16_to_pcm16_le
Encode samples as little-endian PCM16 bytes (the Live wire format).
into_shared
Wrap raw bytes as a shared Bytes handle for zero-copy fan-out.
pcm16_le_samples
Decode little-endian PCM16 bytes (the Live wire format) to samples.