AVAudioPlayer, No hay sonido
He importado la caja de herramientas de audio y la fusión a mi clase y he agregado los marcos a mi proyecto y estoy usando este código para reproducir un sonido:
- (void)playSound:(NSString *)name withExtension:(NSString *)extension
{
NSURL* soundUrl = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:name ofType:extension]];
AVAudioPlayer *audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:soundUrl error:nil];
audioPlayer.delegate = self;
audioPlayer.volume = 1.0;
[audioPlayer play];
}
Lo llamo así:
[self playSound:@"wrong" withExtension:@"wav"];
Sonido cero. Cualquier ayuda es muy apreciada, gracias.