Objective c iPhone播放声音和振动问题

Objective c iPhone播放声音和振动问题,objective-c,iphone,Objective C,Iphone,以下是我播放声音的代码: NSString *filePath = [[NSBundle mainBundle] pathForResource:@"Feel" ofType:@"mp3"]; NSURL *fileURL = [[NSURL alloc] initFileURLWithPath:filePath]; AVAudioPlayer *_audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:fileURL error:n

以下是我播放声音的代码:

NSString *filePath = [[NSBundle mainBundle] pathForResource:@"Feel" ofType:@"mp3"];
NSURL *fileURL = [[NSURL alloc] initFileURLWithPath:filePath];
AVAudioPlayer *_audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:fileURL error:nil];
[_audioPlayer prepareToPlay];
_audioPlayer.numberOfLoops = -1;
[fileURL release];
_audioPlayer.currentTime = 0;
[_audioPlayer play];
我的问题是如何在播放此声音时振动?

有关振动,请阅读“”文档,特别是AudioServicesPlaySystemSound()方法,使用常量kSystemSoundID\u振动


不要忘记将您的项目链接到AudioToolbox框架。

这只会震动2-3秒。有没有办法玩continuos?也许我应该注册一个回调并再次调用该函数?小心点。连续振动是拒收的潜在原因。你认为在声音播放时没有办法振动吗?