use std::f32; use bevy::prelude::*; use bevy_synthizer::*; #[derive(Component, Deref, DerefMut)] struct RotationTimer(Timer); impl Default for RotationTimer { fn default() -> Self { Self(Timer::from_seconds(30., TimerMode::Repeating)) } } fn setup(mut commands: Commands, context: Res) { commands.spawn((Transform::default(), Listener, RotationTimer::default())); let generator: syz::Generator = syz::FastSineBankGenerator::new_sine(&context, 440.) .expect("Failed to create generator") .into(); commands.spawn(( Transform::from_translation(Vec3::new(10., 0., 0.)), Source::default(), Sound { audio: generator.into(), looping: true, ..default() }, )); } fn rotate_listener(time: Res