[−][src]Struct hrtf::HrirSphere
HRIR (Head-Related Impulse Response) spheres is a 3d mesh whose points contains impulse responses for left and right ears. It is used for interpolation of impulse responses.
Implementations
impl HrirSphere
[src]
pub fn from_file<P: AsRef<Path>>(
path: P,
device_sample_rate: u32
) -> Result<Self, HrtfError>
[src]
path: P,
device_sample_rate: u32
) -> Result<Self, HrtfError>
Tries to load a sphere from a file.
pub fn new<R: Read>(
reader: R,
device_sample_rate: u32
) -> Result<Self, HrtfError>
[src]
reader: R,
device_sample_rate: u32
) -> Result<Self, HrtfError>
Loads HRIR sphere from given source.
Coordinate system
Hrtf spheres made in right-handed coordinate system. This fact can give weird positioning issues if your application uses left-handed coordinate system. However this can be fixed very easily: iterate over every point and invert X coordinate of it.
Sample rate
HRIR spheres from this base recorded in 44100 Hz sample rate. If your output device uses different sample rate, you have to resample initial set of .wav files and regenerate HRIR spheres. There could
pub fn transform(&mut self, matrix: Mat4)
[src]
Applies specified transform to each point in sphere. Can be used to rotate or scale sphere. Transform shouldn't have translation part, otherwise result of bilinear sampling is undefined.
pub fn points(&self) -> &[HrirPoint]
[src]
Returns shared reference to sphere points array.
pub fn points_mut(&mut self) -> &mut [HrirPoint]
[src]
Returns mutable reference to sphere points array.
pub fn len(&self) -> usize
[src]
Returns length of impulse response. It is same across all points in the sphere.
Auto Trait Implementations
impl RefUnwindSafe for HrirSphere
impl Send for HrirSphere
impl Sync for HrirSphere
impl Unpin for HrirSphere
impl UnwindSafe for HrirSphere
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,