Module source
Available on crate feature
dep_rodio
only.Expand description
Sources of sound and various filters.
Structs§
- Amplify
- Filter that modifies each sample by a given value.
- Automatic
Gain Control - Automatic Gain Control filter for maintaining consistent output levels.
- BltFilter
- This applies an audio filter, it can be a high or low pass filter.
- Buffered
- Iterator that at the same time extracts data from the iterator and stores it in a buffer.
- Channel
Volume - Combines channels in input into a single mono source, then plays that mono sound to each channel at the volume given for that channel.
- Chirp
- Generate a sine wave with an instantaneous frequency that changes/sweeps linearly over time.
At the end of the chirp, once the
end_frequency
is reached, the source is exhausted. - Delay
- A source that delays the given source by a certain amount.
- Done
- When the inner source is empty this decrements a
AtomicUsize
. - Empty
- An empty source.
- Empty
Callback - An empty source which executes a callback function
- FadeIn
- Filter that modifies raises the volume from silence over a time period.
- FadeOut
- Filter that modifies lowers the volume to silence over a time period.
- From
Factory Iter - Internal type used by
from_factory
. - From
Iter - A source that chains sources provided by an iterator.
- Linear
Gain Ramp - Filter that adds a linear gain ramp to the source over a given time range.
- Mix
- Filter that modifies each sample by a given value.
- Pausable
- Wraps a source and makes it pausable by calling
Pausable::set_paused
on this object. When the source is paused it returns zero value samples. - Periodic
Access - Calls a function on a source every time a period elapsed.
- Repeat
- A source that repeats the given source.
- Samples
Converter - Wrap the input and lazily converts the samples it provides to the type specified by the generic parameter D
- Signal
Generator - An infinite source that produces one of a selection of test waveforms.
- Sine
Wave - An infinite source that produces a sine.
- Skip
Duration - A source that skips specified duration of the given source from it’s current position.
- Skippable
- Wrap the source in a skippable. It allows ending the current source early by
calling
Skippable::skip
. If this source is in a queue such as the Sink ending the source early is equal to skipping the source. - Spatial
- A simple spatial audio source. The underlying source is transformed to Mono and then played in stereo. The left and right channel’s volume are amplified differently depending on the distance of the left and right ear to the source.
- Speed
- Filter that modifies each sample by a given value.
- Stoppable
- This is the same as
Skippable
see its docs - Take
Duration - A source that truncates the given source to a certain duration.
- Track
Position - Tracks the elapsed duration since the start of the underlying source.
- Uniform
Source Iterator - An iterator that reads from a
Source
and converts the samples to a specific type, sample-rate and channels count. - Zero
- An source that produces samples with value zero (silence). Depending on if
it where created with
Zero::new
orZero::new_samples
it can be never ending or finite.
Enums§
- Function
- Waveform functions.
- Seek
Error - Occurs when try_seek fails because the underlying decoder has an error or does not support seeking.
Traits§
- Source
- A source of samples.
Functions§
- chirp
- Convenience function to create a new
Chirp
source. - from_
factory - Builds a source that chains sources built from a factory.
- from_
iter - Builds a source that chains sources provided by an iterator.
Type Aliases§
- Crossfade
- Mixes one sound fading out with another sound fading in for the given duration.