[][src]Struct hrtf::HrirSphere

pub struct HrirSphere { /* fields omitted */ }

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]

Tries to load a sphere from a file.

pub fn new<R: Read>(
    reader: R,
    device_sample_rate: u32
) -> Result<Self, HrtfError>
[src]

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

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,