[android-developers] Re: SDK1.5 AudioRecord sample rate problem

2009-04-27 Thread niko20
Hi, The documentation for AudioRecord specifies that the constructor may fail based on what the hardware supports. The format of the data will depend on if the hardware supports it. Since the current android emulator is like a G1 type phone, and phone systems are usually 8000hz, the hardware

[android-developers] Re: SDK1.5 AudioRecord sample rate problem

2009-04-27 Thread Dave Sparks
I believe this is a known limitation of the emulator. There is a feature request to allow for more sample rates, but no one is actively working on it. The source code is available if someone wants to take it on. On Apr 25, 2:36 pm, szabolcs szabolcs.vr...@gmail.com wrote: Dave, Yoni, Thank

[android-developers] Re: SDK1.5 AudioRecord sample rate problem

2009-04-27 Thread Yoni
Since the current android emulator is like a G1 type phone, and phone systems are usually 8000hz, the hardware probably only supports that frequency. Nope. My actual G1 seems to record just fine at 11025 or 22050 hz (running The Dude's 0.8 cupcake build from xda-developers). But those sample

[android-developers] Re: SDK1.5 AudioRecord sample rate problem

2009-04-25 Thread szabolcs
Dave, Yoni, Thank you for replying. Is this on the emulator? If so, it may be a limitation of the emulator. Yes, I experienced the problem using the 1.5 prerelease SDK emulator. I dont know how the G1 would behave. Make sure you're using 16 bit samples.. I have tried pretty much ALL

[android-developers] Re: SDK1.5 AudioRecord sample rate problem

2009-04-24 Thread Steven_T
you can try this code: private static final int AUDIO_SAMPLE_FREQ = 8000; private static final int AUDIO_BUFFER_SIZE = 20; private AudioRecord recorder; try { // init recorder recorder = new AudioRecord(MediaRecorder.AudioSource.MIC,

[android-developers] Re: SDK1.5 AudioRecord sample rate problem

2009-04-24 Thread szabolcs
Steven, Thank you for your reply. I know AudioRecord works with a sample frequency of 8000Hz. In my initial post I was asking why this frequency is the ONLY frequency that works?! BTW, there is no exception thrown when the initialization of AudioRecord fails. I figured you are supposed to

[android-developers] Re: SDK1.5 AudioRecord sample rate problem

2009-04-24 Thread Dave Sparks
Is this on the emulator? If so, it may be a limitation of the emulator. On Apr 24, 3:25 am, szabolcs szabolcs.vr...@gmail.com wrote: Steven, Thank you for your reply. I know AudioRecord works with a sample frequency of 8000Hz. In my initial post I was asking why this frequency is the ONLY

[android-developers] Re: SDK1.5 AudioRecord sample rate problem

2009-04-24 Thread Yoni
Make sure you're using 16 bit samples. 8 bit samples seem to just not work. Don't use the default anythings - actually set it to MIC, PCM_16BIT, 11025, MONO. Then once that works you can try tweaking other options. Also, make sure your buffer is big enough - you can use