mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-25 13:01:07 +00:00
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.
This commit is contained in:
parent
e419c18a87
commit
2c6ab9dd1f
3 changed files with 3 additions and 38 deletions
|
@ -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"
|
||||
|
|
|
@ -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();
|
||||
|
|
BIN
audio/audiofx/tests/test.hrir
Normal file
BIN
audio/audiofx/tests/test.hrir
Normal file
Binary file not shown.
Loading…
Reference in a new issue