[−][src]Struct bae_rs::sample_format::stereo::Stereo
Struct representing a stereophonic audio sample.
Fields
left: SampleT
Left sample value.
right: SampleT
Right sample value.
Methods
impl Stereo
[src]
pub fn from_stereo(l: SampleT, r: SampleT) -> Stereo
[src]
Returns a new Stereo object created from individual left and right audio samples.
Parameters
l
- the left audio sample.r
- the right audio sapmle.
pub fn single_stereo(x: SampleT) -> Stereo
[src]
Returns a new Stereo object where both left and right channels are copied from the passed sample value.
pub fn from_mono(x: SampleT) -> Stereo
[src]
Creates a new Stereo object from a single monophonic sample. This function reduces the power of the given sample by half to reflect human hearing.
Parameters
x
- the input sample.
pub fn as_mono(self) -> SampleT
[src]
Converts the given stereophonic sample to a monophonic sample by summing the left and right samples and dividing by half power to get the full power monophonic sample.
Trait Implementations
impl Add<Stereo> for Stereo
[src]
type Output = Self
The resulting type after applying the +
operator.
fn add(self, rhs: Stereo) -> Self::Output
[src]
impl AddAssign<Stereo> for Stereo
[src]
fn add_assign(&mut self, rhs: Stereo)
[src]
impl Clone for Stereo
[src]
impl Copy for Stereo
[src]
impl Default for Stereo
[src]
impl From<[u8; 2]> for Stereo
[src]
fn from(v: [u8; 2]) -> Self
[src]
Converts the array of 2 bytes into a Stereo object. It is assumed that the bytes are 8-bit unsigned audio samples.
Parameters
v
- The raw bytes to convert from.
impl From<[u8; 4]> for Stereo
[src]
fn from(v: [u8; 4]) -> Self
[src]
Converts the array of 4 bytes into a Stereo object. It is assumed that the bytes are 16-bit signed audio samples.
Parameters
v
- The raw bytes to convert from.
impl From<[u8; 6]> for Stereo
[src]
fn from(v: [u8; 6]) -> Self
[src]
Converts the array of 6 bytes into a Stereo object. It is assumed that the bytes are 24-bit signed audio samples.
Parameters
v
- The raw bytes to convert from.
impl From<f32> for Stereo
[src]
fn from(s: SampleT) -> Self
[src]
Copies the given sample to the left and right channels. If you want to
use the half-power conversion, use Stereo::from_mono
.
impl Into<Vec<u8>> for Stereo
[src]
impl Mul<Stereo> for Stereo
[src]
type Output = Stereo
The resulting type after applying the *
operator.
fn mul(self, rhs: Stereo) -> Self::Output
[src]
impl Mul<Stereo> for SampleT
[src]
type Output = Stereo
The resulting type after applying the *
operator.
fn mul(self, rhs: Stereo) -> Self::Output
[src]
impl Mul<Stereo> for MathT
[src]
type Output = Stereo
The resulting type after applying the *
operator.
fn mul(self, rhs: Stereo) -> Self::Output
[src]
impl Mul<f32> for Stereo
[src]
type Output = Stereo
The resulting type after applying the *
operator.
fn mul(self, rhs: SampleT) -> Self::Output
[src]
impl Mul<f64> for Stereo
[src]
type Output = Stereo
Output type of the multiplication
fn mul(self, rhs: MathT) -> Self::Output
[src]
Multiplies a sample by a value. E.g. scaling the sample by a gain amount.
impl MulAssign<Stereo> for Stereo
[src]
fn mul_assign(&mut self, rhs: Stereo)
[src]
impl MulAssign<f32> for Stereo
[src]
fn mul_assign(&mut self, rhs: SampleT)
[src]
impl MulAssign<f64> for Stereo
[src]
fn mul_assign(&mut self, rhs: MathT)
[src]
impl Neg for Stereo
[src]
type Output = Self
The resulting type after applying the -
operator.
fn neg(self) -> Self::Output
[src]
impl Panner<Stereo, f32> for Stereo
[src]
fn to_sample_format(s: SampleT, g: f32) -> Stereo
[src]
impl Sub<Stereo> for Stereo
[src]
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, rhs: Stereo) -> Self
[src]
impl SubAssign<Stereo> for Stereo
[src]
fn sub_assign(&mut self, rhs: Stereo)
[src]
Auto Trait Implementations
impl RefUnwindSafe for Stereo
impl Send for Stereo
impl Sync for Stereo
impl Unpin for Stereo
impl UnwindSafe for Stereo
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,
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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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.
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.
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>,