Enum soundtouch::Setting

source ·
#[repr(u8)]
pub enum Setting { UseAaFilter = 0, AaFilterLength = 1, UseQuickseek = 2, SequenceMs = 3, SeekwindowMs = 4, OverlapMs = 5, NominalInputSequence = 6, NominalOutputSequence = 7, InitialLatency = 8, }
Expand description

A list of settings that can be enabled or disabled.

Variants§

§

UseAaFilter = 0

Enable/disable anti-alias filter in pitch transposer (0 = disable)

§

AaFilterLength = 1

Pitch transposer anti-alias filter length (8 .. 128 taps, default = 32)

§

UseQuickseek = 2

Enable/disable quick seeking algorithm in tempo changer routine (enabling quick seeking lowers CPU utilization but causes a minor sound quality compromising)

§

SequenceMs = 3

Time-stretch algorithm single processing sequence length in milliseconds. This determines to how long sequences the original sound is chopped in the time-stretch algorithm. See STTypes.h or README for more information.

§

SeekwindowMs = 4

Time-stretch algorithm seeking window length in milliseconds for algorithm that finds the best possible overlapping location. This determines from how wide window the algorithm may look for an optimal joining location when mixing the sound sequences back together. See STTypes.h or README for more information.

§

OverlapMs = 5

Time-stretch algorithm overlap length in milliseconds. When the chopped sound sequences are mixed back together, to form a continuous sound stream, this parameter defines over how long period the two consecutive sequences are let to overlap each other. See STTypes.h or README for more information.

§

NominalInputSequence = 6

Call get_setting with this ID to query processing sequence size in samples. This value gives approximate value of how many input samples you’ll need to feed into SoundTouch after initial buffering to get out a new batch of output samples.

This value does not include initial buffering at beginning of a new processing stream, use INITIAL_LATENCY to get the initial buffering size.

Notices:

  • This is read-only parameter, i.e. setSetting ignores this parameter

  • This parameter value is not pub constant but change depending on tempo/pitch/rate/samplerate settings.

§

NominalOutputSequence = 7

Call get_setting with this ID to query nominal average processing output size in samples. This value tells approcimate value how many output samples SoundTouch outputs once it does DSP processing run for a batch of input samples.

Notices:

  • This is read-only parameter, i.e. set_setting ignores this parameter
  • This parameter value is not pub constant but change depending on tempo/pitch/rate/samplerate settings.
§

InitialLatency = 8

Call get_setting with this ID to query initial processing latency, i.e. approx. how many samples you’ll need to enter to SoundTouch pipeline before you can expect to get first batch of ready output samples out.

After the first output batch, you can then expect to get approx. NOMINAL_OUTPUT_SEQUENCE ready samples out for every NOMINAL_INPUT_SEQUENCE samples that you enter into SoundTouch.

Example: processing with parameter -tempo=5 => initial latency = 5509 samples input sequence = 4167 samples output sequence = 3969 samples

Accordingly, you can expect to feed in approx. 5509 samples at beginning of the stream, and then you’ll get out the first 3969 samples. After that, for every approx. 4167 samples that you’ll put in, you’ll receive again approx. 3969 samples out.

This also means that average latency during stream processing is INITIAL_LATENCY-OUTPUT_SEQUENCE/2, in the above example case 5509-3969/2 = 3524 samples

Notices:

  • This is read-only parameter, i.e. set_setting ignores this parameter

  • This parameter value is not pub constant but change depending on tempo/pitch/rate/samplerate settings.

Trait Implementations§

source§

impl Clone for Setting

source§

fn clone(&self) -> Setting

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Setting

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for Setting

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.