/Parrot

Parrot is a library that augments the audio support in libGDX. 🔊🦜

Primary LanguageJavaMIT LicenseMIT

Parrot 🔊🦜

Parrot is an audio management library for libGDX that eases the process of dealing with music and sound effects in your game.

Parrot was originally made for the Grashers game and transformed into an open source project due to many developers having to implement something very similar in their own games.

Features

  • Play your audio through channels, similar to real-life sound mixers.
  • Register multiple sound variations under the same sound type (see ParrotSoundType).
  • Sound categories, so you can easily control groups of sound types.
  • Voice limitting! Control the amount of sounds that are allowed to play simultaneously, by type or category.
  • Optional Boom support for basic OpenAL effects. (Boom is only available for the lwjgl3 backend)

Example App

In case you want to run the example app to see how the library is shaping up:

  1. Clone this repository.
  2. Open terminal at the project's root folder.
  3. Run gradlew example:run (If that doesn't work, try ./gradlew instead)

Install

Step 1. Add the JitPack repository to your build file

Add it in your root build.gradle at the end of repositories:

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

Step 2. Add Parrot as a dependency to your core module:

dependencies {
    compile 'com.github.rafaskb.parrot:core:master-SNAPSHOT'
}

Note: Use master-SNAPSHOT to always fetch the most recent changes (although Jitpack has issues with Snapshots), or replace it by the release versions or commit hashes, e.g. com.github.rafaskb.parrot:core:245fdf5

Roadmap

In Progress

  • Review the entire documentation to make sure everything is as clear as possible.
  • Create a simple wiki with instructions.
  • Release v1.0.0 through Jitpack.
  • Improve error handling by throwing exceptions.

Done

  • Add priority to SoundTypes and SoundInstances.
  • Write a proper README. (Including lwjgl3 and Boom limitations.)
  • Implement pitch multipliers based on SoundCategories.
  • Create a very clean and straightforward API in the Parrot class.
  • Port Sound system.
  • Port Music system.
  • Implement Boom.
  • Most of the library uses volume, but should it use decibels everywhere instead? No, volume is easier to understand.
  • Put a flag in the settings to control whether or not the maximum volume played by the app should be 1. (True by default) Not applicable.
  • Get rid of Camera references in SoundPlayer, use raw coordinates instead.
  • Implement volume multipliers per music channel.
  • Create an example module with a fully functional implementation, which will also be used as a test application.
    • Music player with play and stop buttons, plus a label of the music track and its author.
    • Ambient music tracks (Rain, restaurant, underwater).
    • UI sounds. (non spatial).
    • Basic Boom implementation.
    • Flamethrower sound to demonstrate continuous playback mode (spatial).
    • Warning Beep sound to demonstrate eternal playback mode (non spatial).
    • Footstep sounds (spatial).
    • Allow user to change the listener's position.