I work under windows vista.
I have been searching for some time and I can't find a detailled tutorial on how to easily record and then read audio on the emulator under eclipse.
I have yet found these steps:
- You have to install a virtual sd card with mksdcard.exe 1024M sdcard.img
-then run the emulator : emulator.exe -sdcard sdcard.img //where sdimg.iso it is the path to the sdcard
-then run adb.exe : adb push hello.png sdcard/hello.png //just to check if the sdcard is correctly connected
-then you should put :
Using xml Syntax Highlighting
- <uses-permission android:name="android.permission.RECORD_AUDIO"></uses-permission>
Parsed in 0.000 seconds, using GeSHi 1.0.8.4
-then there is some code to implement which should look like :
Using java Syntax Highlighting
- private void startRecord() {
- recorder = new MediaRecorder();
- recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
- /*ok so I say audio source is the microphone, is it windows/linux's microphone, or the emulator's? */
- recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
- //also available in MPEG_4 I believe
- recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
- recorder.setOutputFile("/sdcard/test.3gpp");
- //I never saw that file appear anywhere on the sdcard
- recorder.prepare();
- recorder.start();
- }
Parsed in 0.032 seconds, using GeSHi 1.0.8.4
-then you should stop with :
Using java Syntax Highlighting
- recorder.stop(); // at some point click on stop record button
Parsed in 0.029 seconds, using GeSHi 1.0.8.4
-then you should play it. :
Using java Syntax Highlighting
- mMediaPlayer = MediaPlayer.create(this, R.raw.test_cbr);
- mMediaPlayer.start(); // triggered when you click on play
Parsed in 0.033 seconds, using GeSHi 1.0.8.4
I have also heard about : http://code.google.com/intl/fr/android/ ... tml#sdcard in this page of the manual (~1/4 of the total scroll), there are some informations about "Emulator Startup Options", one of them is about Media -audio <backend>.
I couldn't find much about that backend thing, google didn't said much about it. I still don't know if it's important to the audio recording process.
EDIT : under windows the <backend> is winaudio. (found using emulator -help-audio-in)
But it doesn't work with audio-out and audio-in at the same time for me.
emulator: warning: opening audio output failed
audio-out works alone
I tested it with the sample provided with the sdk when reading ressources. It doesn't when trying to read the sdcard."
However, the adb logcat says this repetitivly when I click on record with audio-in:
D/AudioHardware< 25>: AudioStreamInGeneric::read<0x40308160, 320> from fd 7
The fact is all these steps are pretty blurry to me, and I believe I am not the only android newbie trying to record some sound
Anyone knows where we can find a complete tutorial "for dummies" teaching this feature?
Did I make a mistake somewhere?
Any clean and simple source available somewhere?
Any help is of course greatly appreciated
Thanks.


