All Projects → NiklasEi → bevy_kira_audio

NiklasEi / bevy_kira_audio

Licence: other
A Bevy plugin to use Kira for game audio

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to bevy kira audio

bevy easings
Helpers and Plugins for Bevy
Stars: ✭ 83 (-16.16%)
Mutual labels:  bevy, bevy-plugin
bevy verlet
Verlet physics plugin for bevy.
Stars: ✭ 29 (-70.71%)
Mutual labels:  bevy-plugin
UnityMidiPlayer
Midi file player for unity. Allows import of type zero and one midi files and playing them via midi outputs. Also provides code for creating procedural music using midi.
Stars: ✭ 30 (-69.7%)
Mutual labels:  game-audio
not snake game
A snake-inspired game made in Rust using the Bevy game engine.
Stars: ✭ 65 (-34.34%)
Mutual labels:  bevy
dango-tribute
👀
Stars: ✭ 20 (-79.8%)
Mutual labels:  bevy
rgis
Performant, cross-platform (web, desktop) GIS app written in Rust
Stars: ✭ 79 (-20.2%)
Mutual labels:  bevy
bevy transform gizmo
A 3d gizmo for transforming entities in Bevy.
Stars: ✭ 41 (-58.59%)
Mutual labels:  bevy
bevy lint
A Linter for bevy code
Stars: ✭ 21 (-78.79%)
Mutual labels:  bevy
bevy 4x camera
A 4X style camera for bevy.
Stars: ✭ 26 (-73.74%)
Mutual labels:  bevy
bevy prototype networking laminar
This is a prototype of a networking crate for bevy. This create provides a low-level networking plugin built on top of laminar
Stars: ✭ 30 (-69.7%)
Mutual labels:  bevy
bevy config cam
A Swiss Army knife of a camera plugin that allows for easy setup and configuration of a wide variety of types of moveable cameras and player cameras for a scene.
Stars: ✭ 155 (+56.57%)
Mutual labels:  bevy
bevy chess
Chess demo in Bevy
Stars: ✭ 59 (-40.4%)
Mutual labels:  bevy
bevy retrograde
Plugin pack for making 2D games with Bevy
Stars: ✭ 212 (+114.14%)
Mutual labels:  bevy
bevy tilemap
Tilemap with chunks for the Bevy game engine.
Stars: ✭ 169 (+70.71%)
Mutual labels:  bevy
bevy
A refreshingly simple data-driven game engine built in Rust
Stars: ✭ 15,920 (+15980.81%)
Mutual labels:  bevy
kurinji
Kurinji Input Map aims to decouple game play code from device specific input api. This is achieved by providing apis that allows you to map game actions to device input events instead of directly handling device inputs.
Stars: ✭ 47 (-52.53%)
Mutual labels:  bevy
bevy template
Compile-time optimized Bevy project template
Stars: ✭ 27 (-72.73%)
Mutual labels:  bevy
space
A SCI-FI community game server simulating space(ships). Built from the ground up to support moddable online action multiplayer and roleplay!
Stars: ✭ 25 (-74.75%)
Mutual labels:  bevy
bevy mod bounding
Unofficial plugin for generating bounding boxes in Bevy
Stars: ✭ 21 (-78.79%)
Mutual labels:  bevy
bevy-robbo
Port of mrk-its/rust-robbo to bevy
Stars: ✭ 33 (-66.67%)
Mutual labels:  bevy

Bevy Kira audio

Crates.io docs license Crates.io

This bevy plugin is intended to try integrating Kira into Bevy. The goal is to replace or update bevy_audio, if Kira turns out to be a good approach. Currently, this plugin can play ogg, mp3, flac, and wav formats and supports web builds for everything except mp3. It also supports streaming of generated audio.

You can check out the examples directory in this repository for a display of this plugin's functionality.

Usage

Note: the Bevy feature bevy_audio is enabled by default and not compatible with this plugin. Make sure to not have the bevy_audio feature enabled if you want to use bevy_kira_audio. The same goes for Bevy's vorbis feature. See Bevys' Cargo file for a list of all default features of version 0.6.0 and list them manually in your Cargo file excluding the ones you do not want.

To play audio, you usually want to load audio files as assets. This requires AssetLoaders. bevy_kira_audio comes with loaders for most common audio formats. You can enable them with the features ogg (enabled by default), mp3, wav, or flac. The following example assumes that the feature ogg is enabled.

use bevy_kira_audio::{Audio, AudioPlugin};
use bevy::prelude::*;

fn main() {
   App::new()
        .add_plugins(DefaultPlugins)
        .add_plugin(AudioPlugin)
        .add_startup_system(start_background_audio)
        .run();
}

fn start_background_audio(asset_server: Res<AssetServer>, audio: Res<Audio>) {
    audio.play_looped(asset_server.load("background_audio.ogg"));
}

Current state

  • play common audio formats
    • ogg
    • mp3
    • wav
    • flac
  • web support
    • The features ogg, flac and wav can be build for WASM and used in web builds. There are some differences between browsers:
      • Chrome requires an interaction with the website to play audio (e.g. a button click). This issue can be resolved with a script in your index.html file (usage example).
      • Firefox: The audio might sound distorted (this could be related to overall performance; see issue #9)
  • pause/resume and stop tracks
  • play a track on repeat
  • control volume
  • control playback rate
  • control pitch (no change in playback rate)
  • control panning
  • get the current status and position of a track (see the status example)
  • audio streaming

Currently, sound settings are hard to control and usually your audio files get loaded with the default. With the feature settings_loader it is possible to define an audio asset with non-default semantic duration. The semantic_duration example demonstrates loading and playing such an asset. More options will likely be supported in the future.

Compatible Bevy versions

The main branch is compatible with the latest Bevy release, while the branch bevy_main tracks the main branch of Bevy.

Compatibility of bevy_kira_audio versions:

bevy_kira_audio bevy
0.8 0.6
0.4 - 0.7 0.5
0.3 0.4
main 0.6
bevy_main main

License

Licensed under either of

at your option.

Assets in the examples might be distributed under different terms. See the readme in the examples directory.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

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].