Git Product home page Git Product logo

soundkit's Introduction

SoundKit

Simple pooled audio playback helper. No positional audio here or anything fancy. SoundKit will automatically pool AudioSources for you to avoid allocations at runtime. In fact, the only time it allocates anything at all (outside of Awake when it creates the pool) is when you play more than maxCapacity AudioClips simultaneously.

Directions for use:

  • stick a SoundKit script on a GameObject in your scene and configure the settings in the inspector
  • whenever you want to play a sound call SoundKit.instance.play
  • if you don't need any control over the sound or you dont need to know when it is done playing use SoundKit.instance.playOneShot

Some notes about more advanced usage:

  • SoundKit.instance.play returns an SKSound object which can be used to control the AudioSource, fade out the audio over time or set a completion handler to be notified when playback is complete
  • you can adjust volume for all the currently playing sounds via SoundKit.instance.soundEffectVolume
  • to play a background music track call SoundKit.instance.playBackgroundMusic (only one background music track can be played at a time and it is recommended to use the Stream from disc option for these)
  • you can adjust individual volume for any playing sound or background music by just accessing the SKSound.audioSource directly
  • to loop any AudioClip call the setLoop method on the SKSound class. Note that if you turn looping on you are responsible for calling stop to recycle the SKSound!

License

Attribution-NonCommercial-ShareAlike 3.0 Unported with simple explanation with the attribution clause waived. You are free to use SoundKit in any and all games that you make. You cannot sell SoundKit directly or as part of a larger game asset.

soundkit's People

Contributors

prime31 avatar xorboo avatar gregharding avatar mathieufrogames avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.