I think I found my problem.
First - the AudioRecord only seems to work for this combination of
parameters:
ar_test = new AudioRecord(MediaRecorder.AudioSource.MIC, 8000,
AudioFormat.CHANNEL_CONFIGURATION_MONO,
AudioFormat.ENCODING_PCM_16BIT, 100000);
(buffer size must be > 4096 apparently)
and Second - you must have permission for RECORD_AUDIO set in
manifest
Onward and upward...
On May 28, 6:45 pm, intbt <[email protected]> wrote:
> With version 1.5, I keep getting this error
>
> 05-29 01:36:39.440: ERROR/AudioRecord-JNI(1280): Error creating
> AudioRecord instance: initialization check failed.
>
> 05-29 01:36:39.450: ERROR/AudioRecord-Java(1280):
> [ android.media.AudioRecord ] Error code -20 when initializing native
> AudioRecord object.
>
> and then:
>
> 05-29 01:36:39.630: ERROR/AndroidRuntime(1280):
> java.lang.IllegalStateException: startRecording() called on an
> uninitialized AudioRecord.
>
> My code:
>
> ar_test = new
> AudioRecord(MediaRecorder.AudioSource.MIC,
> 11025, AudioFormat.CHANNEL_CONFIGURATION_MONO,
> AudioFormat.ENCODING_PCM_8BIT, 200000);
>
> ar_test.read(ar_buffer, 0, 150000);
> ar_test.startRecording();
>
> toneTimer.setTimer(10000);
> toneTimer.countdownTimer();
>
> ar_test.stop();
>
> Can some one explain what I am missing?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---