To Record audio to a new file on sd card I did as follows and worked for me
with emulator and mic. But don't know about buffers or sockets. And not sure
if this is a good way but anyway works.
To run emulator with sd card you do mksdcard 512M sdimg.iso then start
emulator as 'emulator.exe -sdcard sdimg.iso'
private void startRecord() {
mRecorder = new MediaRecorder();
mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
mRecorder.setOutputFormat(MediaRecorder.OutputFormat.DEFAULT);
mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.DEFAULT);
mRecorder.setOutputFile("/sdcard/test.3gpp");
mRecorder.prepare();
mRecorder.start();
}
then elsewhere mRecorder.stop();
then to play
mPlayer = MediaPlayer.create(context, Uri.parse(mFilePath));
mPlayer.start();
Also I have
<uses-permission android:name="android.permission.RECORD_AUDIO">
</uses-permission>
----- Original Message -----
From: "Tez" <[email protected]>
To: "Android Developers" <[email protected]>
Sent: Sunday, January 11, 2009 10:24 AM
Subject: [android-developers] Recording Audio
>
> Hi,
>
> I want to record audio from the emulator using the mic. Can anyone
> send me some sample code on how to do this.
> Also, I want to know whether it is possible to redirect this mic o/p
> to a memory buffer or network socket.
>
> Cheers,
> Earlence
>
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---