Latest 5.0.0
Homepage https://github.com/jessesquires/JSQSystemSoundPlayer
License MIT
Platforms ios 9.0, osx 10.10, tvos 9.0, requires ARC
Frameworks AudioToolbox

Build Status Version Status license MIT codecov Platform Carthage compatible

A fancy Obj-C wrapper for Cocoa System Sound Services, for iOS and OS X.

About

This library is a light-weight component to play sound effects in your app.
To determine your audio needs, see Best Practices for iOS Audio.

tl;dr

When your sole audio need is to play alerts and user-interface sound effects, use Core Audio’s System Sound Services.

Your sound files must be:

  • No longer than 30 seconds in duration
  • In linear PCM or IMA4 (IMA/ADPCM) format
  • Packaged in a .caf, .aif, or .wav file

If this does not fit your needs, then this library is not for you!
See AVAudioPlayer, instead.

screenshot ios     screenshot osx

Features

  • Play sound effects and alert sounds with a single line of code
  • "Play" vibration (if available on device)
  • Block-based completion handlers
  • Integration with NSUserDefaults to globally toggle sound effects in your app
  • Efficient memory management
  • Caches sounds (SystemSoundID instances) and purges on memory warning
  • Works with Swift!

Requirements

  • Xcode 9+
  • iOS 9.0+
  • tvOS 9.0+
  • macOS 10.10+

Installation

CocoaPods (recommended)

pod 'JSQSystemSoundPlayer'

Carthage

github "jessesquires/JSQSystemSoundPlayer"

Documentation

Read the docs. Generated with jazzy. Hosted by GitHub Pages.

Generate

$ ./build_docs.sh

Preview

$ open index.html -a Safari

Contribute

Please follow these sweet contribution guidelines.

Credits

Created and maintained by @jesse_squires.

License

JSQSystemSoundPlayer is released under an MIT License. See LICENSE for details.

Copyright © 2013-present Jesse Squires.

Please provide attribution, it is greatly appreciated.

Latest podspec

{
    "name": "JSQSystemSoundPlayer",
    "version": "5.0.0",
    "license": "MIT",
    "summary": "A fancy Obj-C wrapper for Cocoa System Sound Services",
    "homepage": "https://github.com/jessesquires/JSQSystemSoundPlayer",
    "documentation_url": "https://jessesquires.github.io/JSQSystemSoundPlayer/",
    "social_media_url": "https://twitter.com/jesse_squires",
    "authors": "Jesse Squires",
    "source": {
        "git": "https://github.com/jessesquires/JSQSystemSoundPlayer.git",
        "tag": "5.0.0"
    },
    "source_files": "Source/*.{h,m}",
    "platforms": {
        "ios": "9.0",
        "osx": "10.10",
        "tvos": "9.0"
    },
    "frameworks": "AudioToolbox",
    "requires_arc": true
}

Pin It on Pinterest

Share This