#![allow(clippy::precedence)] use {bevy::prelude::*, bevy_fundsp::prelude::*}; fn main() { App::new() .add_plugins(DefaultPlugins) .add_plugins(DspPlugin::default()) .add_dsp_source(white_noise, SourceType::Dynamic) .add_systems(PostStartup, play_noise) .run(); } fn white_noise() -> impl AudioUnit32 { white() >> split::() * 0.2 } fn play_noise( mut commands: Commands, mut assets: ResMut>, dsp_manager: Res, ) { let source = assets.add( dsp_manager .get_graph(white_noise) .unwrap_or_else(|| panic!("DSP source not found!")), ); commands.spawn(AudioSourceBundle { source, ..default() }); }