Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Synch 2 similar audio input (one by file and one by microphone)

i have 2 audio input of a concert. The first is a wav file and the second is taken by microphone in real time. I need play the first file in synch with the microphone input.

What library can i use?

Is there any tutorial, guide or example for do this?

thanks

like image 982
Luca Romagnoli Avatar asked May 23 '11 09:05

Luca Romagnoli


1 Answers

Take a look here

This is entire sound api documentation

http://download.oracle.com/javase/1.5.0/docs/guide/sound/programmer_guide/

Also

  • Chapter 4: Synchronizing Playback on Multiple Lines
  • Chapter 6: Processing Audio with Controls

BUT

here is what i found in jsresource faq

How can I synchronize two or more playback lines ?

The synchronization functions in Mixer are not implemented. Nevertheless, playback typically stays in sync

How can I synchronize playback (SourceDataLines) with recording (TargetDataLines)?

As with multiple playback lines from the same Mixer object, playback and recording lines from the same Mixer object stay in sync once they are started. In practice, this means that you can achieve synchronization this easy way only by using the "Direct Audio Device" mixers. Since the "Java Sound Audio Engine" only provides playback lines, but no recording lines, playback/recording sync is not as easy with the "Java Sound Audio Engine".

If playback and recording lines originate from different Mixer objects, you need to synchronize the soundcards that are represented by the Mixer objects. So the situation is similar to external synchronization.

AND

The main problem is buffering and processing mic audio hits and timing realtime , a practical way is using external clock

And here is a bunch of java sound resources , i think u should look at monitoring sound section in api documentation and try to trigger timedelay based on hits and monitor outputs , it's little complicated i also interested in this question i will try to find out if i did i will let u know

Take a look at this links and it's going to be easy as i found and read description of this processing libraries

  • http://sonia.pitaru.com/

  • http://visualap.java.net/

  • http://www.softsynth.com/jsyn/ Check this out

  • http://jmetude.dihardja.de/

  • http://www.tree-axis.com/Ess/

  • http://www.abstract-codex.net/tactu5/index.html

  • http://code.google.com/p/echonestp5/

like image 78
Synxmax Avatar answered Oct 15 '22 08:10

Synxmax