私はavaudioplayerでアプリを開発していますが、それは完全に機能しますが、私の問題は、iPhoneのバイブレーションモードでアプリを開く場合、avaudioplayerが秒より少し短い時間でオーディオを再生する場合、バイブレーションモードでavaudioplayerサウンドを再生したくないことです。
これが私のコードです:
- (void)viewDidLoad
{
audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL
fileURLWithPath:[[NSBundle mainBundle]
pathForResource:@"audio" ofType:@"mp3"]] error:NULL];
audioPlayer.numberOfLoops =-1;
audioPlayer.delegate = self;
audioPlayer.currentTime=0.0f;
[audioPlayer prepareToPlay];
[audioPlayer Play];
}
誰か助けてくれませんか..!
ありがとう..!