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

Function test_decode_upsample

cake-core/src/utils/wav.rs:325–331  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

323
324 #[test]
325 fn test_decode_upsample() {
326 // 24kHz file loaded at 48kHz should double the sample count
327 let samples: Vec<f32> = (0..2400).map(|i| (i as f32 / 2400.0).sin()).collect();
328 let wav = encode_wav_bytes(&samples, 24000);
329 let decoded = decode_wav_mono(&wav, 48000).unwrap();
330 assert_eq!(decoded.len(), 4800);
331 }
332
333 #[test]
334 fn test_decode_same_rate_no_resample() {

Callers

nothing calls this directly

Calls 2

decode_wav_monoFunction · 0.85
encode_wav_bytesFunction · 0.70

Tested by

no test coverage detected