All Projects → matthewreagan → Starling

matthewreagan / Starling

Licence: other
Simple low-latency audio library for iOS + macOS

Programming Languages

swift
15916 projects
ruby
36898 projects - #4 most used programming language
objective c
16641 projects - #2 most used programming language

Projects that are alternatives of or similar to Starling

WWDC17
WWDC 2017 Scholarship Submission by Phil Zet (Philipp Zakharchenko)
Stars: ✭ 14 (-63.16%)
Mutual labels:  spritekit, avfoundation
Miles
Swift Playground that creates jazz improvisations (WWDC 2018)
Stars: ✭ 31 (-18.42%)
Mutual labels:  spritekit, avfoundation
AVPlayerItemHomeOutput
Coordinate the output of content associated with your HomeKit lightbulbs. #Ambilight
Stars: ✭ 38 (+0%)
Mutual labels:  avfoundation, avkit
VideoLab
High-performance and flexible video editing and effects framework, based on AVFoundation and Metal.
Stars: ✭ 663 (+1644.74%)
Mutual labels:  avfoundation
AUHost
Application which hosts AudioUnits v3 using AVFoundation API
Stars: ✭ 104 (+173.68%)
Mutual labels:  avfoundation
ScaryFlight
Just another yet FlappyBird-style game.
Stars: ✭ 24 (-36.84%)
Mutual labels:  spritekit
TinyRage
Flappy Bird for WatchOS 6+ written in swift 5 using spriteKit
Stars: ✭ 23 (-39.47%)
Mutual labels:  spritekit
FYCachedURLAsset
Enhanced AVURLAsset with seamless cache layer
Stars: ✭ 18 (-52.63%)
Mutual labels:  avfoundation
lazy-lambda
Lazy Lambda — a Flappy Bird clone in Haskell with SpriteKit
Stars: ✭ 72 (+89.47%)
Mutual labels:  spritekit
podcatcher
Podcast App
Stars: ✭ 21 (-44.74%)
Mutual labels:  avfoundation
RecPlayer-iOS
A simple iOS application that records audio and plays it back. (+some animations)
Stars: ✭ 21 (-44.74%)
Mutual labels:  avfoundation
VITimelineView
VITimelineView can represent any time base things. Made with fully customizable & extendable.
Stars: ✭ 51 (+34.21%)
Mutual labels:  avfoundation
ColorByNumber-iOS
Color by Number: a pixel coloring game on iOS.
Stars: ✭ 50 (+31.58%)
Mutual labels:  spritekit
spritekit-water-node
🌊 Custom SpriteKit node that allows to simulate 2D water with respect to physics. The app demonstrates Flocking behaviour using GameplayKit, key-frame animation and custom fragment shader chaining (GLSL) 🤯
Stars: ✭ 82 (+115.79%)
Mutual labels:  spritekit
chooseFigure
Simple iOS game
Stars: ✭ 39 (+2.63%)
Mutual labels:  spritekit
WaveDemo
使用AVAudioEngine录音, 并回执声波图(调参)
Stars: ✭ 31 (-18.42%)
Mutual labels:  avaudioengine
Holo
Dummy camera works on simurator without changes.
Stars: ✭ 55 (+44.74%)
Mutual labels:  avfoundation
Soundable
Soundable allows you to play sounds, single and in sequence, in a very easy way
Stars: ✭ 88 (+131.58%)
Mutual labels:  avfoundation
SKTextureGradient
A SpriteKit SKTexture Gradient
Stars: ✭ 27 (-28.95%)
Mutual labels:  spritekit
SpriteShatter
SKSpriteNode animation extension to 'shatter' a node into smaller pieces
Stars: ✭ 28 (-26.32%)
Mutual labels:  spritekit

Starling

⚠️ NOTE: This repo is no longer being actively maintained. I try to check for PRs periodically but am not always able to get to them in a timely manner. Please feel free to fork as you wish or use this code for a reference or jumping-off point in your own games / projects. Cheers

Starling is a simple audio library for iOS + macOS written in Swift. It provides low-latency sound resource playback for games, real-time media solutions, or other performance-critical applications. It is built around Apple's AVAudioEngine and simplifies the API in an effort to reduce the amount of boilerplate needed for basic audio playback.

Goal

Starling is built for simple & fast audio file playback. It is designed to be as easy to use as possible, and to provide a minimal API which abstracts the under-the-hood interaction with AVFoundation.

Background

Starling was developed while working on Tank Wars, after it became apparent that other common solutions (such as leveraging SKAction or AVAudioPlayer) would be insufficient (even when utilizing somewhat 'hacky' solutions such as pre-playing the sound at 0 volume).

Features

  • Simple & easy-to-use
  • Per-effect control over asynchronous playback / overlapping
  • Nodes are increased dynamically as needed to accommodate any number of concurrent audio effects
  • Thread safe and performant, never blocks the main thread for loading or playback

Basic Playback

  1. Add an audio file to your app (ex: myAlarmSound.wav)

  2. (Optional) Define your sounds by extending SoundIdentifier:

extension SoundIdentifier {
    static let alarm = SoundIdentifier("alarm")
}

Alternatively you can use a string for your sound names, but using static members in this fashion will allow Xcode to provide nice autocompletion within the IDE, and easier refactoring or renaming of sounds in the future.

  1. Create an instance of Starling:

let starling = Starling()

  1. During app launch or game startup, load the sound:

starling.load(resource: "myAlarmSound", type: "wav", for: .alarm)

This only needs to be done once per audio file.

  1. Play the sound!

starling.play(.alarm)

Again, note that we're using the members of the extended SoundIdentifier type. You could also call starling.play("alarm") but avoiding literal strings will make renaming your sounds much easier.

Other Playback Options

In some cases you may wish to prevent a specific sound effect from overlapping itself (playing the same sound asynchronously ontop of itself before the first play() call has finished). This can be avoided by including the allowOverlap argument.

starling.play(.alarm, allowOverlap: false)

Xcode Integration

The demo project includes 3 targets: an iOS framework, a macOS framework, and a simple Mac demo app. You can either include and link against the compiled framework in the usual manner, or you can simply include Starling.swift in your project, which works on both platforms.

More Info

Starling is a very basic API and is still a work-in-progress. Pull requests and feature requests welcome.

Author

Matt Reagan - Website: http://sound-of-silence.com/ - Twitter: @hmblebee

License

Source code and related resources are Copyright (C) Matthew Reagan 2018. The source code is released under the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].