Trouble playing sound in my game
Hi all!
I'm a new iPhone developer and I'm developing my first game (hope it can be seen soon at AppStore ^_^). The game is nearly completed (it's a simple game) and I'm starting working (or trying to) with sounds.
I've searched the net and I've found a class named SoundEffect (used in the Metronome or BubbleLevel applications) and I'm trying to use this class. The game compiles with no problem and it seem that the sound must be played, but I can't hear nothing. I have this code in my EAGLView.m class:
NSBundle *mainBundle = [NSBundle mainBundle];
SoundEffect *soundEffect = [[SoundEffect alloc] initWithContentsOfFile:[mainBundle pathForResource:@"Ambient Noise Effect 03" ofType:@"caf"]];
[soundEffect play];
I've tried with this file, wich is 1 minute long, and with another one wich is 1 second long, but nothing's played... Any idea what can be happening? No errors so no matter on where can I start digging...
Thanks in advance!
|