Open peacepro opened 6 years ago
I can't test right now (traveling). sayText
is a quite simple wrapper around ev3dev.Sound.speak()
https://github.com/OpenRoberta/robertalab-ev3dev/blob/develop/roberta/ev3.py#L367
jessie: https://github.com/ev3dev/ev3dev-lang-python/blob/ev3dev-jessie/ev3dev/core.py#L3445 stretch: https://github.com/ev3dev/ev3dev-lang-python/blob/f3fe81e8a0cd6dc60e651dd53a4c7ef16913e455/ev3dev2/sound.py#L288
I have a repro:
_brickConfiguration = {
... 'wheel-diameter': 5.6,
... 'track-width': 18.0,
... 'actors': {},
... 'sensors': {},
... }
hal = Hal(_brickConfiguration)
hal.setVolume(100)
hal.sayText("Hello"); hal.sayText("and"); hal.sayText("good evening");
aplay: main:722: audio open error: Device or resource busy
# more lowlevel, still broken
hal.sound.speak("Hello").wait(); hal.sound.speak("World").wait();
aplay: main:722: audio open error: Device or resource busy
# but this works:
hal.sayText("Hello"); hal.waitFor(200);hal.sayText("and"); hal.waitFor(200); hal.sayText("good evening");
# this is what we essentiall do from python via Popen, but in a shell it works
espeak --stdout "Hello" | aplay -q; espeak --stdout "World" | aplay -q
Somehow closing the device takes longer than the subcommand runs ??
Ahhh, https://github.com/ev3dev/ev3dev-lang-python/issues/461 - too bad that there is no new release :/
If I use more than one say block, only the first say block is working. The second block is not working.