Coder Social home page Coder Social logo

bevy-rrise's Introduction

bevy-rrise

Crates.io MIT/Apache 2.0 Crates.io

What is bevy-rrise?

It's a plugin for the Bevy engine that integrates the Wwise sound engine.

It relies on my Rrise crate for the Rust bindings of Wwise.

PRs welcomed!

Usage

First, take a look at the system requirements for Rrise: they are the same for bevy-rrise!

Definitely take a look at the examples for the best way to learn how this crate works.

Just add the plugin settings as resources to your Bevy app, then add the plugin itself. That's it, you can now spawn RrEmitter components, RrEmitterBundles or RrDynamicEmitterBundles!

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        // Use Rrise with default settings 
        .add_plugin(RrisePlugin)
        .add_startup_system(setup_scene)
        .add_system(update)
        .run();
}

fn setup_scene(
    mut commands: Commands,
    mut meshes: ResMut<Assets<Mesh>>,
    mut materials: ResMut<Assets<StandardMaterial>>,
) {
    // Load soundbank containing our PlayHelloWorld event structure and media
    if let Err(akr) = load_bank_by_name("TheBank.bnk") {
        panic!("Couldn't load TheBank: {}", akr);
    }

    // Setup mesh audio emitter
    commands
        .spawn_bundle(PbrBundle {
            mesh: meshes.add(Mesh::from(shape::Icosphere::default())),
            material: materials.add(Color::RED.into()),
            ..default()
        })
        .with_children(|parent| {
            // Attach dynamic emitter in the center of the parent
            parent.spawn_bundle(
                RrDynamicEmitterBundle::new(Vec3::default())
                    .with_event("PlayHelloWorld", true),
            );
        });

    // ... setup rest of scene
}

fn update(/* ... */) {
    // ... update scene
}

RrDynamicEmitterBundle (or RrEmitter components sitting on entities with a TransformBundle) will get their transform updates forwarded to Wwise automatically.

If they have a bevy:core::Name component, emitters will send their entity's name to Wwise for easy monitoring.

Don't hesitate to enable logging at the debug level for bevy-rrise to get an idea of what's happening under the hood! It can also help diagnose why your sounds might not work.

Bevy Compat Table

Bevy rrise bevy-rrise
0.7 0.2 0.1
0.8 0.2 0.2

Legal stuff

Wwise and the Wwise logo are trademarks of Audiokinetic Inc., registered in the U.S. and other countries.

This project is in no way affiliated to Audiokinetic.

You still need a licensed version of Wwise installed to compile and run this project. You need a valid Wwise license to distribute any project based on this crate.

bevy-rrise's People

Contributors

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