Multiple audio streams are not played synchronously
|Status:||Closed||Start date:||31 Aug 2018|
|Target version:||Iron Man - 0.5.0|
|Severity:||02 - High|
The problem is that the sun.audio.* library doesn't allow you to sync with the playing audio. But the Java Sound API does, as in this example.
I need to switch to the Java Sound API now because Jarvis now has a need to say multiple phrases in order.
#1 Updated by Hammel about 2 years ago
- Status changed from New to Closed
- % Done changed from 0 to 100
The Java Sound API sucks on Linux and doesn't do what you'd expect. But a workaround to get synchronously played audio clips is to get the length of the clip, using the sun.audio.* API to play it and then wait the clip length * 2 for it to complete. It's a hack but seems to work for my case at the moment.
This code is committed and pushed - and tested with "Jarvis office lights" voice command, which returns three phrases: how many matching devices found, how many are enabled and how many are disabled.