Module ev3dev_lang_rust::sound [−][src]
Sound-related functions. It can beep, play wav files, or convert text to speech.
Note that all methods of the meodule spawn system processes and return
std::process::Child
objects. The methods are asynchronous (they return
immediately after child process was spawned, without waiting for its
completion), but you can call wait() on the returned result.
Examples
use ev3dev_lang_rust::sound; // Play "bark.wav", return immediately: sound::play("bark.wav")?; // Introduce yourself, wait for completion: sound::speak("Hello, I am Robot")?.wait()?;
Functions
beep | Call beep command. |
beep_args | Call beep command with the provided arguments. |
get_volume | Gets the current sound volume by parsing the output of
|
get_volume_channel | Gets the current sound volume by parsing the output of
|
play | Play wav file |
set_volume | Sets the sound volume to the given percentage [0-100] by calling
|
set_volume_channel | Sets the sound volume to the given percentage [0-100] by calling
|
speak | Speak the given text aloud. |
tone | Play tone sequence. The tone_sequence parameter is a list of tuples, where each tuple contains up to three numbers. The first number is frequency in Hz, the second is duration in milliseconds, and the third is delay in milliseconds between this and the next tone in the sequence. |
tone_sequence | Play tone sequence. The tone_sequence parameter is a list of tuples, where each tuple contains up to three numbers. The first number is frequency in Hz, the second is duration in milliseconds, and the third is delay in milliseconds between this and the next tone in the sequence. |