Latest 1.0.1
Homepage https://github.com/mobilejazz/PlayThis
License Apache License, Version 2.0
Platforms ios 8.0, osx 10.9, requires ARC
Frameworks Foundation, AVFoundation
Authors

Version
Platform
CocoaDocs

Mobile Jazz PlayThis

PlayThis is a library to play or loop sounds.

How To Get PlayThis

The easiest way to add PlayThis to your project is using CocoaPods. Add the following line to your Podfile:

pod 'PlayThis', '~> 1.0'

Using PlayThis

Use the PTSoundManager class to manage and play sounds. First, register sounds the sounds with a unique key:

PTSoundManager *soundManager = [[PTSoundManager alloc] init];

[soundManager registerFilePath:[[NSBundle mainBundle] pathForResource:@"MySound_1" ofType:@"mp3"] forKey:@"sound.1"];
[soundManager registerFilePath:[[NSBundle mainBundle] pathForResource:@"MySound_2" ofType:@"mp3"] forKey:@"sound.2"];
[soundManager registerFilePath:[[NSBundle mainBundle] pathForResource:@"MySound_3" ofType:@"mp3"] forKey:@"sound.3"];

Optionally, load into memory the sounds in order to play them fast. All sounds can be loaded at once or just some subset of them:

// Load all sounds
[soundManager prepareAllSounds];

// Load only the given sounds
[soundManager prepareSoundsWithKeys:@[@"sound.2", @"sound.3"]];

Finally, play or loop sounds:

// Play sound 1
[soundManager playSound:@"sound.1"];

// Loop sound 2
[soundManager loopSound:@"sound.2"];

// Stop playing sound 1
[soundManager stopSound:@"sound.1"];

// Stop sound 2 loop
[soundManager stopSound:@"sound.2"];

Use the methods -isPlayingSound: or -isLoopingSound: to check the status of a sound playback.

Project Maintainer

This open source project is maintained by Joan Martin.

License

Copyright 2016 Mobile Jazz

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Latest podspec

{
    "name": "PlayThis",
    "version": "1.0.1",
    "summary": "Sound playing and management",
    "description": "PlayThis is a simple library used to play and loop sounds.",
    "homepage": "https://github.com/mobilejazz/PlayThis",
    "license": {
        "type": "Apache License, Version 2.0",
        "file": "LICENSE"
    },
    "authors": {
        "Mobile Jazz": "[email protected]"
    },
    "platforms": {
        "ios": "8.0",
        "osx": "10.9"
    },
    "social_media_url": "http://twitter.com/mobilejazzcom",
    "source": {
        "git": "https://github.com/mobilejazz/PlayThis.git",
        "tag": "1.0.1"
    },
    "source_files": [
        "Source Code/*.{h,m}"
    ],
    "frameworks": [
        "Foundation",
        "AVFoundation"
    ],
    "dependencies": {},
    "requires_arc": true
}

Pin It on Pinterest

Share This