Android sound synthesis


Staff member
I am trying to play a synthesized sound (basically 2 sine waves and some noise) using the AudioTrack class. It doesn't seem to be any different than the SourceDataLine in javax.sound.sampled, BUT the synthesis is REALLY SLOW. Even for ARM standards, it's unrealistic to think that 32768 samples (16 bit, stereo, for a total of 65536) take over 1 second to render on a Nexus 4 (measured with System.nanotime(), write to AudioTrack excluded).
The synthesis part is almost identical to this <a href="" rel="noreferrer"></a>, the only difference is that I play stereo sound (I can't reduce it to mono because it's a binaural tone).

Any ideas? what can I do?

Thanks in advance