### setup Source: https://docs.rs/kira/latest/kira/backend/cpal/struct.CpalBackend.html Starts the backend and returns itself and the initial sample rate. ```APIDOC ## setup ### Description Starts the backend and returns itself and the initial sample rate. ### Method `setup` ### Parameters * `settings` (Self::Settings) - Settings for this backend. * `_internal_buffer_size` (usize) - Internal buffer size. ### Returns `Result<(Self, u32), Self::Error>` - A Result containing the CpalBackend instance and the sample rate on success, or an error on failure. ``` -------------------------------- ### Configure Sound Start Time Source: https://docs.rs/kira/latest/kira/sound/streaming/struct.StreamingSoundData.html Sets the start time for the sound. This example shows how to configure a sound to start playing 4 ticks after a clock's current time. ```rust use kira::{ AudioManager, AudioManagerSettings, DefaultBackend, sound::streaming::{StreamingSoundData, StreamingSoundSettings}, clock::ClockSpeed, }; let mut manager = AudioManager::::new(AudioManagerSettings::default())?; let clock_handle = manager.add_clock(ClockSpeed::TicksPerMinute(120.0))?; let sound = StreamingSoundData::from_file("sound.ogg")? .start_time(clock_handle.time() + 4); ``` -------------------------------- ### start Source: https://docs.rs/kira/latest/kira/backend/cpal/struct.CpalBackend.html Sends the renderer to the backend to start audio playback. ```APIDOC ## start ### Description Sends the renderer to the backend to start audio playback. ### Method `start` ### Parameters * `renderer` (Renderer) - The renderer to start audio playback with. ### Returns `Result<(), Self::Error>` - Ok on success, or an error on failure. ``` -------------------------------- ### Create and Start a Clock Source: https://docs.rs/kira/latest/kira/clock/index.html Demonstrates how to create a new clock with a specified speed and start it. Clocks are created using `AudioManager::add_clock` and must be explicitly started. ```rust use kira::{ AudioManager, AudioManagerSettings, DefaultBackend, clock::ClockSpeed, }; let mut manager = AudioManager::::new(AudioManagerSettings::default())?; let mut clock = manager.add_clock(ClockSpeed::SecondsPerTick(1.0))?; clock.start(); ``` -------------------------------- ### Configure StaticSoundData Start Time Source: https://docs.rs/kira/latest/kira/sound/static_sound/struct.StaticSoundData.html Sets the start time for the sound playback. Returns a cloned StaticSoundData with the modified setting. ```rust pub fn start_time(&self, start_time: impl Into) -> Self ``` ```rust use kira { AudioManager, AudioManagerSettings, DefaultBackend, sound::static_sound::{StaticSoundData, StaticSoundSettings}, clock::ClockSpeed, }; let mut manager = AudioManager::::new(AudioManagerSettings::default())?; let clock_handle = manager.add_clock(ClockSpeed::TicksPerMinute(120.0))?; let sound = StaticSoundData::from_file("sound.ogg")? .start_time(clock_handle.time() + 4); ``` -------------------------------- ### Configure Sound Start Position Source: https://docs.rs/kira/latest/kira/sound/streaming/struct.StreamingSoundData.html Sets the starting playback position within the sound. ```rust pub fn start_position(self, start_position: impl Into) -> Self> ``` -------------------------------- ### StaticSoundData::start_time Source: https://docs.rs/kira/latest/kira/sound/static_sound/struct.StaticSoundData.html Sets the start time for the sound playback. Returns a clone of the StaticSoundData with the modified start time. ```APIDOC ## StaticSoundData::start_time ### Description Sets when the sound should start playing. ### Method `pub fn start_time(&self, start_time: impl Into) -> Self` ### Parameters #### Path Parameters - **start_time** (impl Into) - Required - The desired start time for playback. ### Returns A cheap clone of the `StaticSoundData` with the modified start time. ``` -------------------------------- ### Configure StaticSoundData Start Position Source: https://docs.rs/kira/latest/kira/sound/static_sound/struct.StaticSoundData.html Sets the starting playback position within the sound. Returns a cloned StaticSoundData with the modified setting. ```rust pub fn start_position( &self, start_position: impl Into, ) -> Self ``` -------------------------------- ### Start MockBackend with Renderer Source: https://docs.rs/kira/latest/kira/backend/mock/struct.MockBackend.html Sends the renderer to the backend to start audio playback. This function is part of the Backend trait implementation for MockBackend. ```rust fn start(&mut self, renderer: Renderer) -> Result<(), Self::Error> ``` -------------------------------- ### CpalBackend::start Source: https://docs.rs/kira/latest/kira/backend/type.DefaultBackend.html Starts audio playback by sending the renderer to the backend. This is part of the Backend trait implementation. ```APIDOC ## CpalBackend::start (Backend Trait Implementation) ### Description Sends the renderer to the backend to start audio playback. ### Method `fn start(&mut self, renderer: Renderer) -> Result<(), Self::Error>` ``` -------------------------------- ### Start Sound Using ClockTime Directly Source: https://docs.rs/kira/latest/kira/clock/index.html A shorthand for starting a sound on a clock tick, directly passing a `ClockTime` struct to the `start_time` function. ```rust manager.play( StaticSoundData::from_file("sound.ogg")? .start_time(ClockTime { clock: clock.id(), ticks: 4, fraction: 0.0, }) )?; ``` -------------------------------- ### Start Sound Using Clock Handle Offset Source: https://docs.rs/kira/latest/kira/clock/index.html Provides a convenient way to schedule a sound to start in the future by adding an integer offset to the clock's current time, obtained via `ClockHandle::time`. ```rust use kira::{ AudioManager, AudioManagerSettings, DefaultBackend, sound::static_sound::{StaticSoundData, StaticSoundSettings}, clock::ClockSpeed, }; manager.play( StaticSoundData::from_file("sound.ogg")? .start_time(clock.time() + 4) )?; ``` -------------------------------- ### Start Sound on Clock Tick Source: https://docs.rs/kira/latest/kira/clock/index.html Shows how to schedule a sound to start playing after a specific number of clock ticks. This uses `StartTime::ClockTime` to define the precise moment the sound should begin. ```rust use kira::{ clock::{ClockTime, ClockSpeed}, AudioManager, AudioManagerSettings, DefaultBackend, sound::static_sound::{StaticSoundData, StaticSoundSettings}, StartTime, }; let mut manager = AudioManager::::new(AudioManagerSettings::default())?; let mut clock = manager.add_clock(ClockSpeed::SecondsPerTick(1.0))?; manager.play( StaticSoundData::from_file("sound.ogg")? .start_time(StartTime::ClockTime(ClockTime { clock: clock.id(), ticks: 4, fraction: 0.0, })) )?; clock.start(); ``` -------------------------------- ### StaticSoundSettings::start_time Source: https://docs.rs/kira/latest/kira/sound/static_sound/struct.StaticSoundSettings.html Sets the start time for the static sound playback. ```APIDOC ## StaticSoundSettings::start_time ### Description Sets when the sound should start playing. ### Method ```rust pub fn start_time(self, start_time: impl Into) -> Self ``` ### Parameters * **start_time** (impl Into) - The time at which the sound should begin playback. ### Returns The modified `StaticSoundSettings` instance. ``` -------------------------------- ### Backend Trait Source: https://docs.rs/kira/latest/kira/backend/trait.Backend.html Defines the interface for audio backends, including settings, error types, and methods for setup and starting playback. ```APIDOC ## Trait Backend Connects a `Renderer` to a lower level audio API. ### Associated Types #### type Settings Settings for this backend. #### type Error Errors that can occur when using this backend. ### Methods #### fn setup(settings: Self::Settings, internal_buffer_size: usize) -> Result<(Self, u32), Self::Error> Starts the backend and returns itself and the initial sample rate. #### fn start(&mut self, renderer: Renderer) -> Result<(), Self::Error> Sends the renderer to the backend to start audio playback. ``` -------------------------------- ### Setup MockBackend Source: https://docs.rs/kira/latest/kira/backend/mock/struct.MockBackend.html Initializes the MockBackend, returning the backend instance and the initial sample rate. This is the entry point for using the mock backend in tests. ```rust fn setup( settings: Self::Settings, internal_buffer_size: usize, ) -> Result<(Self, u32), Self::Error> ``` -------------------------------- ### Example Usage of command_writers_and_readers Macro Source: https://docs.rs/kira/latest/kira/macro.command_writers_and_readers.html Demonstrates how to use the `command_writers_and_readers` macro with specific fields and types. ```rust command_writers_and_readers! { set_phase: f64, set_frequency: ValueChangeCommand, } ``` -------------------------------- ### Quat Interpolation Example Source: https://docs.rs/kira/latest/kira/trait.Tweenable.html Provides an example of interpolating Quaternions, typically used for smooth rotation changes in 3D. ```rust impl Tweenable for Quat { fn interpolate(a: Self, b: Self, amount: f64) -> Self { a.slerp(b, amount) } } ``` -------------------------------- ### Setup CpalBackend Source: https://docs.rs/kira/latest/kira/backend/cpal/struct.CpalBackend.html Initializes the CpalBackend with the provided settings and returns the backend instance along with the initial sample rate. This is part of the `Backend` trait implementation. ```rust fn setup( settings: Self::Settings, _internal_buffer_size: usize, ) -> Result<(Self, u32), Self::Error> ``` -------------------------------- ### Creating a New CompressorBuilder Source: https://docs.rs/kira/latest/kira/effect/compressor/struct.CompressorBuilder.html Initializes a new CompressorBuilder with default settings. Use this as a starting point for configuring a compressor. ```rust CompressorBuilder::new() ``` -------------------------------- ### StaticSoundData::start_position Source: https://docs.rs/kira/latest/kira/sound/static_sound/struct.StaticSoundData.html Sets the starting playback position within the sound. Returns a clone of the StaticSoundData with the modified start position. ```APIDOC ## StaticSoundData::start_position ### Description Sets where in the sound playback should start. ### Method `pub fn start_position( &self, start_position: impl Into, ) -> Self` ### Parameters #### Path Parameters - **start_position** (impl Into) - Required - The desired start position for playback. ``` -------------------------------- ### StreamingSoundSettings::start_time Source: https://docs.rs/kira/latest/kira/sound/streaming/struct.StreamingSoundSettings.html Sets the start time for the streaming sound. ```APIDOC ## `StreamingSoundSettings::start_time(start_time: impl Into)` ### Description Sets when the sound should start playing. ### Parameters * **start_time** (impl Into) - The time at which the sound should start playing. ### Returns A modified `StreamingSoundSettings` instance with the updated start time. ``` -------------------------------- ### Backend Trait Definition Source: https://docs.rs/kira/latest/kira/backend/trait.Backend.html Defines the interface for audio backends. Implementors must provide settings, error types, and methods for setup and starting playback. ```rust pub trait Backend: Sized { type Settings; type Error; // Required methods fn setup( settings: Self::Settings, internal_buffer_size: usize, ) -> Result<(Self, u32), Self::Error>; fn start(&mut self, renderer: Renderer) -> Result<(), Self::Error>; } ``` -------------------------------- ### StaticSoundSettings::start_position Source: https://docs.rs/kira/latest/kira/sound/static_sound/struct.StaticSoundSettings.html Sets the starting playback position for the static sound. ```APIDOC ## StaticSoundSettings::start_position ### Description Sets where in the sound playback should start. ### Method ```rust pub fn start_position(self, start_position: impl Into) -> Self ``` ### Parameters * **start_position** (impl Into) - The position within the sound to begin playback. ### Returns The modified `StaticSoundSettings` instance. ``` -------------------------------- ### Link Static Sound Volume to Modulator Source: https://docs.rs/kira/latest/kira/sound/static_sound/struct.StaticSoundHandle.html This example demonstrates linking the volume of a static sound to a modulator, allowing for dynamic control and smooth transitions. It requires setting up an AudioManager, a modulator, and configuring the volume with a specific mapping and tween. ```rust use kira::{ AudioManager, AudioManagerSettings, DefaultBackend, sound::static_sound::{StaticSoundData, StaticSoundSettings}, modulator::tweener::TweenerBuilder, Value, Tween, Mapping, Easing, Decibels, }; use std::time::Duration; let mut manager = AudioManager::::new(AudioManagerSettings::default())?; let tweener = manager.add_modulator(TweenerBuilder { initial_value: 0.5, })?; let mut sound = manager.play(StaticSoundData::from_file("sound.ogg")?)?; sound.set_volume(Value::FromModulator { id: tweener.id(), mapping: Mapping { input_range: (0.0, 1.0), output_range: (Decibels::SILENCE, Decibels::IDENTITY), easing: Easing::Linear, } }, Tween { duration: Duration::from_secs(3), ..Default::default() }); ``` -------------------------------- ### Link Static Sound Panning to Modulator Source: https://docs.rs/kira/latest/kira/sound/static_sound/struct.StaticSoundHandle.html This example demonstrates linking the panning of a static sound to a modulator for dynamic control. It involves setting up an AudioManager, a modulator, and configuring the panning with a specific mapping and tween. ```rust use kira::{ AudioManager, AudioManagerSettings, DefaultBackend, sound::static_sound::{StaticSoundData, StaticSoundSettings}, modulator::tweener::TweenerBuilder, Value, Easing, Mapping, Tween, Panning, }; use std::time::Duration; let mut manager = AudioManager::::new(AudioManagerSettings::default())?; let tweener = manager.add_modulator(TweenerBuilder { initial_value: -0.5, })?; let mut sound = manager.play(StaticSoundData::from_file("sound.ogg")?)?; sound.set_panning(Value::FromModulator { id: tweener.id(), mapping: Mapping { input_range: (-1.0, 1.0), output_range: (Panning::LEFT, Panning::RIGHT), easing: Easing::Linear, }, }, Tween { duration: Duration::from_secs(3), ..Default::default() }); ``` -------------------------------- ### Start Clock Source: https://docs.rs/kira/latest/kira/clock/struct.ClockHandle.html Initiates or resumes the clock's playback. ```rust pub fn start(&mut self) ``` -------------------------------- ### Start Tween on Clock Tick Source: https://docs.rs/kira/latest/kira/clock/index.html Illustrates how to use a clock to control the start time of a tween for a sound's playback rate. The tween begins when the clock reaches a specified tick. ```rust use std::time::Duration; use kira::{ AudioManager, AudioManagerSettings, DefaultBackend, sound::static_sound::{StaticSoundData, StaticSoundSettings}, Tween, clock::ClockSpeed, Startime, }; let mut manager = AudioManager::::new(AudioManagerSettings::default())?; let mut clock = manager.add_clock(ClockSpeed::SecondsPerTick(1.0))?; let mut sound = manager.play(StaticSoundData::from_file("sound.ogg")?)?; sound.set_playback_rate( 0.5, Tween { start_time: StartTime::ClockTime(clock.time() + 3), duration: Duration::from_secs(2), ..Default::default() }, ); clock.start(); ``` -------------------------------- ### Link Static Sound Playback Rate to Modulator Source: https://docs.rs/kira/latest/kira/sound/static_sound/struct.StaticSoundHandle.html This example demonstrates linking the playback rate of a static sound to a modulator for dynamic control. It involves setting up an AudioManager, a modulator, and configuring the playback rate with a specific mapping and tween. ```rust use kira::{ AudioManager, AudioManagerSettings, DefaultBackend, sound::static_sound::{StaticSoundData, StaticSoundSettings}, modulator::tweener::TweenerBuilder, Value, Easing, Mapping, Tween, PlaybackRate, }; use std::time::Duration; let mut manager = AudioManager::::new(AudioManagerSettings::default())?; let tweener = manager.add_modulator(TweenerBuilder { initial_value: 0.5, })?; let mut sound = manager.play(StaticSoundData::from_file("sound.ogg")?)?; sound.set_playback_rate(Value::FromModulator { id: tweener.id(), mapping: Mapping { input_range: (0.0, 1.0), output_range: (PlaybackRate(0.0), PlaybackRate(1.0)), easing: Easing::Linear, }, }, Tween { duration: Duration::from_secs(3), ..Default::default() }); ``` -------------------------------- ### Set LFO Starting Phase Source: https://docs.rs/kira/latest/kira/modulator/lfo/struct.LfoBuilder.html Specifies the initial phase of the LFO in radians, determining its starting point within the oscillation cycle. ```rust pub fn starting_phase(self, starting_phase: f64) -> Self ``` -------------------------------- ### resume_at Source: https://docs.rs/kira/latest/kira/sound/static_sound/struct.StaticSoundHandle.html Resumes playback at the given start time and fades in the sound from silence with the given tween. ```APIDOC ## resume_at ### Description Resumes playback at the given start time and fades in the sound from silence with the given tween. ### Parameters #### Path Parameters - **start_time** (StartTime) - Required - The time to resume playback from. - **tween** (Tween) - Required - The tween to use for fading in. ### Request Example ```rust // Assuming 'startTime' is a valid StartTime object and 'tween' is a valid Tween object sound.resume_at(startTime, tween); ``` ``` -------------------------------- ### f64 Interpolation Example Source: https://docs.rs/kira/latest/kira/trait.Tweenable.html Shows the interpolation logic for f64 values. Similar to f32, this is useful for precise numerical interpolations. ```rust impl Tweenable for f64 { fn interpolate(a: Self, b: Self, amount: f64) -> Self { a + (b - a) * amount } } ``` -------------------------------- ### Set Start Time for Static Sound Source: https://docs.rs/kira/latest/kira/sound/static_sound/struct.StaticSoundSettings.html Configures the exact time when the static sound should begin playing. Accepts any type that can be converted into a StartTime. ```rust pub fn start_time(self, start_time: impl Into) -> Self ``` -------------------------------- ### f32 Interpolation Example Source: https://docs.rs/kira/latest/kira/trait.Tweenable.html Demonstrates how to interpolate between two f32 values. This is a common use case for smooth transitions in graphics or audio. ```rust impl Tweenable for f32 { fn interpolate(a: Self, b: Self, amount: f64) -> Self { a + (b - a) * amount as f32 } } ``` -------------------------------- ### StreamingSoundSettings::start_position Source: https://docs.rs/kira/latest/kira/sound/streaming/struct.StreamingSoundSettings.html Sets the starting playback position for the streaming sound. ```APIDOC ## `StreamingSoundSettings::start_position(start_position: impl Into)` ### Description Sets where in the sound playback should start. ### Parameters * **start_position** (impl Into) - The position in the sound where playback should begin. ### Returns A modified `StreamingSoundSettings` instance with the updated start position. ``` -------------------------------- ### Create Default AudioManager Source: https://docs.rs/kira/latest/kira/struct.AudioManager.html Creates a new AudioManager instance using the DefaultBackend and default settings. This is a common starting point for most applications. ```rust use kira::{AudioManager, AudioManagerSettings, DefaultBackend}; let audio_manager = AudioManager::::new(AudioManagerSettings::default())?; ``` -------------------------------- ### Duration Interpolation Example Source: https://docs.rs/kira/latest/kira/trait.Tweenable.html Illustrates interpolation for Duration types. This can be used to smoothly transition between time intervals. ```rust impl Tweenable for Duration { fn interpolate(a: Self, b: Self, amount: f64) -> Self { a + (b - a) * amount } } ``` -------------------------------- ### CpalBackend::setup Source: https://docs.rs/kira/latest/kira/backend/type.DefaultBackend.html Initializes the backend and returns it along with the initial sample rate. This is part of the Backend trait implementation. ```APIDOC ## CpalBackend::setup (Backend Trait Implementation) ### Description Starts the backend and returns itself and the initial sample rate. ### Method `fn setup( settings: Self::Settings, _internal_buffer_size: usize, ) -> Result<(Self, u32), Self::Error>` ### Associated Types - `Settings`: `CpalBackendSettings` - `Error`: `Error` ``` -------------------------------- ### FilterBuilder::default Source: https://docs.rs/kira/latest/kira/effect/filter/struct.FilterBuilder.html Returns the default FilterBuilder value. This provides a convenient way to get a starting FilterBuilder. ```APIDOC ## default ### Description Returns the “default value” for a type. ### Method `default() -> Self` ``` -------------------------------- ### Trigger on_start_processing Callback Source: https://docs.rs/kira/latest/kira/backend/mock/struct.MockBackend.html Manually calls the on_start_processing callback of the Renderer. Use this to simulate the start of an audio processing cycle in tests. ```rust pub fn on_start_processing(&mut self) ``` -------------------------------- ### Create a new SendTrackBuilder Source: https://docs.rs/kira/latest/kira/track/struct.SendTrackBuilder.html Creates a new SendTrackBuilder with default settings. This is the starting point for configuring a send track. ```rust let builder = SendTrackBuilder::new(); ``` -------------------------------- ### Modulator Trait Definition Source: https://docs.rs/kira/latest/kira/modulator/trait.Modulator.html Defines the Modulator trait with required methods for updating, getting the current value, and checking completion, along with a provided method for start processing. ```rust pub trait Modulator: Send { // Required methods fn update(&mut self, dt: f64, info: &Info<'_>); fn value(&self) -> f64; fn finished(&self) -> bool; // Provided method fn on_start_processing(&mut self) { ... } } ``` -------------------------------- ### Set Start Position for Static Sound Source: https://docs.rs/kira/latest/kira/sound/static_sound/struct.StaticSoundSettings.html Specifies the initial playback position within the static sound. Accepts any type that can be converted into a PlaybackPosition. ```rust pub fn start_position(self, start_position: impl Into) -> Self ``` -------------------------------- ### Region Struct Definition Source: https://docs.rs/kira/latest/kira/sound/struct.Region.html Defines a region of audio with a start and end position. The start is inclusive and the end is exclusive. ```rust pub struct Region { pub start: PlaybackPosition, pub end: EndPosition, } ``` -------------------------------- ### with_settings Source: https://docs.rs/kira/latest/kira/sound/static_sound/struct.StaticSoundData.html Returns a cheap clone of the `StaticSoundData` with the specified settings. ```APIDOC ## pub fn with_settings(&self, settings: StaticSoundSettings) -> Self ### Description Returns a cheap clone of the `StaticSoundData` with the specified settings. ### Method Implies a method call on the `StaticSoundData` object. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None provided in source. ### Response #### Success Response Returns a modified `Self` (StaticSoundData) with the specified settings. #### Response Example None provided, returns `Self`. ``` -------------------------------- ### Start Tweener Transition Source: https://docs.rs/kira/latest/kira/modulator/tweener/struct.TweenerHandle.html Initiates a transition for the tweener from its current value to a specified target value, using a given tweening function. This is the primary method for animating values. ```rust pub fn set(&mut self, target: f64, tween: Tween) ``` -------------------------------- ### MainTrackBuilder::new Source: https://docs.rs/kira/latest/kira/track/struct.MainTrackBuilder.html Creates a new MainTrackBuilder with default settings. ```APIDOC ## MainTrackBuilder::new ### Description Creates a new `MainTrackBuilder` with the default settings. ### Signature ```rust pub fn new() -> Self ``` ``` -------------------------------- ### StaticSoundSettings::new Source: https://docs.rs/kira/latest/kira/sound/static_sound/struct.StaticSoundSettings.html Creates a new StaticSoundSettings instance with default values. ```APIDOC ## StaticSoundSettings::new ### Description Creates a new `StaticSoundSettings` with the default settings. ### Method ```rust pub fn new() -> Self ``` ### Returns A new `StaticSoundSettings` instance. ``` -------------------------------- ### Vec3 Interpolation Example Source: https://docs.rs/kira/latest/kira/trait.Tweenable.html Demonstrates interpolation for Vec3 (3D vector) types, useful for animating positions or scaling in 3D space. ```rust impl Tweenable for Vec3 { fn interpolate(a: Self, b: Self, amount: f64) -> Self { a + (b - a) * amount } } ``` -------------------------------- ### StreamingSoundData::start_time Source: https://docs.rs/kira/latest/kira/sound/streaming/struct.StreamingSoundData.html Sets the time at which the sound should start playing. This allows for precise scheduling of audio playback relative to other events or clocks. ```APIDOC ## StreamingSoundData::start_time ### Description Sets when the sound should start playing. ### Signature ```rust pub fn start_time(self, start_time: impl Into) -> Self ``` ### Parameters * `start_time`: The time at which the sound should begin playback. This can be an absolute time or relative to a clock. ### Examples Configuring a sound to start 4 ticks after a clock’s current time: ```rust use kira::{ AudioManager, AudioManagerSettings, DefaultBackend, sound::streaming::{StreamingSoundData, StreamingSoundSettings}, clock::ClockSpeed, }; let mut manager = AudioManager::::new(AudioManagerSettings::default())?; let clock_handle = manager.add_clock(ClockSpeed::TicksPerMinute(120.0))?; let sound = StreamingSoundData::from_file("sound.ogg")? .start_time(clock_handle.time() + 4); ``` ``` -------------------------------- ### CompressorBuilder::new Source: https://docs.rs/kira/latest/kira/effect/compressor/struct.CompressorBuilder.html Creates a new CompressorBuilder with default settings. ```APIDOC ## CompressorBuilder::new ### Description Creates a new `CompressorBuilder` with the default settings. ### Method `new()` ### Returns `Self` (a new `CompressorBuilder` instance) ``` -------------------------------- ### Determine Clock Start Time Source: https://docs.rs/kira/latest/kira/info/struct.Info.html Determines whether an event with a given start time should begin now, later, or never, based on the current state of the clocks. ```rust pub fn when_to_start(&self, time: ClockTime) -> WhenToStart ``` -------------------------------- ### Set Loop Region from Start to End Source: https://docs.rs/kira/latest/kira/sound/static_sound/struct.StaticSoundHandle.html Configures the sound to loop a specific segment from a start time to the end of the sound. Use this when you want a continuous playback of a defined portion. ```rust sound.set_loop_region(3.0..); ``` -------------------------------- ### StreamingSoundHandle Source: https://docs.rs/kira/latest/kira/sound/streaming/struct.StreamingSoundHandle.html Represents a streaming sound that can be controlled after playback has started. ```APIDOC ## Struct StreamingSoundHandle Controls a streaming sound. ### Methods #### `state(&self) -> PlaybackState` Returns the current playback state of the sound. #### `position(&self) -> f64` Returns the current playback position of the sound (in seconds). #### `set_volume(&mut self, volume: impl Into>, tween: Tween)` Sets the volume of the sound. ##### Examples Set the volume of the sound immediately: ```rust use kira::Tween; sound.set_volume(-6.0, Tween::default()); ``` Smoothly transition the volume to a target volume: ```rust use kira::Tween; use std::time::Duration; sound.set_volume(-6.0, Tween { duration: Duration::from_secs(3), ..Default::default() }); ``` Link the volume to a modulator, smoothly transitioning from the current value: ```rust use kira::{ AudioManager, AudioManagerSettings, DefaultBackend, sound::streaming::{StreamingSoundData, StreamingSoundSettings}, modulator::tweener::TweenerBuilder, Value, Tween, Mapping, Easing, Decibels, }; use std::time::Duration; let mut manager = AudioManager::::new(AudioManagerSettings::default())?; let tweener = manager.add_modulator(TweenerBuilder { initial_value: 0.5, })?; let mut sound = manager.play(StreamingSoundData::from_file("sound.ogg")?)?; sound.set_volume(Value::FromModulator { id: tweener.id(), mapping: Mapping { input_range: (0.0, 1.0), output_range: (Decibels::SILENCE, Decibels::IDENTITY), easing: Easing::Linear, } }, Tween { duration: Duration::from_secs(3), ..Default::default() }); ``` #### `set_playback_rate(&mut self, playback_rate: impl Into>, tween: Tween)` Sets the playback rate of the sound. Changing the playback rate will change both the speed and pitch of the sound. ##### Examples Set the playback rate of the sound immediately: ```rust use kira::Tween; sound.set_playback_rate(0.5, Tween::default()); ``` Smoothly transition the playback rate to a target value in semitones: ```rust use kira::{Tween, Semitones}; use std::time::Duration; sound.set_playback_rate(Semitones(-2.0), Tween { duration: Duration::from_secs(3), ..Default::default() }); ``` Link the playback rate to a modulator, smoothly transitioning from the current value: ```rust use kira::{ AudioManager, AudioManagerSettings, DefaultBackend, sound::streaming::{StreamingSoundData, StreamingSoundSettings}, modulator::tweener::TweenerBuilder, Value, Easing, Mapping, Tween, PlaybackRate, }; use std::time::Duration; let mut manager = AudioManager::::new(AudioManagerSettings::default())?; let tweener = manager.add_modulator(TweenerBuilder { initial_value: 0.5, })?; let mut sound = manager.play(StreamingSoundData::from_file("sound.ogg")?)?; sound.set_playback_rate(Value::FromModulator { id: tweener.id(), mapping: Mapping { input_range: (0.0, 1.0), output_range: (PlaybackRate(0.0), PlaybackRate(1.0)), easing: Easing::Linear, }, }, Tween { duration: Duration::from_secs(3), ..Default::default() }); ``` #### `set_panning(&mut self, panning: impl Into>, tween: Tween)` Sets the panning of the sound, where `-1.0` is hard left, `0.0` is center, and `1.0` is hard right. ##### Examples Smoothly transition the panning to a target value: ```rust use kira::Tween; use std::time::Duration; sound.set_panning(-0.5, Tween { duration: Duration::from_secs(3), ..Default::default() }); ``` Link the panning to a modulator, smoothly transitioning from the current value: ```rust use kira::{ AudioManager, AudioManagerSettings, DefaultBackend, sound::streaming::{StreamingSoundData, StreamingSoundSettings}, modulator::tweener::TweenerBuilder, Value, Easing, Mapping, Tween, Panning, }; use std::time::Duration; let mut manager = AudioManager::::new(AudioManagerSettings::default())?; let tweener = manager.add_modulator(TweenerBuilder { initial_value: -0.5, })?; let mut sound = manager.play(StreamingSoundData::from_file("sound.ogg")?)?; sound.set_panning(Value::FromModulator { id: tweener.id(), mapping: Mapping { input_range: (-1.0, 1.0), output_range: (Panning::LEFT, Panning::RIGHT), easing: Easing::Linear, }, }, Tween { duration: Duration::from_secs(3), ..Default::default() }); ``` ``` -------------------------------- ### Create and Slice StaticSoundData Source: https://docs.rs/kira/latest/kira/sound/static_sound/struct.StaticSoundData.html Demonstrates creating a StaticSoundData instance and then slicing it to represent a specific portion of the audio. The `num_frames` and `frame_at_index` methods will respect this slice. ```rust use kira::{ sound::static_sound::{StaticSoundData, StaticSoundSettings}, Frame, }; let sound = StaticSoundData { sample_rate: 1, frames: (0..10).map(|i| Frame::from_mono(i as f32)).collect(), settings: StaticSoundSettings::default(), slice: None, }; let sliced = sound.slice(3.0..6.0); assert_eq!(sliced.num_frames(), 3); assert_eq!(sliced.frame_at_index(0), Some(Frame::from_mono(3.0))); assert_eq!(sliced.frame_at_index(1), Some(Frame::from_mono(4.0))); ``` -------------------------------- ### impl Any for T Source: https://docs.rs/kira/latest/kira/effect/filter/struct.FilterBuilder.html Provides the `type_id` method to get the `TypeId` of an object. ```APIDOC ## fn type_id(&self) -> TypeId ### Description Gets the `TypeId` of `self`. ### Method `type_id` ### Parameters None ### Returns - `TypeId`: The unique identifier for the type of `self`. ``` -------------------------------- ### Renderer::on_start_processing Source: https://docs.rs/kira/latest/kira/backend/struct.Renderer.html Called by the backend to signal that it is time to process a new batch of audio samples. This method should be used to prepare the Renderer for the next processing cycle. ```APIDOC ## Renderer::on_start_processing ### Description Called by the backend when it’s time to process a new batch of samples. ### Method `on_start_processing` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ``` -------------------------------- ### Configure Kira Dependencies for Optimized Dev Profile Source: https://docs.rs/kira/latest/kira/index.html Add this to your Cargo.toml to optimize Kira and its audio dependencies for the 'dev' profile. This improves performance at the cost of increased compile times when building from scratch. ```toml [profile.dev.package.kira] opt-level = 3 [profile.dev.package.cpal] opt-level = 3 [profile.dev.package.symphonia] opt-level = 3 [profile.dev.package.symphonia-bundle-mp3] opt-level = 3 [profile.dev.package.symphonia-format-ogg] opt-level = 3 [profile.dev.package.symphonia-codec-vorbis] opt-level = 3 [profile.dev.package.symphonia-bundle-flac] opt-level = 3 [profile.dev.package.symphonia-format-wav] opt-level = 3 [profile.dev.package.symphonia-codec-pcm] opt-level = 3 ``` -------------------------------- ### Play Sound on a Track Source: https://docs.rs/kira/latest/kira/track/index.html Shows how to play a sound file on a previously created track. Requires importing StaticSoundData. ```rust use kira::sound::static_sound::StaticSoundData; track.play(StaticSoundData::from_file("sound.ogg")?)?; ``` -------------------------------- ### From Conversions for StartTime Source: https://docs.rs/kira/latest/kira/enum.StartTime.html Allows converting ClockTime and Duration into StartTime. ```rust fn from(v: ClockTime) -> Self ``` ```rust fn from(v: Duration) -> Self ``` -------------------------------- ### Get Current Clock Time Source: https://docs.rs/kira/latest/kira/clock/struct.ClockHandle.html Retrieves the current time of the clock. ```rust pub fn time(&self) -> ClockTime ``` -------------------------------- ### Create and Use a Sub-Track Source: https://docs.rs/kira/latest/kira/track/index.html Demonstrates how to add a sub-track to the audio manager and play a sound on it. Requires importing AudioManager, AudioManagerSettings, DefaultBackend, and TrackBuilder. ```rust use kira::{ AudioManager, AudioManagerSettings, DefaultBackend, track::TrackBuilder, }; let mut manager = AudioManager::::new(AudioManagerSettings::default())?; let mut track = manager.add_sub_track(TrackBuilder::default())?; ``` -------------------------------- ### Get Current Parameter Value Source: https://docs.rs/kira/latest/kira/struct.Parameter.html Retrieves the current actual value of the Parameter. ```rust pub fn value(&self) -> T ``` -------------------------------- ### Generic FromSample Implementation Source: https://docs.rs/kira/latest/kira/backend/mock/struct.MockBackendSettings.html Allows creating a sample from itself. ```rust fn from_sample_(s: S) -> S ``` -------------------------------- ### Get Clock ID Source: https://docs.rs/kira/latest/kira/clock/struct.ClockHandle.html Retrieves the unique identifier for the clock associated with this handle. ```rust pub fn id(&self) -> ClockId ``` -------------------------------- ### StructuralPartialEq Implementation for StartTime Source: https://docs.rs/kira/latest/kira/enum.StartTime.html Provides structural equality comparison for StartTime. ```rust impl StructuralPartialEq for StartTime ``` -------------------------------- ### Get Number of Sub-Tracks Source: https://docs.rs/kira/latest/kira/track/struct.TrackHandle.html Returns the current number of child tracks associated with this track. ```rust pub fn num_sub_tracks(&self) -> usize ``` -------------------------------- ### PartialEq Implementation for StartTime Source: https://docs.rs/kira/latest/kira/enum.StartTime.html Enables comparison of StartTime values for equality. ```rust fn eq(&self, other: &StartTime) -> bool ``` ```rust fn ne(&self, other: &StartTime) -> bool ``` -------------------------------- ### Get Sub-Track Capacity Source: https://docs.rs/kira/latest/kira/track/struct.TrackHandle.html Returns the maximum number of child tracks that can be added to this track. ```rust pub fn sub_track_capacity(&self) -> usize ``` -------------------------------- ### Get Track Playback State Source: https://docs.rs/kira/latest/kira/track/struct.TrackHandle.html Retrieves the current playback state of a mixer track. ```rust pub fn state(&self) -> TrackPlaybackState ``` -------------------------------- ### DelayBuilder::new Source: https://docs.rs/kira/latest/kira/effect/delay/struct.DelayBuilder.html Creates a new DelayBuilder with default settings. ```APIDOC ## DelayBuilder::new ### Description Creates a new `DelayBuilder` with the default settings. ### Signature ```rust pub fn new() -> Self ``` ``` -------------------------------- ### TrackBuilder::new Source: https://docs.rs/kira/latest/kira/track/struct.TrackBuilder.html Creates a new TrackBuilder with default settings. ```APIDOC ## TrackBuilder::new ### Description Creates a new `TrackBuilder` with the default settings. ### Method `TrackBuilder::new()` ### Returns `Self` (a new `TrackBuilder` instance) ``` -------------------------------- ### Get Number of Sounds Playing on MainTrackHandle Source: https://docs.rs/kira/latest/kira/track/struct.MainTrackHandle.html Returns the number of sounds currently playing on this track. ```rust pub fn num_sounds(&self) -> usize ``` -------------------------------- ### Create a Listener for Spatial Audio Source: https://docs.rs/kira/latest/kira/track/index.html Initialize an audio manager and add a listener using `AudioManager::add_listener`. This listener represents the viewpoint for 3D audio. ```rust use kira::{AudioManager, AudioManagerSettings, DefaultBackend}; let mut manager = AudioManager::::new(AudioManagerSettings::default())?; let listener = manager.add_listener(glam::Vec3::ZERO, glam::Quat::IDENTITY)?; ``` -------------------------------- ### Create a SpatialTrackBuilder with volume linked to a modulator Source: https://docs.rs/kira/latest/kira/track/struct.SpatialTrackBuilder.html Creates a SpatialTrackBuilder and links its volume to a modulator. This requires setting up an AudioManager and a Tweener modulator, then configuring the volume with a specific mapping. ```rust use kira:: { AudioManager, AudioManagerSettings, DefaultBackend, modulator::tweener::TweenerBuilder, track::SpatialTrackBuilder, Easing, Value, Mapping, Decibels, }; let mut manager = AudioManager::::new(AudioManagerSettings::default())?; let tweener = manager.add_modulator(TweenerBuilder { initial_value: 0.5, })?; let builder = SpatialTrackBuilder::new().volume(Value::FromModulator { id: tweener.id(), mapping: Mapping { input_range: (0.0, 1.0), output_range: (Decibels::SILENCE, Decibels::IDENTITY), easing: Easing::Linear, }, }); ``` -------------------------------- ### Get Sound Capacity of MainTrackHandle Source: https://docs.rs/kira/latest/kira/track/struct.MainTrackHandle.html Returns the maximum number of sounds that can play simultaneously on this track. ```rust pub fn sound_capacity(&self) -> usize ``` -------------------------------- ### Get Previous Parameter Value Source: https://docs.rs/kira/latest/kira/struct.Parameter.html Retrieves the previous actual value of the Parameter before the last update. ```rust pub fn previous_value(&self) -> T ``` -------------------------------- ### Any Trait Implementation for TweenerBuilder Source: https://docs.rs/kira/latest/kira/modulator/tweener/struct.TweenerBuilder.html Demonstrates the implementation of the Any trait for TweenerBuilder, providing a method to get the TypeId. ```rust impl Any for T where T: 'static + ?Sized, { fn type_id(&self) -> TypeId; } ``` -------------------------------- ### SendTrackBuilder::new Source: https://docs.rs/kira/latest/kira/track/struct.SendTrackBuilder.html Creates a new SendTrackBuilder with default settings. ```APIDOC ## SendTrackBuilder::new ### Description Creates a new `SendTrackBuilder` with the default settings. ### Method ```rust pub fn new() -> Self ``` ### Returns A new instance of `SendTrackBuilder`. ``` -------------------------------- ### ClockHandle Methods Source: https://docs.rs/kira/latest/kira/clock/struct.ClockHandle.html Provides methods to get information about the clock, control its playback, and modify its speed. ```APIDOC ## ClockHandle Methods ### `id()` Returns the unique identifier for the clock. - **Returns**: `ClockId` ### `ticking()` Returns `true` if the clock is currently ticking and `false` if not. - **Returns**: `bool` ### `time()` Returns the current time of the clock. - **Returns**: `ClockTime` ### `set_speed()` Sets the speed of the clock. - **Parameters**: - `speed`: The desired speed for the clock. Can be any type that implements `Into>`. - `tween`: The `Tween` to use for animating the speed change. ### `start()` Starts or resumes the clock. ### `pause()` Pauses the clock. ### `stop()` Stops and resets the clock. ``` -------------------------------- ### From for StartTime Source: https://docs.rs/kira/latest/kira/clock/struct.ClockTime.html Implements conversion from ClockTime to StartTime. ```APIDOC ## impl From for StartTime ### Description Converts a `ClockTime` instance into a `StartTime` instance. ### Method Signature `fn from(v: ClockTime) -> Self` ``` -------------------------------- ### TweenerBuilder Implementation of ModulatorBuilder Source: https://docs.rs/kira/latest/kira/modulator/trait.ModulatorBuilder.html Example of implementing ModulatorBuilder for TweenerBuilder, specifying TweenerHandle as the associated Handle type. ```rust type Handle = TweenerHandle; ``` -------------------------------- ### Generic CloneToUninit Implementation (Nightly) Source: https://docs.rs/kira/latest/kira/backend/mock/struct.MockBackendSettings.html Nightly-only experimental API for cloning data into uninitialized memory. ```rust unsafe fn clone_to_uninit(&self, dest: *mut u8) ``` -------------------------------- ### LfoBuilder Implementation of ModulatorBuilder Source: https://docs.rs/kira/latest/kira/modulator/trait.ModulatorBuilder.html Example of implementing ModulatorBuilder for LfoBuilder, specifying LfoHandle as the associated Handle type. ```rust type Handle = LfoHandle; ``` -------------------------------- ### VolumeControlBuilder Implementor Source: https://docs.rs/kira/latest/kira/effect/trait.EffectBuilder.html Example of an EffectBuilder implementation for a VolumeControl effect. It specifies VolumeControlHandle as its associated Handle type. ```rust type Handle = VolumeControlHandle; ``` -------------------------------- ### Initialize DelayBuilder Source: https://docs.rs/kira/latest/kira/effect/delay/struct.DelayBuilder.html Creates a new DelayBuilder with default settings to begin configuring a delay effect. ```rust pub fn new() -> Self ``` -------------------------------- ### ReverbBuilder Implementor Source: https://docs.rs/kira/latest/kira/effect/trait.EffectBuilder.html Example of an EffectBuilder implementation for a Reverb effect. It specifies ReverbHandle as its associated Handle type. ```rust type Handle = ReverbHandle; ``` -------------------------------- ### Create a new TrackBuilder Source: https://docs.rs/kira/latest/kira/track/struct.TrackBuilder.html Instantiate a new TrackBuilder with default settings. ```rust let builder = TrackBuilder::new(); ``` -------------------------------- ### PanningControlBuilder Implementor Source: https://docs.rs/kira/latest/kira/effect/trait.EffectBuilder.html Example of an EffectBuilder implementation for a PanningControl effect. It specifies PanningControlHandle as its associated Handle type. ```rust type Handle = PanningControlHandle; ``` -------------------------------- ### FilterBuilder Implementor Source: https://docs.rs/kira/latest/kira/effect/trait.EffectBuilder.html Example of an EffectBuilder implementation for a Filter effect. It specifies FilterHandle as its associated Handle type. ```rust type Handle = FilterHandle; ``` -------------------------------- ### StreamingSoundSettings::new Source: https://docs.rs/kira/latest/kira/sound/streaming/struct.StreamingSoundSettings.html Creates a new StreamingSoundSettings with default values. ```APIDOC ## `StreamingSoundSettings::new()` ### Description Creates a new `StreamingSoundSettings` with the default settings. ### Returns A new `StreamingSoundSettings` instance with default values. ``` -------------------------------- ### Clone Implementation for StartTime Source: https://docs.rs/kira/latest/kira/enum.StartTime.html Provides methods to duplicate StartTime values. ```rust fn clone(&self) -> StartTime ``` ```rust fn clone_from(&mut self, source: &Self) ``` -------------------------------- ### EqFilterBuilder Implementor Source: https://docs.rs/kira/latest/kira/effect/trait.EffectBuilder.html Example of an EffectBuilder implementation for an EqFilter effect. It specifies EqFilterHandle as its associated Handle type. ```rust type Handle = EqFilterHandle; ``` -------------------------------- ### DistortionBuilder Implementor Source: https://docs.rs/kira/latest/kira/effect/trait.EffectBuilder.html Example of an EffectBuilder implementation for a Distortion effect. It specifies DistortionHandle as its associated Handle type. ```rust type Handle = DistortionHandle; ``` -------------------------------- ### Build Effect and Handle Source: https://docs.rs/kira/latest/kira/effect/volume_control/struct.VolumeControlBuilder.html Creates the actual audio effect and a handle to control it from gameplay code. This is the primary method for instantiating an effect from its builder. ```rust type Handle = Box; fn build(self) -> (Box, Self::Handle) ``` -------------------------------- ### Play a Streaming Sound Source: https://docs.rs/kira/latest/kira/sound/streaming/index.html Demonstrates how to play an audio file using `StreamingSoundData`. This requires initializing the `AudioManager` and then passing the decoded sound data to it. Ensure the audio file exists at the specified path. ```rust use kira::{ AudioManager, AudioManagerSettings, DefaultBackend, sound::streaming::{StreamingSoundData, StreamingSoundSettings}, }; let mut manager = AudioManager::::new(AudioManagerSettings::default())?; let sound_data = StreamingSoundData::from_file("sound.ogg")?; manager.play(sound_data)?; ``` -------------------------------- ### DelayBuilder Implementor Source: https://docs.rs/kira/latest/kira/effect/trait.EffectBuilder.html Example of an EffectBuilder implementation for a Delay effect. It specifies DelayHandle as its associated Handle type. ```rust type Handle = DelayHandle; ``` -------------------------------- ### SpatialTrackBuilder::new Source: https://docs.rs/kira/latest/kira/track/struct.SpatialTrackBuilder.html Creates a new SpatialTrackBuilder with default settings. ```APIDOC ## SpatialTrackBuilder::new ### Description Creates a new `SpatialTrackBuilder` with the default settings. ### Method `new()` ### Returns `Self` (a new `SpatialTrackBuilder` instance) ``` -------------------------------- ### CompressorBuilder Implementor Source: https://docs.rs/kira/latest/kira/effect/trait.EffectBuilder.html Example of an EffectBuilder implementation for a Compressor effect. It specifies CompressorHandle as its associated Handle type. ```rust type Handle = CompressorHandle; ``` -------------------------------- ### with_settings Source: https://docs.rs/kira/latest/kira/sound/streaming/struct.StreamingSoundData.html Applies custom settings to the `StreamingSoundData`. This allows for fine-tuning of how the streaming sound behaves. ```APIDOC ## with_settings ### Description Returns the `StreamingSoundData` with the specified settings. ### Method ``` pub fn with_settings(self, settings: StreamingSoundSettings) -> Self ``` ### Parameters * `settings` - The `StreamingSoundSettings` to apply to the sound data. ``` -------------------------------- ### Get SendTrackHandle ID Source: https://docs.rs/kira/latest/kira/track/struct.SendTrackHandle.html Retrieves the unique identifier for a send track. This method is part of the SendTrackHandle implementation. ```rust pub fn id(&self) -> SendTrackId ``` -------------------------------- ### Get Listener Information Source: https://docs.rs/kira/latest/kira/info/struct.Info.html Retrieves information about the listener associated with the current spatial track, if one exists. ```rust pub fn listener_info(&self) -> Option ``` -------------------------------- ### Get Modulator Value Source: https://docs.rs/kira/latest/kira/info/struct.Info.html Retrieves the current value of a modulator by its ID. Returns None if the modulator does not exist. ```rust pub fn modulator_value(&self, id: ModulatorId) -> Option ``` -------------------------------- ### Info Methods Source: https://docs.rs/kira/latest/kira/info/struct.Info.html This section details the public methods available on the Info struct, which allow users to query specific details about audio resources. ```APIDOC ## Info Methods ### Description Provides info about resources on the audio thread. You'll only need this if you're implementing one of Kira's traits, like `Sound` or `Effect`. ### Methods #### `clock_info(&self, id: ClockId) -> Option` Gets information about the clock with the given ID if it exists, returns `None` otherwise. #### `when_to_start(&self, time: ClockTime) -> WhenToStart` Returns whether something with the given start time should start now, later, or never given the current state of the clocks. #### `modulator_value(&self, id: ModulatorId) -> Option` Gets the value of the modulator with the given ID if it exists, returns `None` otherwise. #### `listener_info(&self) -> Option` Gets information about the listener linked to the current spatial track if there is one. #### `listener_distance(&self) -> Option` If this is called from an effect on a spatial track, returns the distance of the spatial track’s listener from the spatial track. Otherwise, returns `None`. ``` -------------------------------- ### Get Clock Information Source: https://docs.rs/kira/latest/kira/info/struct.Info.html Retrieves information about a specific clock by its ID. Returns None if the clock does not exist. ```rust pub fn clock_info(&self, id: ClockId) -> Option ``` -------------------------------- ### Configure MainTrackBuilder with Multiple Effects Source: https://docs.rs/kira/latest/kira/track/struct.MainTrackBuilder.html Shows how to chain multiple effects onto a MainTrackBuilder using the `with_effect` method. This is suitable for configuring a track with several effects when you don't immediately need handles to them. ```rust use kira::{ track::MainTrackBuilder, effect::{filter::FilterBuilder, reverb::ReverbBuilder}, }; let mut builder = MainTrackBuilder::new() .with_effect(FilterBuilder::new()) .with_effect(ReverbBuilder::new()); ``` -------------------------------- ### Get Listener ID Source: https://docs.rs/kira/latest/kira/listener/struct.ListenerHandle.html Retrieves the unique identifier for a listener. This is useful for managing or referencing specific listeners. ```rust pub fn id(&self) -> ListenerId ```