[android-developers] Re: Audio Recorder

2011-08-04 Thread Ab Caballero
Hi, Nico.
Thanks for the post. I did that in my checkStorage() method and it
returns the path i am using. Any other thoughts?
Andrew

On Aug 4, 2:03 am, Nico Balestra nicobales...@gmail.com wrote:
 Hi,
 you should do

 String name = Environment.getExternalStorageDirectory().getAbsolutePath() +
 /Logger;

 to get the right mount point for your sd card.

 Hope this helps.

 Nico

 2011/8/4 Ab Caballero a...@mac.com



  I'm trying to provide an audio recorder within an application for the
  user to dictate notes. I keep getting an error that there is no valid
  output file and that the external storage is not available (I know it
  is because i am using it in a separate activity). Any thoughts would
  be appreciated.

  private void recordAudio(){
                 MediaRecorder recorder = new MediaRecorder();
                 recorder.setAudioSource(MediaRecorder.AudioSource.MIC);

   recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
                 recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
                 checkStorage();
                 recorder.setOutputFile(/sdcard/Logger);
                 try {
                         recorder.prepare();
                 }
                 catch (IllegalStateException e) {
                         // TODO Auto-generated catch block
                         e.printStackTrace();
                 }
                 catch (IOException e) {
                         // TODO Auto-generated catch block
                         e.printStackTrace();
                 }
                 recorder.start();   // Recording is now started
         }

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

-- 
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: Audio Recorder

2011-08-04 Thread Mike
make sure you have the proper permissions to record_audio and
write_external_storage



On Aug 4, 11:19 am, Ab Caballero a...@mac.com wrote:
 Hi, Nico.
 Thanks for the post. I did that in my checkStorage() method and it
 returns the path i am using. Any other thoughts?
 Andrew

 On Aug 4, 2:03 am, Nico Balestra nicobales...@gmail.com wrote:







  Hi,
  you should do

  String name = Environment.getExternalStorageDirectory().getAbsolutePath() +
  /Logger;

  to get the right mount point for your sd card.

  Hope this helps.

  Nico

  2011/8/4 Ab Caballero a...@mac.com

   I'm trying to provide an audio recorder within an application for the
   user to dictate notes. I keep getting an error that there is no valid
   output file and that the external storage is not available (I know it
   is because i am using it in a separate activity). Any thoughts would
   be appreciated.

   private void recordAudio(){
                  MediaRecorder recorder = new MediaRecorder();
                  recorder.setAudioSource(MediaRecorder.AudioSource.MIC);

    recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
                  
   recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
                  checkStorage();
                  recorder.setOutputFile(/sdcard/Logger);
                  try {
                          recorder.prepare();
                  }
                  catch (IllegalStateException e) {
                          // TODO Auto-generated catch block
                          e.printStackTrace();
                  }
                  catch (IOException e) {
                          // TODO Auto-generated catch block
                          e.printStackTrace();
                  }
                  recorder.start();   // Recording is now started
          }

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

-- 
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: audio recorder

2009-06-03 Thread Hiro

I seem to be having the same issue I've been playing with
different buffer sizes, but this is where I'm at

 recorder = new AudioRecord
(MediaRecorder.AudioSource.MIC,
 AUDIO_SAMPLE_FREQ,
 
AudioFormat.CHANNEL_CONFIGURATION_MONO,
 AudioFormat.ENCODING_PCM_16BIT,
 (AUDIO_SAMPLE_FREQ));
it doesnt throw illegalargument, but recorder.getState() returns
UNINITIALIZED. If I start recording, I get the same result as you.


On May 28, 6:45 pm, intbt in...@tacberry.com 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, 20);

                                         ar_test.read(ar_buffer, 0, 15);
                                         ar_test.startRecording();

                                         toneTimer.setTimer(1);
                                         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 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: audio recorder

2009-05-29 Thread intbt

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, 10);
 (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 in...@tacberry.com 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, 20);

                                         ar_test.read(ar_buffer, 0, 15);
                                         ar_test.startRecording();

                                         toneTimer.setTimer(1);
                                         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 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: Audio recorder format

2008-10-29 Thread Guillaume Perrot

This is the audio codec for catpured sounds.
Default is the same as AMR_NB, this is the audio codec generally used
in 3gp videos.

On Oct 29, 4:47 am, april [EMAIL PROTECTED] wrote:
 So there is no body doing Audio related coding on Android?

 On Oct 28, 10:41 am, april [EMAIL PROTECTED] wrote:

  In AudioEncorder class (http://code.google.com/android/reference/
  android/media/MediaRecorder.AudioEncoder.html#DEFAULT)
  there are 2 attribute, DEFAULT and AMR_NB. What is DEFAULT? What is
  the bandwidth for DEFAULT and AMR_NB?

  Thanks!

  April
--~--~-~--~~~---~--~~
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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Audio recorder format

2008-10-28 Thread april

So there is no body doing Audio related coding on Android?

On Oct 28, 10:41 am, april [EMAIL PROTECTED] wrote:
 In AudioEncorder class (http://code.google.com/android/reference/
 android/media/MediaRecorder.AudioEncoder.html#DEFAULT)
 there are 2 attribute, DEFAULT and AMR_NB. What is DEFAULT? What is
 the bandwidth for DEFAULT and AMR_NB?

 Thanks!

 April
--~--~-~--~~~---~--~~
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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---