Planning for the new Audio Graph #6670
Replies: 3 comments 1 reply
-
As someone with a moderate amount of authority here, I'm on board with this plan. It's clear, user-focused and made of useful, actionable steps. |
Beta Was this translation helpful? Give feedback.
-
Spliced in a new Milestone 3 with spatial audio, which is a popular feature which I had completely forgotten about somehow. |
Beta Was this translation helpful? Give feedback.
-
I have now a working minimal viable prototype (it plays audio at least) for this: https://github.com/harudagondi/bevy_prototype_audio_graph This is a Entity/Component centric prototype, forgoing asset handling and resource based API. The current example for the API is like this: use bevy::{
prelude::{App, Commands, Entity, Resource},
DefaultPlugins,
};
use bevy_prototype_audio_graph::{Audio, AudioPlugin, SineWave};
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugin(AudioPlugin)
.add_startup_system(play_sound)
.run()
}
#[derive(Resource)]
struct SoundEntity(Entity);
fn play_sound(mut commands: Commands) {
let entity = commands
.spawn(Audio::new(SineWave {
frequency_hz: 440.0,
phase: 0.0,
}))
.id();
commands.insert_resource(SoundEntity(entity));
} Current questions:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
With audio work gaining traction in bevy, I thought it would be appropriate to create a roadmap of sorts laying out what needs to be done, but before, a little recap of what this new audio graph is:
The Audio Graph wants to provide a unified abstraction over audio on bevy, much like
bevy_math
is a unified abstraction over CG linear algebra in bevy, orbevy_render
is a unified abstraction over 3D graphics. This is because, as the ecosystem is currently fragmented, a lot of features end up getting written multiple times over to target each backend/framework/library.Whether it's by reusing an existing a library, or building our own, the Audio Graph aims to be flexible enough to incorporate all use cases while being easy enough to work on, and efficient enough to run within the tight constraint of real-time audio processing. It's a "want all three, choose only two" kind of deal, and to help get this off the ground, I personally think we should focus on efficiency and simplicity at the detriment of flexibility. Flexibility is something that is earned through the hard work of iterating on the API surface, and so we need to bump into the limits of what we design to better understand it and evolve it.
With that in mind, I propose the following roadmap of "events", where the timeline is neither linear nor matching any kind of bevy-wide milestone (so as to not set any expectation):
Milestone 1: The Audio Graph
rodio
/oddio
/knyst
/cpal
/other) or begin our ownMilestone 2: Audio events
Milestone 3: Spatial audio
Milestone 4: Bigger files
Milestone 5: User feedback
<more ambitious?>
This is obviously not set in stone or possess any authority whatsoever, but I feel centralizing information about this is important to help get the effort started.
Happy
bleep bloopbevying!EDIT 2022/11/19: Inserted Milestone 3 for Spatial audio
EDIT 2022/11/20: Inserted Milestone 4 for file streaming
Beta Was this translation helpful? Give feedback.
All reactions