Thanks for the reply, the problem is sorted.
repzak :
Hello,
Why don't you just use the playback in AUDIO_CIRCULAR_MODE, and then fill up the buffer before play?
Kasper
This is what I tried first, as in your wav/mp3 demos, it works, but the transient spikes are too noticeable for a musical instrument application that way.
My audio samples sound immediately I touch the screen, there is no wav parseing to slow the process down, and so the spikes are obvious. As a side note I have to say I am really impressed with the low latency time the system has compared to trying the same thing on a very high spec pc...
As far as I can tell the problem lay in the low level functioning of Audio_Play() and Audio_Playback_stop(). I believe these functions (especially stop) power down the codec and this generates an audio spike. I was filling the buffer before playing but due to my short samples (1 sec at most) I would notice the transients and it was unuseable.
Since the application is audio specific, I don't need the codec to shut down until I exit the program, and so by only calling AUDIO_Play() in the Application_init function, and Audio_Playback_Stop() at the end of the program, I can purely manipulate the buffers, opening and closing files and emptying/filling the buffer as nesessary without incurring shutdown or restart of the codec. The sound is vastly improved, and in my application this was of paramount importance.
Thanks for the suggestion and your work on the wav and mp3 demos, they helped enormously
James