Skip to content

ByteSlinger/PlaySounds

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

PlaySounds

iOS Utility app to play system sounds by SystemSoundID

iOS Systems Sounds

This is a demo app in Swift 4 (iOS 10.3) to play individual iOS system sounds by SystemSoundID.

I know, it is REALLY simple. I wanted to use the existing "keypress" sound (1130) for button taps and didn't know what the correct SystemSoundID was for it. So I wrote this trivial app to be able to spin through SystemSoundID's between 1000 and 4096 (lots of gaps that don't play anything), and play them one at a time until I found the one I wanted.

NOTE: this app WILL NOT WORK in the iOS simulator. You must run it on an iOS device (iPhone, iPad, iPod Touch).

This is a utility app for developers really. Not for the general public (...though it is useful to play and hear all the different sounds on your iPhone or iPad)

How It Works

It's this simple:

import AVFoundation

let TAP_SOUND_ID: SystemSoundID = 1130  // tock
    
func playTapSound() {
  AudioServicesPlaySystemSoundWithCompletion(TAP_SOUND_ID, nil);
}

List of System Sound IDs

The only list I've been able to find is here:

I found that that list is incomplete, probably because it was written in 2013, but it does have most of them.

Screenshot

On the app, I added a couple of convenience buttons (in Red) with SystemSoundIDs that I randomly selected. When pressed, they automatically set the TextEdit and Stepper UI items to the SystemSoundID that I use for each one.

Kudos

This repo and app evolved from these fine Repos:

About

iOS Utility app to play system sounds by SystemSoundID

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages