pub struct AudioEngine { /* private fields */ }
Expand description

The main struct of the crate.

This hold all existing SoundSources and cpal::platform::Stream.

Implementations

Tries to create a new AudioEngine.

cpal will spawn a new thread where the sound samples will be sampled, mixed, and outputed to the output stream.

The sample rate that is currently being outputed to the device.

The number of channels that is currently being outputed to the device.

Create a new Sound.

Return a Err if the number of channels doesn’t match the output number of channels. If the ouput number of channels is 1, or the number of channels of source is 1, source will be automatic wrapped in a ChannelConverter.

If the sample_rate of source mismatch the output sample_rate, source will be wrapped in a SampleRateConverter.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.