AudioTrack: how to detect end of sound?
问题 I'm using AudioTrack to play a PCM WAV sound file on Android (see also here). Streaming mode, worker thread. I'm wondering how do I detect the end of sound so that I can release and free the AudioTrack . The write() call, it seems, is blocking - but does it block until the playback of the provided data is complete? Not so sure. Is it me, or the docs on this class are woefully inadequate? If you happen to have a link to a nice unofficial guide to AudioTrack , I'd be willing to see one. 回答1: