plist
打开了音频后台模式。当我关闭此选项时,不会出现红条。我知道这是在打开音频后台模式时提醒用户。AudioSessionSetActive(false)
停止运行相机但没有用,此动作看起来无法立即停止音频样本,因此红色条显示为随机。我的代码如下:
- (void)stopRunning{
if (self.audioDeviceInput) {
[self.captureSession removeInput:self.audioDeviceInput];
}
if (self.videoDeviceInput) {
[self.captureSession removeInput:self.videoDeviceInput];
}
if (self.captureAudioDataOutput) {
[self.captureSession removeOutput:self.captureAudioDataOutput];
}
if (self.captureVideoDataOutput) {
[self.captureSession removeOutput:self.captureVideoDataOutput];
}
for (AVCaptureOutput *output1 in self.captureSession.outputs) {
[self.captureSession removeOutput:output1];
}
self.videoDeviceInput = nil;
self.captureAudioDataOutput = nil;
self.audioConnection = nil;
self.captureVideoDataOutput = nil;
self.stillImageOutput = nil;
self.videoConnection = nil;
self.captureSession = nil;
self.sessionInited = NO;
}
在我看来,当B控制器解散时,我会停止音频输入,但为什么红条仍然会随机出现?
你能告诉我当我解雇B控制器时我该怎么做才能永远不会出现红条?