开发者

Checking Microphone Volume in iPhone

开发者 https://www.devze.com 2023-03-04 09:25 出处:网络
How to check whether microphone is mu开发者_运维问答ted before recording audio in iPhone?Actually, you don\'t have to. You have to \"warn\" AVAudioSession that you are going to record a bit of Audio.

How to check whether microphone is mu开发者_运维问答ted before recording audio in iPhone?


Actually, you don't have to. You have to "warn" AVAudioSession that you are going to record a bit of Audio. Doing so, even if you are muted (on the IPhone, I Have not tested this with any external device) you will be able to record your audio... here is the piece of code that does that:

[[AVAudioSession sharedInstance]         
     setCategory: AVAudioSessionCategoryRecord
     error: &error];

it even records with a higher volume. Best of luck...

0

精彩评论

暂无评论...
验证码 换一张
取 消