pub struct Audio { /* private fields */ }Expand description
The audio service, from cx.audio(). Cloning it is cheap.
Implementations§
Source§impl Audio
impl Audio
Sourcepub fn default_sink(&self) -> ReadSignal<Option<Sink>>
pub fn default_sink(&self) -> ReadSignal<Option<Sink>>
The default sink. None while there is no audio server or the
server has no sink. Every caller gets the same signal.
Sourcepub fn change_volume(&self, percent: i32)
pub fn change_volume(&self, percent: i32)
Changes the default sink’s volume by percent, louder when
positive, and keeps it within 0-100%, so a step from above 100%
lands on 100%. Every channel moves by the same amount, keeping their
balance, except that one reaching 0% or 100% stops there. With no
sink or no server it does nothing.
Sourcepub fn toggle_mute(&self)
pub fn toggle_mute(&self)
Mutes the default sink, or unmutes it. With no sink or no server it does nothing.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Audio
impl !Send for Audio
impl !Sync for Audio
impl !UnwindSafe for Audio
impl Forget for Audio
impl Freeze for Audio
impl Move for Audio
impl Unpin for Audio
impl UnsafeUnpin for Audio
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more