Well, yes, there´s a clue. At least I´ve had the same error before and
it was this:
Everytime you get an error instantiating AudioRecord it doesn´t
release it´s resources the way it should so you won´t be able to
request it again unless you restart your phone (or close and reopen
the emulator). Also, double check to see if you have set up your
emulator right and if you have set permission for recording audio on
your manifest.xml.
I´d like to ask you one thing: have you been able to record a sound
and listen to it without problems using the emulator (older versions).
I can create an instance and indeed record but when I try to play it
the sound is completly messed up, distorted, chopped, ....

Gabriel

On 12 abr, 16:47, Olivier Guilyardi <l...@samalyse.com> wrote:
> Hi,
>
> I can successfully create an AudioRecord instance on the emulator, on Android
> 1.5, 1.6, and 2.0 with the following statement :
>
> new AudioRecord(
>     MediaRecorder.AudioSource.MIC,
>     8000,
>     AudioFormat.CHANNEL_CONFIGURATION_MONO,
>     AudioFormat.ENCODING_PCM_16BIT,
>     16384);
>
> But it fails on an emulator running Android 2.1, with the following error:
>
> ERROR/AudioRecord(299): Could not get audio input for record source 1
> ERROR/AudioRecord-JNI(299): Error creating AudioRecord instance: 
> initialization
> check failed.
> ERROR/AudioRecord-Java(299): [ android.media.AudioRecord ] Error code -20 when
> initializing native AudioRecord object.
>
> For information, AudioRecord.getMinBufferSize() returns 640 bytes.
>
> I've played with all constructor arguments, it didn't help...
>
> I'm running the SDK Tools revision 5 on Linux.
>
> Any clue?
>
> --
>   Olivier

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

To unsubscribe, reply using "remove me" as the subject.

Reply via email to