Bug #671

Multiple audio streams are not played synchronously

Added by Hammel about 2 years ago. Updated about 2 years ago.

Status:ClosedStart date:31 Aug 2018
Priority:ImmediateDue date:
Assignee:Hammel% Done:

100%

Category:Speaker
Target version:Iron Man - 0.5.0
Severity:02 - High

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.

  1. Java Sounds API Programmer Guide
  2. Playing Sound in Java
  3. Sound Tutorial for Java
  4. Java Sound Demo package
  5. Play a WAV file, which may go along with the example listed in the original description above.
  6. Play a WAV file
  7. Complete program
  8. Another example

Associated revisions

Revision db6352b0
Added by Hammel about 2 years ago

RM #671: Fix audio to play synchronously when there is more than one phrase to speak. Fix up iot() handler in JarvisCmd to be a bit more generic, so it now looks for devices and monitor descriptors before trying to perform the requested action.

History

#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.

Closing issue.

Also available in: Atom PDF