Detecting blowing on the iPhone microphone?

前端 未结 5 2092
再見小時候
再見小時候 2020-12-23 19:01

I am trying to detect when the user is blowing into the mic of an iPhone. Right now I am using the SCListener class from Stephen Celis to call

if ([[SCListen         


        
5条回答
  •  無奈伤痛
    2020-12-23 19:56

    when run on iPhone, you should add the following code after [recorder prepareToRecorder]

    [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord error:nil];
    [[AVAudioSession sharedInstance] setActive:YES error:nil];
    

提交回复
热议问题