• 大小: 13KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-05
  • 语言: Java
  • 标签: android  Sound  Recorder  

资源简介

android Sound Recorder

资源截图

代码片段和文件信息

package cn.embel.sr;

import java.io.File;

import android.content.Context;
import android.media.MediaPlayer;
import android.media.MediaPlayer.OnCompletionListener;
import android.net.Uri;
import android.util.Log;

public class MusicPlayer {
private final static String TAG = “MusicPlayer“;
private static MediaPlayer mMediaPlayer;
private Context mContext;

public MusicPlayer(Context context){
mContext = context;
}

public void playMicFile(File file){
if (file!=null && file.exists()) {
Uri uri = Uri.fromFile(file);
mMediaPlayer = MediaPlayer.create(mContext uri);
mMediaPlayer.start(); 
mMediaPlayer.setOnCompletionListener(new OnCompletionListener() {

public void onCompletion(MediaPlayer mp) {
//TODO:finish 
Log.i(TAG “Finish“);
}
});
}
}

public void stopPlayer(){
if(mMediaPlayer.isPlaying()){
mMediaPlayer.stop();
mMediaPlayer.release();
}
}
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        364  2011-11-24 10:12  SoundRecorder\.classpath

     文件        849  2011-11-24 16:17  SoundRecorder\.project

     文件         88  2011-11-24 11:00  SoundRecorder\.settings\org.eclipse.core.resources.prefs

     文件        963  2011-11-24 11:50  SoundRecorder\AndroidManifest.xml

     文件       1248  2011-11-24 10:12  SoundRecorder\proguard.cfg

     文件        361  2011-11-24 10:12  SoundRecorder\project.properties

     文件       4147  2011-11-24 10:12  SoundRecorder\res\drawable-hdpi\ic_launcher.png

     文件       1723  2011-11-24 10:12  SoundRecorder\res\drawable-ldpi\ic_launcher.png

     文件       2574  2011-11-24 10:12  SoundRecorder\res\drawable-mdpi\ic_launcher.png

     文件        941  2011-11-24 11:52  SoundRecorder\res\layout\main.xml

     文件        192  2011-11-24 10:12  SoundRecorder\res\values\strings.xml

     文件        964  2011-11-24 11:36  SoundRecorder\src\cn\embel\sr\MusicPlayer.java

     文件       2041  2011-11-24 11:42  SoundRecorder\src\cn\embel\sr\SoundRecorderActivity.java

     目录          0  2011-11-24 10:52  SoundRecorder\src\cn\embel\sr

     目录          0  2011-11-24 10:52  SoundRecorder\src\cn\embel

     目录          0  2011-11-24 10:52  SoundRecorder\res\drawable-hdpi

     目录          0  2011-11-24 10:52  SoundRecorder\res\drawable-ldpi

     目录          0  2011-11-24 10:52  SoundRecorder\res\drawable-mdpi

     目录          0  2011-11-24 10:52  SoundRecorder\res\layout

     目录          0  2011-11-24 10:52  SoundRecorder\res\values

     目录          0  2011-11-24 10:52  SoundRecorder\src\cn

     目录          0  2011-11-24 16:17  SoundRecorder\.settings

     目录          0  2011-11-24 10:52  SoundRecorder\assets

     目录          0  2011-11-24 10:52  SoundRecorder\res

     目录          0  2011-11-24 10:52  SoundRecorder\src

     目录          0  2011-11-24 16:17  SoundRecorder

----------- ---------  ---------- -----  ----

                16455                    26


评论

共有 条评论