Skip to content

Commit

Permalink
Merge pull request #33 from Wolfyxon/multi-audio
Browse files Browse the repository at this point in the history
Support for playing multiple WAV files at once
  • Loading branch information
pixix4 authored Dec 27, 2024
2 parents ed7ef80 + 304fa10 commit a2e403e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/sound.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ pub fn tone_sequence(sequence: &[(f32, i32, i32)]) -> Ev3Result<Child> {
pub fn play(wav_file: &str) -> Ev3Result<Child> {
Ok(Command::new("/usr/bin/aplay")
.arg("-q")
.arg("-Dplug:dmix")
.arg(wav_file)
.stdout(Stdio::null())
.spawn()?)
Expand All @@ -159,6 +160,7 @@ pub fn speak(text: &str) -> Ev3Result<Child> {

Ok(Command::new("/usr/bin/aplay")
.arg("-q")
.arg("-Dplug:dmix")
.stdin(espeak.stdout.ok_or(Ev3Error::InternalError {
msg: "`espeak` pipe to `aplay` could not be created!".to_owned(),
})?)
Expand Down

0 comments on commit a2e403e

Please sign in to comment.