简体   繁体   中英

What does AudioServicesCreateSystemSoundID do?

What does AudioServicesCreateSystemSoundID do?

All I was able to find was this from Apple's site:

// Create a system sound object representing the sound file
    AudioServicesCreateSystemSoundID (
        soundFileURLRef,
        &soundFileObject
    );

And It isn't very helpful. I always see it created but then never used.

It's used for playing short sounds and alerts. See this Audio & Video Coding How-To for a very small snippet of sample code.

The SysSound sample project has slightly more code.

However, the best sample code for using this I've seen is in the iPhone SDK Development book , chapter 17.2. You can download the code from the book here . Look for the SystemSoundsDemo project.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM