iosobjective-cavfoundationavcapturemoviefileoutput

Play the same sound when start/stop recording video with AVCaptureMovieFileOutput that is heard in device's camera app?


I am creating a camera app that uses AVFoundation.

When I take a picture with my AVCaptureStillImageOutput object, it makes the same "shutter" noise that the default camera makes without me needing to tell the AVCaptureStillImageOutput to do so, which is great.

What I am wondering is if it is possible to get AVCaptureMovieFileOutput make the same "ding" noise that is heard when the user starts/stops recording video through the camera app?

If not, I guess I will need to have my own noise in the app's bundle and play it when the user starts/stops recording...

Thanks in advance!


Solution

  • Yes, you can:

    AudioServicesPlaySystemSound(1117); // Video start sound
    
    AudioServicesPlaySystemSound(1118); // Video stop sound
    

    A full list of available system sound codes is here: http://iphonedevwiki.net/index.php/AudioServices