[android-developers] Re: Android AudioRecord errors

2010-03-03 Thread Matias Alberto de la Vega
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


[android-developers] Re: Android AudioRecord errors

2010-03-03 Thread dmitriy325ci
Hmmm - I was under impression that PCM was supported.  I was looking
to use AudioRecord instead of MediaRecorder as I can then have direct
access to the buffer.

Is this not a valid example/tutorial then?

http://emeadev.blogspot.com/2009/09/raw-audio-manipulation-in-android.html

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


[android-developers] Re: Android AudioRecord errors

2010-03-03 Thread dmitriy325ci
I figured out what the problem was.  I was trying to start recording
from 2 separate threads at the same time causing a conflict.

Although I solved the issue,  I am facing very poor audio quality.  I
tried using MediaRecorder as well with the same poor quality if not
worse.  I verified mic's quality via Audacity otherwise and found no
issues.

So it seems as if emulator might be offering poor support for audio
recording.  Am I missing something?  If this is indeed the issue with
emulator, what options do we have to create/test voice recognition
applications?

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


[android-developers] Re: Android AudioRecord errors

2010-03-03 Thread Matias Alberto de la Vega
Dimitry, I've used MediaRecorder in a Nexus One and the quality is not
that great either. Maybe there's something we can do to improve
quality, but I had no time to research on that. I will let you know if
I make progress getting better audio quality. Take care

On 3 mar, 17:25, dmitriy325ci dmitriy.fro...@gmail.com wrote:
 I figured out what the problem was.  I was trying to start recording
 from 2 separate threads at the same time causing a conflict.

 Although I solved the issue,  I am facing very poor audio quality.  I
 tried using MediaRecorder as well with the same poor quality if not
 worse.  I verified mic's quality via Audacity otherwise and found no
 issues.

 So it seems as if emulator might be offering poor support for audio
 recording.  Am I missing something?  If this is indeed the issue with
 emulator, what options do we have to create/test voice recognition
 applications?

 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


[android-developers] Re: Android AudioRecord errors

2010-03-03 Thread dmitriy325ci
Wow, really?  One of the features of nexus one is voice search.  So
there is got to be a way to record audio on the device with acceptable
quality.   Unfortunately there is not much information available out
there.  So keep me posted if you make any progress.

Thanks,
Dmitriy

On Mar 3, 3:46 pm, Matias Alberto de la Vega
delavega.mat...@gmail.com wrote:
 Dimitry, I've used MediaRecorder in a Nexus One and the quality is not
 that great either. Maybe there's something we can do to improve
 quality, but I had no time to research on that. I will let you know if
 I make progress getting better audio quality. Take care

 On 3 mar, 17:25, dmitriy325ci dmitriy.fro...@gmail.com wrote:



  I figured out what the problem was.  I was trying to start recording
  from 2 separate threads at the same time causing a conflict.

  Although I solved the issue,  I am facing very poor audio quality.  I
  tried using MediaRecorder as well with the same poor quality if not
  worse.  I verified mic's quality via Audacity otherwise and found no
  issues.

  So it seems as if emulator might be offering poor support for audio
  recording.  Am I missing something?  If this is indeed the issue with
  emulator, what options do we have to create/test voice recognition
  applications?

  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


[android-developers] Re: Android AudioRecord errors

2010-03-03 Thread Matias Alberto de la Vega
Voice search is great! how Google makes the magic happen remains a
mistery to me...so far at least. Take care!

On Mar 4, 12:48 am, dmitriy325ci dmitriy.fro...@gmail.com wrote:
 Wow, really?  One of the features of nexus one is voice search.  So
 there is got to be a way to record audio on the device with acceptable
 quality.   Unfortunately there is not much information available out
 there.  So keep me posted if you make any progress.

 Thanks,
 Dmitriy

 On Mar 3, 3:46 pm, Matias Alberto de la Vega

 delavega.mat...@gmail.com wrote:
  Dimitry, I've used MediaRecorder in a Nexus One and the quality is not
  that great either. Maybe there's something we can do to improve
  quality, but I had no time to research on that. I will let you know if
  I make progress getting better audio quality. Take care

  On 3 mar, 17:25, dmitriy325ci dmitriy.fro...@gmail.com wrote:

   I figured out what the problem was.  I was trying to start recording
   from 2 separate threads at the same time causing a conflict.

   Although I solved the issue,  I am facing very poor audio quality.  I
   tried using MediaRecorder as well with the same poor quality if not
   worse.  I verified mic's quality via Audacity otherwise and found no
   issues.

   So it seems as if emulator might be offering poor support for audio
   recording.  Am I missing something?  If this is indeed the issue with
   emulator, what options do we have to create/test voice recognition
   applications?

   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