1

So I want to add vibration to my iOS app.

Simple enough:

AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);

and of course:

#‎import‬ <AudioToolbox/AudioServices.h>

But there is a catch - it won't work alongside AQRecorder in the same ViewController. (AQRecorder is a helper class for recording audio files via the AudioQueue made by Apple - Version: 2.5)

In that case, when I'm using the recorder the vibration won't work.

Closest I could get to a solution was to vibrate device before initializing the recorder. After that, even when I stop the recorder and put nil wherever it makes sense, the vibration won't work.

Does anyone have some ideas what else can I try to make it work?

I'm open for hacks and/or "crazy" solutions :)

EDIT:

My real problem is that I want to record and vibrate device in the same time. AQRecorder is not necessarily the only solution (even though it's preferable since I already implemented it).

So any other potential solution is a good solution.

veich
  • 501
  • 1
  • 6
  • 15

0 Answers0