Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
dtaralla committed Apr 26, 2022
0 parents commit 8a70339
Show file tree
Hide file tree
Showing 40 changed files with 15,985 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.idea/
target/
Cargo.lock
examples/WwiseProject/.cache/
examples/WwiseProject/*.prof
examples/WwiseProject/*.validationcache
examples/WwiseProject/*.wsettings
examples/WwiseProject/*.log
examples/WwiseProject/GeneratedSoundBanks/
assets/soundbanks/
!assets/soundbanks/.keep
*.akd
*.cache
53 changes: 53 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
[package]
name = "bevy-rrise"
version = "0.1.0"
edition = "2021"
authors = ["David Taralla <[email protected]> & Contributors to the Rrise project"]
description = "A Wwise Bevy integration"
repository = "https://github.com/dtaralla/bevy-rrise"
readme = "README.md"
keywords = ["library", "sound", "3D", "wwise"]
categories = ["multimedia", "game-development"]
license-file = "LICENSE"
exclude = [
"/examples/WwiseProject/Originals",
]

[dependencies]
crossbeam-channel = "0.5"

[dependencies.rrise]
version = "0.2"

[dependencies.tracing]
version = "0.1"
features = ["attributes"]

[dependencies.bevy_easings]
version = "0.7"
optional = true

[target.'cfg(windows)'.dependencies]
raw-window-handle = "0.4"

[dependencies.bevy]
version = "0.7"
default-features = false

[target.'cfg(windows)'.dev-dependencies.bevy]
version = "0.7"
default-features = false
features = ["bevy_winit", "bevy_gltf"]

[target.'cfg(target_os = "linux")'.dev-dependencies.bevy]
version = "0.7"
default-features = false
features = ["x11"]

[[example]]
name = "music_visualizer"
required-features = ["bevy/render", "rrise/AkParametricEQFX"]

[[example]]
name = "doppler_drone"
required-features = ["bevy/render", "bevy_easings", "rrise/AkParametricEQFX"]
8 changes: 8 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Rrise is dual-licensed under either

* MIT License (docs/LICENSE-MIT or http://opensource.org/licenses/MIT)
* Apache License, Version 2.0 (docs/LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)

at your option.

Wwise and the Wwise logo are trademarks of Audiokinetic Inc., registered in the U.S. and other countries.
89 changes: 89 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# bevy-rrise

[![Crates.io](https://img.shields.io/crates/v/bevy-rrise.svg)](https://crates.io/crates/bevy-rrise)
[![MIT/Apache 2.0](https://img.shields.io/badge/license-MIT%2FApache-blue.svg)](./LICENSE)
[![Crates.io](https://img.shields.io/crates/d/bevy-rrise.svg)](https://crates.io/crates/bevy-rrise)

## What is bevy-rrise?
It's a plugin for the [Bevy](https://bevyengine.org/) engine that integrates the
[Wwise](https://www.audiokinetic.com/en/products/wwise) sound engine.

It relies on my [Rrise](https://github.com/dtaralla/rrise) crate for the Rust bindings of Wwise.

**PRs welcomed!**

## Usage
**First, take a look at the system requirements for [Rrise](https://github.com/dtaralla/rrise)**: they are the same
for bevy-rrise!

Definitely take a look at the [examples](/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, `RrEmitterBundle`s or `RrDynamicEmitterBundle`s!

```rust
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugin(EasingsPlugin)
// 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 |

### 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.
Binary file added assets/fonts/FiraMono-Medium.ttf
Binary file not shown.
Empty file added assets/soundbanks/.keep
Empty file.
Loading

0 comments on commit 8a70339

Please sign in to comment.