added file requirement to constructor, all references to AudioPlayer constructor had direct access to file, so this caused no other changes

This commit is contained in:
Lorin Beer 2012-06-17 22:19:33 -07:00
parent 3c9415b1c2
commit d16555ec4b

View File

@ -74,7 +74,7 @@ public class AudioPlayer implements OnCompletionListener, OnPreparedListener, On
private String tempFile = null; // Temporary recording file name
private MediaPlayer mPlayer = null; // Audio player object
private boolean prepareOnly = false;
private boolean prepareOnly = false;
/**
* Constructor.
@ -82,9 +82,10 @@ public class AudioPlayer implements OnCompletionListener, OnPreparedListener, On
* @param handler The audio handler object
* @param id The id of this audio player
*/
public AudioPlayer(AudioHandler handler, String id) {
public AudioPlayer(AudioHandler handler, String id, String src) {
this.handler = handler;
this.id = id;
this.audioFile = src;
if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
this.tempFile = Environment.getExternalStorageDirectory().getAbsolutePath() + "/tmprecording.mp3";
} else {