Skip to content

Commit a2e403e

Browse files
authored
Merge pull request #33 from Wolfyxon/multi-audio
Support for playing multiple WAV files at once
2 parents ed7ef80 + 304fa10 commit a2e403e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/sound.rs

+2
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ pub fn tone_sequence(sequence: &[(f32, i32, i32)]) -> Ev3Result<Child> {
145145
pub fn play(wav_file: &str) -> Ev3Result<Child> {
146146
Ok(Command::new("/usr/bin/aplay")
147147
.arg("-q")
148+
.arg("-Dplug:dmix")
148149
.arg(wav_file)
149150
.stdout(Stdio::null())
150151
.spawn()?)
@@ -159,6 +160,7 @@ pub fn speak(text: &str) -> Ev3Result<Child> {
159160

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

0 commit comments

Comments
 (0)