pub struct Sound { /* private fields */ }Expand description
A shared handle to the sound system, from crate::BuildCx::sound or
crate::Ui::sound.
use ravenrs_widgets::{Silence, Sound, SoundClip};
let sound = Sound::new(Silence);
sound.play(&SoundClip::click());
sound.speak("Clique em Salvar.", "pt-BR");Implementations§
Source§impl Sound
impl Sound
Sourcepub fn new(provider: impl SoundProvider + 'static) -> Self
pub fn new(provider: impl SoundProvider + 'static) -> Self
Wraps a provider.
Sourcepub fn speak(&self, text: &str, language: &str)
pub fn speak(&self, text: &str, language: &str)
Says text with the system’s voice for language, in place of anything
still being said.
Sourcepub fn speak_clip(&self, clip: &SoundClip)
pub fn speak_clip(&self, clip: &SoundClip)
Says a recording, in place of anything still being said.
Sourcepub fn stop_speaking(&self)
pub fn stop_speaking(&self)
Stops what is being said.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Sound
impl !Send for Sound
impl !Sync for Sound
impl !UnwindSafe for Sound
impl Freeze for Sound
impl Unpin for Sound
impl UnsafeUnpin for Sound
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