AudioServicesPlaySystemSound(kSystemSoundID_振动)在音频录像机中不工作

AudioServicesPlaySystemSound(kSystemSoundID_振动)在音频录像机中不工作,ios,Ios,我想用AVAudioRecorder录制音频 代码如下: -(void)recordButtonTouchDown { _textLabel.backgroundColor = [UIColor clearColor]; _timer = [NSTimer scheduledTimerWithTimeInterval:0.05 target:self

我想用AVAudioRecorder录制音频

代码如下:

-(void)recordButtonTouchDown {

    _textLabel.backgroundColor = [UIColor clearColor];
    _timer = [NSTimer scheduledTimerWithTimeInterval:0.05
                                              target:self
                                            selector:@selector(setVoiceImage)
                                            userInfo:nil
                                             repeats:YES];

}

-(void)setVoiceImage {

    currentCount += 0.05f;

    if (currentCount==50) {
       AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
    }
}

AudioServicesPlaySystemSoundkSystemSoundID\u振动不工作,为什么?

以下语句中可能是浮点舍入错误,因为测试浮点数是否相等确实需要一个:

请尝试以下方法:

if (currentCount >= 50.0f) {
确认:在if语句中添加断点

if (currentCount >= 50.0f) {