0
얘들 아 어떻게 보류/전원 버튼을 누른 후에도 앱을 계속 mp3로 재생할 수 있습니까? 여기 사용자가 iPhone의 보류 버튼을 누른 후에 음악을 계속 재생하려면 어떻게해야합니까?
내가 AVAudioPlayer 준비에 사용하는 코드입니다 :- (void)PrepareAudio:(int)index
{
NSString *soundFilePath = [[NSBundle mainBundle] pathForResource:[NSString stringWithFormat:@"%@",[_Audio objectAtIndex:Game]] ofType:@"mp3"];
NSURL *newURL = [[NSURL alloc] initFileURLWithPath: soundFilePath];
MusicPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL: newURL error: nil];
[newURL release];
[MusicPlayer setVolume: 1.5];
}
을 그리고 버튼 플레이 누를 때이 코드입니다 :
- (IBAction)PushPlay: (id)sender
{
if(!MusicPlayer.playing)
[MusicPlayer play];
}
안부
을카를로스 바르가스