List of usage examples for android.media AudioTrack STATE_UNINITIALIZED
int STATE_UNINITIALIZED
To view the source code for android.media AudioTrack STATE_UNINITIALIZED.
Click Source Link
From source file:com.ibm.watson.developer_cloud.android.text_to_speech.v1.TTSUtility.java
/** * Stop player//from w w w. j a v a 2s. c o m */ private void stopTtsPlayer() { if (audioTrack != null && audioTrack.getState() != AudioTrack.STATE_UNINITIALIZED) { // IMPORTANT: NOT use stop() // For an immediate stop, use pause(), followed by flush() to discard audio data that hasn't been played back yet. audioTrack.pause(); audioTrack.flush(); } }