A
A
Anton Yeskin2014-02-20 13:20:33
Objective-C
Anton Yeskin, 2014-02-20 13:20:33

How to play a standard event sound in iOS?

In iOS, in the sound settings, it is possible to select sounds for various events. For example, a certain melody is assigned to the "Sound of the message".
How to play the very melody that is assigned to the "Message Sound" (or some other event, of your choice) from your iOS program on objective-c.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
IURIA, 2014-02-20
@GxocT

Corrected. The previous method did not work on iOS 7
1. Add AVFoundation.framework to your project.
2. Import the header file AVFoundation/AVFoundation.h
3. Play the required system sound: AudioServicesPlaySystemSound (1104);
And here is a list of system sounds:
iphonedevwiki.net/index.php/AudioServices

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question