Return raw PCM f32 bytes (little-endian).
(&self)
| 155 | |
| 156 | /// Return raw PCM f32 bytes (little-endian). |
| 157 | pub fn to_pcm_bytes(&self) -> Vec<u8> { |
| 158 | self.samples |
| 159 | .iter() |
| 160 | .flat_map(|s| s.to_le_bytes()) |
| 161 | .collect() |
| 162 | } |
| 163 | } |
| 164 | |
| 165 | /// Encode PCM f32 samples as a WAV file (16-bit PCM, mono). |
no outgoing calls