views:

171

answers:

2

I want to access the audio data that my microphone is recording with Java. How would I do that?

My goal is to save the audio data that is recorded and simultaneously play it to the user.

+1  A: 

Have a look at the Java Media Framework

The Java Media Framework API (JMF) enables audio, video and other time-based media to be added to applications and applets built on Java technology. This optional package, which can capture, playback, stream, and transcode multiple media formats, extends the Java 2 Platform, Standard Edition (J2SE) for multimedia developers by providing a powerful toolkit to develop scalable, cross-platform technology.

It should have all you need.

Paul Whelan
+3  A: 

If you don't need any of the additional functionality in JMF, I would avoid it since development has ceased (last version is from 2004), it has compatibility issues with Java 6, has a very restricted functionality in 64-bit VMs and has to installed as a separate extension library.

Audio recording, playback and a few simple media formats are supported directly by JavaSound (javax.sound), which is part of the standard Java API.

jarnbjo
+1 I'd go for javax.sound
Joset