Bug #671
closedMultiple audio streams are not played synchronously
100%
Description
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.
- Java Sounds API Programmer Guide
- Playing Sound in Java
- Sound Tutorial for Java
- Java Sound Demo package
- Play a WAV file, which may go along with the example listed in the original description above.
- Play a WAV file
- Complete program
- Another example
Updated by Hammel about 6 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.
Closing issue.