Thanks for considering supporting my work, you can do this here:
https://www.patreon.com/plemsoft
There is a few things for AppGameKit you can download if you do so. I do take suggestions from supporter for new features they like added and I also have a large list of suggestion but not any for AppGameKit, looks like mainly GGM users is supporting my work.
No guarantees, but the more that like a new feature added the higher it goes on the list, so you should only support my work if that's what you want to do.
Took a look at this here: https://developer.android.com/ndk/guides/audio/audio-latency#output-latency
So what you could try:
Loop a silence wav to avoid audio circuit warm up latency.
New devices can be slower if the sample rate do not match the Android native sample rate, use the native sample rate of the device: 44.1 kHz for older devices and 48 kHz for newer devices. This so no resample of the data is needed.
But mainly: PlaySound is set so it use signal processing that are slower, this is done to support changing Rate and Balance.
@Zaxxan this is what you could do to make playsound faster:
in: uint32_t cSoundMgr:
latformCreateInstance( cSoundMgr::cSoundFile *pSound, int iVol, int iLoop, int iPriority ):
Change:
const SLInterfaceID ids[3] = {SL_IID_ANDROIDSIMPLEBUFFERQUEUE , SL_IID_VOLUME, SL_IID_PLAYBACKRATE};
To:
const SLInterfaceID ids[2] = {SL_IID_ANDROIDSIMPLEBUFFERQUEUE , SL_IID_VOLUME};
const SLboolean req[2] = {SL_BOOLEAN_TRUE, SL_BOOLEAN_TRUE};
result = (*engineEngine)->CreateAudioPlayer(engineEngine, &(pSoundInst->bqPlayerObject), &audioSrc, &audioSnk, 2, ids, req);
Will make PlaySound faster but you will not be able to change Rate and Balance.
FYI: There is already a iPriority you could use to activate this, so you decide if you want PlaySound with Rate and Balance or the fast way iPriority=1.
agk:
laySound( uint32_t iID, int iVol, int iLoop, int iPriority )
Hope it helps. And thanks for considering supporting my work
Subscribe: https://www.youtube.com/@MakingGames
best regards Preben Eriksen,