2012-03-01 3 views
0

두 개의 AVAudioPlayer 객체를 함께 사용하고 있습니다. 중단이 발생하면 두 개체를 모두 일시 중지하고 중단이 끝나면 두 AVAudioPlayer 개체를 모두 재생하지만 이상한 것은 첫 번째 개체는 재생되지만 다른 개체는 재생되지 않습니다. 두 번째 플레이어를 먼저 재생하면 두 번째 플레이어가 재생되지만 첫 번째 플레이어는 재생되지 않습니다. 아무도 나를 도와 줄 수 있니?중단 후 두 개의 AVAudioPlayer를 다시 시작합니다.

답변

0
//This isn't a solution, but should work fine in case you need to want like this !! 

//While resuming your first AVAudioPlayer object 
NSTimer *timer=[NSTimer scheduledTimerWithTimeInterval:0.5 target:self selector:@selector(playSecondObject) userInfo:nil repeats:NO]; 

[AVAudioPlayerObject1 play] //from pause 

}

- (void) playSecondObject 
{ 
[AVAudioPlayerObject2 play]; 
//The timer will fire and call this method and can play second object, 
the time difference can be checked by you to set the exact that what you want? 
} 

//Hope this helps 
+0

을 시도했지만 작동하지 않습니다. 이상한 일은 mp3 오디오 형식을 사용하고 있으며 caf 형식을 사용하는 것이 가장 좋으며 두 가지 모두 타이머 없이도 재생됩니다. 그러나 카페는 내가 다룰 수없는 크기에 너무 많습니다. :( – necixy

관련 문제