views:

30

answers:

2

I am modifying the AurioTouch example. I want to vibrate the phone in response to particular sound inputs. I can detect the inputs and printf them, but AudioServicesPlaySystemSound(kSystemSoundID_Vibrate) doesn't do anything while the session is kAudioSessionCategory_PlayAndRecord.

A: 

Do you need to vibrate and record at the same time?

If you don't, you can stop your audio unit when it's time to vibrate, change the audio session type to live audio, play the vibrate system sound thru audio services, then switch the session back to play and record, and restart your audio unit recording again.

hotpaw2
Thank you for this idea. It's viable, but doesn't work for my application. I am monitoring audio input and want to alert the user if I detect a particular sound. I don't want to interrupt the listening.
iter
A: 

The answer is that Apple doesn't allow this. All audio sessions that allow recording turn off vibration.

iter