控制内置麦克风音量在ios

问题描述:

我正在实施一个VOIP应用程序,我想在一段时间内使麦克风静音。为了您的信息,我不想停止处理传出音频。我可以如何实现这一目标?控制内置麦克风音量在ios

+2

[建于iPhone麦克风静音]的可能的复制(http://*.com/questions/6798146/mute-built-in-iphone-microphone) – brnrd

NSError *error; 
[[AVAudioSession sharedInstance] setInputGain:0.0f error:&error]; 
  • (BOOL)setInputGain:(浮点)增益 错误:(NSError * _Nullable *)outError 改变输入增益为指定的值。

https://developer.apple.com/library/ios/documentation/AVFoundation/Reference/AVAudioSession_ClassReference/#//apple_ref/occ/instm/AVAudioSession/setInputGain:error