Back to project page Crescendo.
The source code is released under:
GNU General Public License
If you think the Android project Crescendo listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.crescendo.crescendo; /* www . ja va 2 s . c o m*/ import java.io.IOException; import android.media.MediaPlayer; import android.media.MediaRecorder; //Future Media Player public class songs { public void mplayer() { MediaRecorder mr= new MediaRecorder(); //mr.setOutputFile("locationhere"); mr.setAudioEncoder(MediaRecorder.AudioEncoder.AAC); mr.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); mr.setAudioSource(MediaRecorder.AudioSource.DEFAULT); mr.start(); mr.stop(); mr.reset(); mr.release(); // Records output and other such things MediaPlayer mp= new MediaPlayer(); try { // mp.setDataSource("locationhere"); mp.prepare(); mp.setOnCompletionListener(new MediaPlayer.OnCompletionListener(){ @Override public void onCompletion(MediaPlayer mp) { mp.reset(); mp.release(); } }); } catch (IllegalStateException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } catch (IOException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } mp.start(); } }