views:

71

answers:

1

Hello,

I'm making an iPhone game application using Core Audio, Extended Audio File Services.

It works OK, but when I first call AudioOutputUnitStart, it takes about 1-2 seconds. After the second call, no problem. For a game application, 1-2 seconds is very noticeable. (I tested this on iPhone simulator, and iPhone 3GS)

Also, if I leave the game for about 10 seconds, first call of AudioOutputUnitStart after the leave also takes time.

I'm using a 5-second AAC 160kbps file to play.

A: 

For a 5-second file, why not convert that file into a linear PCM wav or aif file? It shouldn't be that much bigger, plus you don't have to involve the AAC decoder in the process.

lucius
Thank you for your answer. Actually I have 60 15-second files, so it might become big if I use PCM files, but that should be one solution.I forgot to write here, but I found a bug in my codes. I mistakenly called AudioOutputUnitStop, and it causes startup time problem.Now I fix it, and now it takes time only once.Again thank you for your answer.
tokentoken