Dimitry, if I'm not wrong, Android currently only supports AMR_NB for
encoding+decoding, PCM is only supported for decoding so far. And the
file encapsulating this type encoding should be 3GPP (audio/3gp is the
MIME type which you may need). You can find more information about
MediaRecorder in developer.android.com, take care!

On 2 mar, 19:39, dmitriy325ci <dmitriy.fro...@gmail.com> wrote:
> Hi Guys,
> I am a newbie to android and was trying to get a simple recording
> application up and running.  However I am facing errors and wondering
> if some of you can point me in the right direction.
>
> Stack Trace:
> 03-02 17:27:53.415: ERROR/AudioRecord(224): Could not get audio input
> for record source 1
> 03-02 17:27:53.425: ERROR/AudioRecord-JNI(224): Error creating
> AudioRecord instance: initialization check failed.
> 03-02 17:27:53.435: ERROR/AudioRecord-Java(224):
> [ android.media.AudioRecord ] Error code -20 when initializing native
> AudioRecord object.
> 03-02 17:27:53.487: ERROR/AudioRecord(224): Recording Failed
> 03-02 17:27:53.487: ERROR/AudioRecord(224):
> java.lang.IllegalStateException: startRecording() called on an
> uninitialized AudioRecord.
> 03-02 17:27:53.487: ERROR/AudioRecord(224):     at
> android.media.AudioRecord.startRecording(AudioRecord.java:495)
>
> Sample Code:
> // Create a new AudioRecord object to record the audio.
> int bufferSize =
> AudioRecord.getMinBufferSize(AUDIO_SAMPLE_FREQUENCY_8000HZ,
>                                                                     
> AudioFormat.CHANNEL_CONFIGURATION_MONO,
>                                                                     
> AudioFormat.ENCODING_PCM_16BIT);
> AudioRecord audioRecord = new
> AudioRecord(MediaRecorder.AudioSource.MIC,
>                                                                     
> AUDIO_SAMPLE_FREQUENCY_8000HZ,
>                                                                     
> AudioFormat.CHANNEL_CONFIGURATION_MONO,
>
> AudioFormat.ENCODING_PCM_16BIT,
>
> bufferSize);
> audioRecord.startRecording();
>
> AndroidManifest.xml:
> ...
> <uses-permission android:name="android.permission.RECORD_AUDIO"></uses-
> permission>
> ...
>
> System Info:
> Eclipse Galileo + SDK 2.1
> IBM T60 running Windows XP
>
> Thanks in advance,
> Dmitriy

-- 
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

Reply via email to