1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
//! Bevy integration for AudioNimbus.
//!
//! This module provides ECS-friendly wrappers around AudioNimbus types.
//!
//! Internally, it builds on top of the [`crate::wiring`] module.
//! Simulation work is pushed onto dedicated threads, while the Bevy world publishes scene,
//! listener, and source state each frame.
//!
//! The Bevy integration stops at simulation output.
//! Applying direct sound, reflections, reverb, or pathing to audio buffers is left to the
//! implementer, allowing flexibility in the choice of playback backend.
//!
//! The [`SpatialAudioPlugin`] inserts the core resources, spawns the simulation runners required
//! by the the selected configuration, and keeps them synchronized with ECS state.
//!
//! ```rust,no_run
//! use audionimbus::bevy::{Scene as AudioScene, *};
//! use bevy::prelude::*;
//!
//! fn main() {
//! App::new()
//! .add_plugins((
//! DefaultPlugins,
//! SpatialAudioPlugin::default(),
//! ))
//! .add_systems(Startup, setup)
//! .run();
//! }
//!
//! fn setup(mut commands: Commands, context: Res<Context>, simulation: Res<Simulation>) {
//! commands.spawn((
//! AudioScene::try_new(&context).unwrap(),
//! MainScene,
//! Transform::default(),
//! Visibility::default(),
//! ));
//!
//! commands.spawn((
//! Listener,
//! Source::try_new(&simulation).unwrap(),
//! Transform::default(),
//! ));
//!
//! commands.spawn((
//! Source::try_new(&simulation).unwrap(),
//! Transform::from_xyz(2.0, 0.0, 0.0),
//! ));
//! }
//! ```
//!
//! From there, read the latest outputs from resources such as [`DirectSimulation`],
//! [`ReflectionsSimulation`], [`ReflectionsReverbSimulation`], or [`PathingSimulation`] and feed
//! them into your own audio pipeline.
pub use *;