diff options
author | Tomasz Andrzejak <andreiltd@gmail.com> | 2022-02-01 02:16:20 +0300 |
---|---|---|
committer | Tomasz Andrzejak <andreiltd@gmail.com> | 2022-02-01 02:16:20 +0300 |
commit | 2c6ab9dd1fb214ca0a77a4eb0cb1cb1202ca1176 (patch) | |
tree | 4826222ced7363c0dc9c8eb997c145725f7e2ff3 /audio | |
parent | e419c18a87abb5c41d64f47a63a5e89191439855 (diff) |
Bump hrtf to version 0.8
hrtfrender tests are now using a fake hrir configuration file which is
stripped of actual position coefficients. The generated config does not
work anymore.
Diffstat (limited to 'audio')
-rw-r--r-- | audio/audiofx/Cargo.toml | 2 | ||||
-rw-r--r-- | audio/audiofx/tests/hrtfrender.rs | 39 | ||||
-rw-r--r-- | audio/audiofx/tests/test.hrir | bin | 0 -> 8200 bytes |
3 files changed, 3 insertions, 38 deletions
diff --git a/audio/audiofx/Cargo.toml b/audio/audiofx/Cargo.toml index 53712ecea..c0f431502 100644 --- a/audio/audiofx/Cargo.toml +++ b/audio/audiofx/Cargo.toml @@ -17,7 +17,7 @@ byte-slice-cast = "1.0" num-traits = "0.2" once_cell = "1.0" ebur128 = "0.1" -hrtf = "0.7" +hrtf = "0.8" nnnoiseless = { version = "0.3", default-features = false } smallvec = "1" atomic_refcell = "0.1" diff --git a/audio/audiofx/tests/hrtfrender.rs b/audio/audiofx/tests/hrtfrender.rs index b8fbe453a..a84e64be9 100644 --- a/audio/audiofx/tests/hrtfrender.rs +++ b/audio/audiofx/tests/hrtfrender.rs @@ -10,47 +10,12 @@ use gst::glib; use gst::prelude::*; use once_cell::sync::Lazy; -use std::io::{Cursor, Write}; static CONFIG: Lazy<glib::Bytes> = Lazy::new(|| { - let mut buff = Cursor::new(vec![0u8; 1024]); - - write_config(&mut buff).unwrap(); - glib::Bytes::from_owned(buff.get_ref().to_owned()) + let buff = include_bytes!("test.hrir"); + glib::Bytes::from_owned(buff) }); -// Generates a fake config -fn write_config(writer: &mut impl Write) -> std::io::Result<()> { - const SAMPLE_RATE: u32 = 44_100; - const LENGTH: u32 = 2; - const VERTEX_COUNT: u32 = 2; - const INDEX_COUNT: u32 = 2 * 3; - - writer.write_all(b"HRIR")?; - writer.write_all(&SAMPLE_RATE.to_le_bytes())?; - writer.write_all(&LENGTH.to_le_bytes())?; - writer.write_all(&VERTEX_COUNT.to_le_bytes())?; - writer.write_all(&INDEX_COUNT.to_le_bytes())?; - - // Write Indices - for _ in 0..INDEX_COUNT { - writer.write_all(&0u32.to_le_bytes())?; - } - - // Write Vertices - for _ in 0..VERTEX_COUNT { - for _ in 0..3 { - writer.write_all(&0u32.to_le_bytes())?; - } - - for _ in 0..LENGTH * 2 { - writer.write_all(&0f32.to_le_bytes())?; - } - } - - Ok(()) -} - fn init() { use std::sync::Once; static INIT: Once = Once::new(); diff --git a/audio/audiofx/tests/test.hrir b/audio/audiofx/tests/test.hrir Binary files differnew file mode 100644 index 000000000..faf424a4d --- /dev/null +++ b/audio/audiofx/tests/test.hrir |