SystemSounds

MIT License Stargazers Forks Issues

Platforms Swift 5

Sponsors

Table of Contents

Summary

This is a Swift/SwiftUI example showing the use of iOS/iPadOS system sounds.

Project Documentation

Blog post for this example

Blog post

Usage

Read the blog post. Or just read the code.

e.g. playing a system sound.

import AVFoundation
...
var soundID: SystemSoundID = .zero
let osstatus = AudioServicesCreateSystemSoundID(url as CFURL, &soundID)
if osstatus != noErr {
    print("could not get system sound at url: \(url.absoluteString)")
    print("osstatus: \(osstatus)")
    return
}
AudioServicesPlaySystemSound(soundID)

Issues

If you find one, please add it to Issues

Buy my kitty Giacomo some cat food

Paypal

Giacomo Kitty

Licensing

MIT License article on Wikipedia

Please read the LICENSE for details.

Credits

Gene De Lisa’s development blog

Gene De Lisa’s music blog

Twitter @GeneDeLisaDev

LinkedIn

Stackoverflow