/ Published in: Objective C
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
AVAudioPlayer *player = [[AVAudioPlayer alloc] initWithContentsOfURL: fileURL error: &error]; if(error){ NSLog(@"error = %@",error); NSLog(@"[error code] = %d",[error code]); return; } player.delegate = self; [player play]; } -(void) audioPlayerDidFinishPlaying: (AVAudioPlayer *)player successfully:(BOOL) flag{ [player release]; } // 呼ã²ã‚™å‡ºã— -(void) viewDidLoad{ ofType:@"aif"]; [self playSoundWithURL:fileURL]; }