Two Laptop Bag*
The moose likes Java Micro Edition and the fly likes Audio Capture Configuration Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "Audio Capture Configuration Question" Watch "Audio Capture Configuration Question" New topic

Audio Capture Configuration Question

Jim Fox

Joined: Mar 27, 2004
Posts: 1
I am trying to sample the microphone using a recordStream. How do I control the rate, bits, unsigned, etc...

If I use:
p = Manager.createPlayer("capture://audio");
Under Ktools everything slows to a trickle and takes about 5 seconds to record 20 miiliseconds worth of data, then i get aboput 80,000 bytes of data that appears to be 16 bits
in the Manager class description
it says I can do things like:
When I do this I get:
Cannot create a DataSource for: capture://audio?bits=8
How can I control the sample rate, # of bits etc...?
Thank You
[ March 30, 2004: Message edited by: Jim Fox ]
Frank Siegmann

Joined: Aug 02, 2004
Posts: 3
What WTK do you use? I got the same problem with J2ME WTK 2.1 but with the version 2.0 it works , for example :

Player player = Manager.createPlayer("capture://audio? rate=8000&bits=8&Channels=1");

Roseanne Zhang
Ranch Hand

Joined: Nov 14, 2000
Posts: 1953
I've not used wtk2.1, but I've heard from other forums, wtk2.1 requires a seperated thread to do what you wanted to do.

Let us know if this helps.
Frank Siegmann

Joined: Aug 02, 2004
Posts: 3
My capturing routine is already running in a separate thread. Could you please explain more detailed what do you mean or give me a link where i can find more information about this problem (which forum?)

thanks in advance
Roseanne Zhang
Ranch Hand

Joined: Nov 14, 2000
Posts: 1953
Sorry! It was and in Chinese. And worse than that, the forums are closed for space problems recently.

Hopefully, they will open again soon.
wood burning stoves
subject: Audio Capture Configuration Question
Similar Threads
Is recording supported in blackberry emulator
Capture and play audio
Help Me to record voice in sony ericsson
Problem in setMediaTime
Capturing Audio and J2ME WTK 2.1