How to restart an audio clip?
Hi there!
I've almost done everything with my game audio, just getting last details on... When the user touches the screen a sound is played. It's a small one-second-length .caf and it works well, but if the user touches the screen before the sound has ended it isn't played, and I don't know how to fix it...
When the screen is touched the method simply calls:
...
[soHit play];
...
And I've tried the following to force playing the sound even if it isn't done:
...
if([soHit isPlaying])
[soHit pause];
soHit.currentTime = 0.0;
}
[soHit play];
...
I've thought this will force audioclip to move to the begining without stopping it (I can't afford loading it again because my app slows down) but when it's done the sound isn't played anymore... Anyone knows how why this happens? Or how can I get my effect done?
Thank you! ^_^
-PD: And, of course, if the sound can be played more than one time at once this should be fine!
-PD2: Sorry for my english, I know it isn't as good as I wish!
|