Hi all,

I used Class MediaRecorder to play mp3 file,
the source like this:
------------------------------------------------------------------
MediaRecorder recorder = new MediaRecorder();
recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
recorder.setOutputFile(PATH_NAME);
recorder.prepare();
recorder.start();
------------------------------------------------------------------

It runs no problem.
But I want to get the stream,and write the byte array to the stream,
let mick sound the refreing voice.

by use java source I can did that.
the source like this:
------------------------------------------------------------------
SourceDataLine line = (SourceDataLine)AudioSystem.getLine(info);
SourceDataLine line = (SourceDataLine)AudioSystem.getLine(info);
// Initialize Audio
line.open(); line.start();
byte[] block = new byte[1024];
line.write(block, 0, block.length);
line.drain();
------------------------------------------------------------------

you know,Android SDK don't include the class SourceDataLine(package
javax.sound.sampled).

and who can tell me how to deal with that.
thank you!

tommy

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

Reply via email to