Skip to main content

Java Sound

1 reply [Last post]
Joined: 2007-07-20

Hi....I'm newbie in this project...i have two question....

Is possible to record a sound from the microphone and reproduce it by speakers?

Could I include in my app the "javax.sound" library or at this time is impossible?


Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2006-11-01

Hello vitty85,

If we are talking about Java ME (Micro Edition), you should use JSR-135 component for sound issues. See specification here:

Here's code example for recording:

After recording you may playback recorded sound.

Normally, you don't playback while recording, because it will definitely interfere with what you are recording on such a small device like mobile phone. But it may be also possible on some JSR-135 implementations to start playback from the stream being used for recording at the same time.

Hope this covers what you're looking for.