List of usage examples for android.media AudioTrack PLAYSTATE_STOPPED
int PLAYSTATE_STOPPED
To view the source code for android.media AudioTrack PLAYSTATE_STOPPED.
Click Source Link
From source file:com.tt.engtrain.showcontent.ContentListItemActivity.java
private void playSelfRecorde(final String path) {// pcm new Thread(new Runnable() { @Override//ww w .j a v a 2 s. c o m public void run() { // TODO Auto-generated method stub if (!(audioTrack.getPlayState() == AudioTrack.PLAYSTATE_STOPPED)) { audioTrack.stop(); return; } audioTrack.play(); byte[] data = getBytes(path); audioTrack.write(data, 0, data.length); audioTrack.stop(); } }).start(); }