Struct kira::manager::AudioManager [−][src]
Plays and manages audio.
The audio manager is responsible for all communication between the gameplay thread and the audio thread.
Implementations
impl AudioManager
[src]
pub fn new(settings: AudioManagerSettings) -> Result<Self, SetupError>
[src]
Creates a new audio manager and starts an audio thread.
pub fn add_sound(&mut self, sound: Sound) -> Result<SoundHandle, AddSoundError>
[src]
Sends a sound to the audio thread and returns a handle to the sound.
pub fn load_sound(
&mut self,
path: impl AsRef<Path>,
settings: SoundSettings
) -> Result<SoundHandle, LoadSoundError>
[src]
&mut self,
path: impl AsRef<Path>,
settings: SoundSettings
) -> Result<SoundHandle, LoadSoundError>
Loads a sound from a file and returns a handle to the sound.
This is a shortcut for constructing the sound manually and adding it
using AudioManager::add_sound
.
pub fn remove_sound(
&mut self,
id: impl Into<SoundId>
) -> Result<(), RemoveSoundError>
[src]
&mut self,
id: impl Into<SoundId>
) -> Result<(), RemoveSoundError>
Removes a sound from the audio thread.
pub fn add_arrangement(
&mut self,
arrangement: Arrangement
) -> Result<ArrangementHandle, AddArrangementError>
[src]
&mut self,
arrangement: Arrangement
) -> Result<ArrangementHandle, AddArrangementError>
Sends a arrangement to the audio thread and returns a handle to the arrangement.
pub fn remove_arrangement(
&mut self,
id: impl Into<ArrangementId>
) -> Result<(), RemoveArrangementError>
[src]
&mut self,
id: impl Into<ArrangementId>
) -> Result<(), RemoveArrangementError>
Removes an arrangement from the audio thread.
pub fn add_metronome(
&mut self,
settings: MetronomeSettings
) -> Result<MetronomeHandle, AddMetronomeError>
[src]
&mut self,
settings: MetronomeSettings
) -> Result<MetronomeHandle, AddMetronomeError>
Adds a metronome and returns a handle to it.
pub fn remove_metronome(
&mut self,
id: impl Into<MetronomeId>
) -> Result<(), RemoveMetronomeError>
[src]
&mut self,
id: impl Into<MetronomeId>
) -> Result<(), RemoveMetronomeError>
Removes a metronome from the audio thread.
pub fn start_sequence<CustomEvent: Clone + Eq + Hash>(
&mut self,
sequence: Sequence<CustomEvent>,
settings: SequenceInstanceSettings
) -> Result<SequenceInstanceHandle<CustomEvent>, StartSequenceError>
[src]
&mut self,
sequence: Sequence<CustomEvent>,
settings: SequenceInstanceSettings
) -> Result<SequenceInstanceHandle<CustomEvent>, StartSequenceError>
Starts a sequence.
pub fn add_parameter(
&mut self,
settings: ParameterSettings
) -> Result<ParameterHandle, AddParameterError>
[src]
&mut self,
settings: ParameterSettings
) -> Result<ParameterHandle, AddParameterError>
Creates a parameter with the specified starting value.
pub fn remove_parameter(
&mut self,
id: impl Into<ParameterId>
) -> Result<(), RemoveParameterError>
[src]
&mut self,
id: impl Into<ParameterId>
) -> Result<(), RemoveParameterError>
Removes a parameter from the audio thread.
pub fn main_track(&mut self) -> MainTrackHandle
[src]
Returns a handle to the main mixer track.
pub fn add_sub_track(
&mut self,
settings: SubTrackSettings
) -> Result<SubTrackHandle, AddSubTrackError>
[src]
&mut self,
settings: SubTrackSettings
) -> Result<SubTrackHandle, AddSubTrackError>
Creates a mixer sub-track.
pub fn remove_sub_track(
&mut self,
id: impl Into<SubTrackId>
) -> Result<(), RemoveSubTrackError>
[src]
&mut self,
id: impl Into<SubTrackId>
) -> Result<(), RemoveSubTrackError>
Removes a sub-track from the mixer.
pub fn add_send_track(
&mut self,
settings: SendTrackSettings
) -> Result<SendTrackHandle, AddSendTrackError>
[src]
&mut self,
settings: SendTrackSettings
) -> Result<SendTrackHandle, AddSendTrackError>
Creates a mixer send track.
pub fn remove_send_track(
&mut self,
id: impl Into<SendTrackId>
) -> Result<(), RemoveSendTrackError>
[src]
&mut self,
id: impl Into<SendTrackId>
) -> Result<(), RemoveSendTrackError>
Removes a send track from the mixer.
pub fn add_group(
&mut self,
settings: GroupSettings
) -> Result<GroupHandle, AddGroupError>
[src]
&mut self,
settings: GroupSettings
) -> Result<GroupHandle, AddGroupError>
Adds a group.
pub fn remove_group(
&mut self,
id: impl Into<GroupId>
) -> Result<(), RemoveGroupError>
[src]
&mut self,
id: impl Into<GroupId>
) -> Result<(), RemoveGroupError>
Removes a group.
pub fn add_stream(
&mut self,
stream: impl AudioStream,
track: TrackIndex
) -> Result<AudioStreamId, AddStreamError>
[src]
&mut self,
stream: impl AudioStream,
track: TrackIndex
) -> Result<AudioStreamId, AddStreamError>
Adds an audio stream.
pub fn remove_stream(
&mut self,
id: AudioStreamId
) -> Result<(), RemoveStreamError>
[src]
&mut self,
id: AudioStreamId
) -> Result<(), RemoveStreamError>
Removes an audio stream.
pub fn free_unused_resources(&mut self)
[src]
Frees resources that are no longer in use, such as unloaded sounds or finished sequences.
Trait Implementations
impl Drop for AudioManager
[src]
Auto Trait Implementations
impl !RefUnwindSafe for AudioManager
impl Send for AudioManager
impl !Sync for AudioManager
impl Unpin for AudioManager
impl !UnwindSafe for AudioManager
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,
pub 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, 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.
pub 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.
pub 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>,