2012-12-28 60 views

回答

1

這聲音很相似:http://soundjax.com/reddo/51828%5EWHISTLE.mp3

你可以發揮它是這樣的:

NSError *error; 
NSString *path  = [NSString stringWithFormat:@"%@/%@", NSBundle.mainBundle.resourcePath, @"whistle.mp3"]; 
NSUrl *url   = [NSURL fileURLWithPath:path isDirectory:NO]; 
AVAudioPlayer *player = [[AVAudioPlayer alloc] initWithContentsOfURL:self.whistleUrl error:&error]; 

player.numberOfLoops = 0; 
player.volume  = 0.4; 

if (player == nil) { 
    NSLog(@"%@", error.description); 
    return; 
} 

[player play]; 
相關問題