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

Function test_decode_resamples

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

Source from the content-addressed store, hash-verified

314
315 #[test]
316 fn test_decode_resamples() {
317 // 48kHz file loaded at 24kHz target should halve the sample count
318 let samples: Vec<f32> = (0..4800).map(|i| (i as f32 / 4800.0).sin()).collect();
319 let wav = encode_wav_bytes(&samples, 48000);
320 let decoded = decode_wav_mono(&wav, 24000).unwrap();
321 assert_eq!(decoded.len(), 2400);
322 }
323
324 #[test]
325 fn test_decode_upsample() {

Callers

nothing calls this directly

Calls 2

decode_wav_monoFunction · 0.85
encode_wav_bytesFunction · 0.70

Tested by

no test coverage detected