MCPcopy Create free account
hub / github.com/evilsocket/cake / to_pcm_bytes

Method to_pcm_bytes

cake-core/src/models/mod.rs:157–162  ·  view source on GitHub ↗

Return raw PCM f32 bytes (little-endian).

(&self)

Source from the content-addressed store, hash-verified

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).

Callers 2

generate_speechFunction · 0.80

Calls

no outgoing calls

Tested by 1