I\'m working with Android, trying to make my AudioTrack application play a Windows .wav file (Tada.wav). Frankly, it shouldn\'t be this hard, but I\'m hearing a lot of stra
Just confirm if you have AudioTrack.MODE_STREAM
and not AudioTrack.MODE_STATIC
in the AudioTrack
constructor:
AudioTrack at = new AudioTrack(
AudioManager.STREAM_MUSIC,
sampleRate,
AudioFormat.CHANNEL_IN_STEREO,
AudioFormat.ENCODING_PCM_16BIT,
// buffer length in bytes
outputBufferSize,
AudioTrack.MODE_STREAM
);