mirror of
https://github.com/RustAudio/rodio
synced 2024-12-14 14:12:31 +00:00
SampleRateConverter: Generalize doubling/halving tests over channels
This commit is contained in:
parent
42e2e53f66
commit
663bdd57b2
1 changed files with 4 additions and 4 deletions
|
@ -285,10 +285,10 @@ mod test {
|
||||||
assert_eq!(input, output);
|
assert_eq!(input, output);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn half_sample_rate(to: u32, input: Vec<u16>) -> () {
|
fn half_sample_rate(to: u32, input: Vec<u16>, n: u16) -> () {
|
||||||
let to = if to == 0 { return; } else { SampleRate(to) };
|
let to = if to == 0 { return; } else { SampleRate(to) };
|
||||||
let from = multiply_rate(to, 2);
|
let from = multiply_rate(to, 2);
|
||||||
let n = 2u16;
|
if n == 0 { return; }
|
||||||
|
|
||||||
// Truncate the input, so it contains an integer number of frames.
|
// Truncate the input, so it contains an integer number of frames.
|
||||||
let input = {
|
let input = {
|
||||||
|
@ -306,10 +306,10 @@ mod test {
|
||||||
output)
|
output)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn double_sample_rate(from: u32, input: Vec<u16>) -> () {
|
fn double_sample_rate(from: u32, input: Vec<u16>, n: u16) -> () {
|
||||||
let from = if from == 0 { return; } else { SampleRate(from) };
|
let from = if from == 0 { return; } else { SampleRate(from) };
|
||||||
let to = multiply_rate(from, 2);
|
let to = multiply_rate(from, 2);
|
||||||
let n = 2u16;
|
if n == 0 { return; }
|
||||||
|
|
||||||
// Truncate the input, so it contains an integer number of frames.
|
// Truncate the input, so it contains an integer number of frames.
|
||||||
let input = {
|
let input = {
|
||||||
|
|
Loading…
Reference in a new issue