Thanks for all the help and useful information from everyone. I had
been ready to throw in the towel at one point.
In the end I use soundplug for the sounds generated from user actions,
button touches basically. I use the Media class for the other sounds.
It is an education game which requires the playing of foreign language
audio snippets. So I do have to use MP3 realistically, otherwise the
size of the application will balloon. But the timing of those files is
not as critical as for sound effects.
I found that while using AudioSystemServicesPlay(via SoundPlug) did
improve things greatly, I still got delays, animation jerkiness and
other nasties when there was a lot going on in the application.
Eliminating these basically meant optimizing my code in areas, caching
selectively and caching at the right time. I think the sound problems
are symptomatic of the limitations in threading support using
javascript on the iphone. Perhaps the Media class can be optimized
further, I am not sure, but I don't think that it is the real culprit.
In java you would use threads to regulate the sound/animation and
caching activities, and stop them from interfering with each other.
But in javascript I suspect it becomes a race for CPU time. Well I can
only program javascript because it looks like java. I am sure there
are experts here who can shed more light on it than me.
Dman: I have been reading up on Objective C for subsequent projects
and I looked at Cocos2d. But I also want to make android versions in
the future, so I think phonegap is the best way forward. Open to
suggestions however.