Checking Microphone Volume in iPhone
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...
精彩评论