[android-developers] Re: MediaRecorder - No value other than 0 returned from getMaxAmplitude
Looking at adb logcat I'm getting this error: *Record channel already open* Could this be a bug? I don't understand how it could already be open.. nothing else is recording on the device? 2009/1/31 ph...@grantmidwinter.com ph...@grantmidwinter.com I've got a media recorder, prepared and started in the following way: mRecorder = new MediaRecorder(); mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC); mRecorder.setOutputFormat (MediaRecorder.OutputFormat.THREE_GPP); mRecorder.setAudioEncoder (MediaRecorder.AudioEncoder.AMR_NB); mRecorder.setOutputFile(/sdcard/test.3gpp); mRecorder.prepare(); mRecorder.start(); I'm then using a thread to return the mRecorder.getMaxAmplitude int, but it never returns as anything but 0. I've looked all over for why this might be happening - but I'm at a complete loss now so help would really be appreciated. Thanks. -- Phill Midwinter Director Grant Midwinter Limited d: 0844 736 5234 x: 0 m: 07538 082156 e: ph...@grantmidwinter.com --~--~-~--~~~---~--~~ 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: MediaRecorder - No value other than 0 returned from getMaxAmplitude
Are you running on a G1 or on the emulator? If on the emulator, maybe audio input isn't working correctly and it's failing to open the audio input device. On Jan 31, 9:59 am, Phill Midwinter ph...@grantmidwinter.com wrote: Looking at adb logcat I'm getting this error: *Record channel already open* Could this be a bug? I don't understand how it could already be open.. nothing else is recording on the device? 2009/1/31 ph...@grantmidwinter.com ph...@grantmidwinter.com I've got a media recorder, prepared and started in the following way: mRecorder = new MediaRecorder(); mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC); mRecorder.setOutputFormat (MediaRecorder.OutputFormat.THREE_GPP); mRecorder.setAudioEncoder (MediaRecorder.AudioEncoder.AMR_NB); mRecorder.setOutputFile(/sdcard/test.3gpp); mRecorder.prepare(); mRecorder.start(); I'm then using a thread to return the mRecorder.getMaxAmplitude int, but it never returns as anything but 0. I've looked all over for why this might be happening - but I'm at a complete loss now so help would really be appreciated. Thanks. -- Phill Midwinter Director Grant Midwinter Limited d: 0844 736 5234 x: 0 m: 07538 082156 e: ph...@grantmidwinter.com --~--~-~--~~~---~--~~ 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: MediaRecorder - No value other than 0 returned from getMaxAmplitude
I was running on a G1. I've just found the problem though. On previous debug sessions - the mediarecorder hadn't been properly released. Solution was to reboot the phone, add overrides to onpause and ondestroy, making sure it's released in each case and then run again. Works like a charm! 2009/1/31 Dave Sparks davidspa...@android.com Are you running on a G1 or on the emulator? If on the emulator, maybe audio input isn't working correctly and it's failing to open the audio input device. On Jan 31, 9:59 am, Phill Midwinter ph...@grantmidwinter.com wrote: Looking at adb logcat I'm getting this error: *Record channel already open* Could this be a bug? I don't understand how it could already be open.. nothing else is recording on the device? 2009/1/31 ph...@grantmidwinter.com ph...@grantmidwinter.com I've got a media recorder, prepared and started in the following way: mRecorder = new MediaRecorder(); mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC); mRecorder.setOutputFormat (MediaRecorder.OutputFormat.THREE_GPP); mRecorder.setAudioEncoder (MediaRecorder.AudioEncoder.AMR_NB); mRecorder.setOutputFile(/sdcard/test.3gpp); mRecorder.prepare(); mRecorder.start(); I'm then using a thread to return the mRecorder.getMaxAmplitude int, but it never returns as anything but 0. I've looked all over for why this might be happening - but I'm at a complete loss now so help would really be appreciated. Thanks. -- Phill Midwinter Director Grant Midwinter Limited d: 0844 736 5234 x: 0 m: 07538 082156 e: ph...@grantmidwinter.com -- Phill Midwinter Director Grant Midwinter Limited d: 0844 736 5234 x: 0 m: 07538 082156 e: ph...@grantmidwinter.com --~--~-~--~~~---~--~~ 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: MediaRecorder - No value other than 0 returned from getMaxAmplitude
are you testing it on the emulator or on the G1 device? I'm not sure about it but I've read around some forums that you need a virtual sd card to record audio on the emulator. (with the mksdcard.exe in the tools provided with the sdk) Some other sources also say it isn't possible to record audio on the emulator yet. Check if you can read/hear what you have recorded since you are using a sdcard, maybe the sdcard is too small. Why would you use a thread to return the max amplitude? I am myself looking forward to record audio on the emulator and constantly find contradictory informations about whether it's possible or not. the manual says it's not. Any insight about that is appreciated in addition to the upper problem. thanks On 31 jan, 15:12, ph...@grantmidwinter.com ph...@grantmidwinter.com wrote: I've got a media recorder, prepared and started in the following way: mRecorder = new MediaRecorder(); mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC); mRecorder.setOutputFormat (MediaRecorder.OutputFormat.THREE_GPP); mRecorder.setAudioEncoder (MediaRecorder.AudioEncoder.AMR_NB); mRecorder.setOutputFile(/sdcard/test.3gpp); mRecorder.prepare(); mRecorder.start(); I'm then using a thread to return the mRecorder.getMaxAmplitude int, but it never returns as anything but 0. I've looked all over for why this might be happening - but I'm at a complete loss now so help would really be appreciated. Thanks. --~--~-~--~~~---~--~~ 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: MediaRecorder - No value other than 0 returned from getMaxAmplitude
You shouldn't have to reboot the device. The release() call just forces the release of the hardware resources instead of waiting for the garbage collector to come along. You should always call release() in your onPause() if you are using a singleton hardware resource like a media player, media recorder, camera, etc. On Jan 31, 11:10 am, Phill Midwinter ph...@grantmidwinter.com wrote: I was running on a G1. I've just found the problem though. On previous debug sessions - the mediarecorder hadn't been properly released. Solution was to reboot the phone, add overrides to onpause and ondestroy, making sure it's released in each case and then run again. Works like a charm! 2009/1/31 Dave Sparks davidspa...@android.com Are you running on a G1 or on the emulator? If on the emulator, maybe audio input isn't working correctly and it's failing to open the audio input device. On Jan 31, 9:59 am, Phill Midwinter ph...@grantmidwinter.com wrote: Looking at adb logcat I'm getting this error: *Record channel already open* Could this be a bug? I don't understand how it could already be open.. nothing else is recording on the device? 2009/1/31 ph...@grantmidwinter.com ph...@grantmidwinter.com I've got a media recorder, prepared and started in the following way: mRecorder = new MediaRecorder(); mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC); mRecorder.setOutputFormat (MediaRecorder.OutputFormat.THREE_GPP); mRecorder.setAudioEncoder (MediaRecorder.AudioEncoder.AMR_NB); mRecorder.setOutputFile(/sdcard/test.3gpp); mRecorder.prepare(); mRecorder.start(); I'm then using a thread to return the mRecorder.getMaxAmplitude int, but it never returns as anything but 0. I've looked all over for why this might be happening - but I'm at a complete loss now so help would really be appreciated. Thanks. -- Phill Midwinter Director Grant Midwinter Limited d: 0844 736 5234 x: 0 m: 07538 082156 e: ph...@grantmidwinter.com -- Phill Midwinter Director Grant Midwinter Limited d: 0844 736 5234 x: 0 m: 07538 082156 e: ph...@grantmidwinter.com --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---