2 Attachment(s)
Beta 16: Problems with sound playback
I have had consistent problems with sound playback using the iPhone runtime. With every sound I have tried in all of wav, mp3 and ogg, I experience lag when the sound first plays. Wavs have the largest frame drop. I have also tried different bitrates and sample rates with no difference.
I have attached a simple application which plays a sound when you click a button. You can also see that the frame rate drops whenever this button clicks.
The sound is a 16-bit Mono 128kbps mp3 at 44100hz
Every time I click the button I get 39-42 FPS.
Re: Beta 16: Problems with sound playback
Didn't test your app, but what I do in those cases is first fire the sound, mark somewhere (with a flag) "Sound fired" and then sync the video in the next loop.
The way to do the latter is to place all actions that should happen when the sound is played, before the condition that triggers the sound. And to be sure that those actions happen when the sound has been fired I add a "Is Flag X on?".
Hope this helsp in your case.
Re: Beta 16: Problems with sound playback
Netninja, Yves explained that the OGG is not supported, and I'm using MP3 for the soundtrack and. wav files for the rest, I've also noticed that sometimes a sound associated with a touch of an object does not sound the first and second if so, the bug is random, I think our friends should review very well Clickteam this section, it is crucial.
I guess you are doing.
Re: Beta 16: Problems with sound playback
Yes, this is a problem I have noticed too. I guess that the sound engine of iOS needs some initialisation before working.
I suggest that you play a dummy sound in the title page of your game, like that the delay will not be noticed.
Re: Beta 16: Problems with sound playback
Thanks Francois and this time and we are still beta, so we have time, I think it's better IOS Exporter debug as possible before launching applications to the App Store, at least not that they are made with MMF.
I feel that we are already light years from Gamesalad and I think that Clickteam have a great product under his arm.
Re: Beta 16: Problems with sound playback
Thanks for the feedback guys, but I don't think anyone really noticed the severity of this problem.
Whenever I play a sound effect, my game lags. This isn't the first time I play the sound... this is every time a sound is played. A dummy sound won't help in this situation.
So if you had a game where you wanted to play a sound every time your ship shot a bullet, then it wouldn't be playable. The frame rate drop is very noticeable and I don't think I'm doing anything wrong with my sounds - check the example - the sound is a very simple one.
I don't see how I can release a game where it has such a major performance issue.
Re: Beta 16: Problems with sound playback
As I said. I used to have that problem and fix it with the workaround I posted earlier :) And beleive me when I say that my ship shoots lots of bullets.
Re: Beta 16: Problems with sound playback
If i remember correctly mp3 uses a separate engine than wav files, they are better suited for music and not sound effects.
Use a dummy blank wav to get things started, then the wav lag stops.
Re: Beta 16: Problems with sound playback
The lag in the gampe depends on the sound, its frequency, it length. We have not yet been able to pinpoint which frequency or sound, but safe to say that sounds with lower frequencies will play faster.
To play sounds, I am using the method recommended by Apple. I have two solutions to prepare the sound player for playing a sound, either do it before the sound is played, or after, when the sound has just stopped. I could do the latter, but there will be lags in the game when the sound stop, which would be the same after all.
Re: Beta 16: Problems with sound playback
Francois - so is there a specific sound format that plays better than others? Could you provide some guidelines as to what frequency we should sample the sound at, and other settings? I have not been able to produce a sound that doesn't lag, but perhaps I am using the wrong settings. In my example my sounds are extremely short already.