I've found lots of tutorials and posts showing how to use AudioTrack
to play wav files in AudioTrack.MODE_STREAM
and I've successfully implemented this example.
However I'm having issues with performance when playing multiple audio tracks at once and thinking that I should first create the tracks using AudioTrack.MODE_STATIC
then just call play each time.
I can't find any resources on how to implement this. How can I do this?
Thanks
The two main sticking points for me were realizing that .write() comes first and that the instantiated player must have the size of the entire clip as the buffer_size_in_bytes. Assuming you have recorded a PCM file using AudioRecord, you can play it back with STATIC_MODE like so...