Project

General

Profile

Actions

Bug #671

closed

Multiple audio streams are not played synchronously

Added by Hammel over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Immediate
Assignee:
Category:
Speaker
Target version:
Start date:
31 Aug 2018
Due date:
% Done:

100%

Estimated time:
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
Actions #1

Updated by Hammel over 3 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.

Actions

Also available in: Atom PDF