import android.media.AudioManager;
import android.media.MediaPlayer;
import java.io.IOException;
public class MediaManager {
public static MediaPlayer mMediaPlayer;
private static boolean isPause;
public static void playSound(String filePath, MediaPlayer.OnCompletionListener onCompletionListener) {
if (mMediaPlayer==null){
mMediaPlayer=new MediaPlayer();
}else{
mMediaPlayer.reset();
}
try {
mMediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
mMediaPlayer.setOnCompletionListener(onCompletionListener);
mMediaPlayer.setDataSource(filePath);
mMediaPlayer.prepare();
mMediaPlayer.start();
} catch (IOException e) {
e.printStackTrace();
} catch (IllegalArgumen
import android.media.MediaPlayer;
import java.io.IOException;
public class MediaManager {
public static MediaPlayer mMediaPlayer;
private static boolean isPause;
public static void playSound(String filePath, MediaPlayer.OnCompletionListener onCompletionListener) {
if (mMediaPlayer==null){
mMediaPlayer=new MediaPlayer();
}else{
mMediaPlayer.reset();
}
try {
mMediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
mMediaPlayer.setOnCompletionListener(onCompletionListener);
mMediaPlayer.setDataSource(filePath);
mMediaPlayer.prepare();
mMediaPlayer.start();
} catch (IOException e) {
e.printStackTrace();
} catch (IllegalArgumen