Skip to content

Commit

Permalink
fix: correct example velocity and doppler factor
Browse files Browse the repository at this point in the history
  • Loading branch information
mbillingr committed Jul 20, 2018
1 parent 50d9255 commit 8457a2f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,8 @@ let scene = AmbisonicBuilder::default().build();
let source = rodio::source::SineWave::new(440);
let mut sound = scene.play(source);

// exaggerate doppler effect
sound.set_doppler_factor(10.0);

// move sound from right to left
sound.set_velocity([-1.0, 0.0, 0.0]);
sound.set_velocity([-10.0, 0.0, 0.0]);
for i in 0..1000 {
sound.set_position([50.0 - i as f32 / 10.0, 1.0, 0.0]);
sleep(Duration::from_millis(10));
Expand Down
10 changes: 2 additions & 8 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,8 @@
//! let source = rodio::source::SineWave::new(440);
//! let mut sound = scene.play(source);
//!
//! // exaggerate doppler effect
//! sound.set_doppler_factor(10.0);
//!
//! // move sound from right to left
//! sound.set_velocity([-1.0, 0.0, 0.0]);
//! sound.set_velocity([-10.0, 0.0, 0.0]);
//! for i in 0..1000 {
//! sound.set_position([50.0 - i as f32 / 10.0, 1.0, 0.0]);
//! sleep(Duration::from_millis(10));
Expand Down Expand Up @@ -168,11 +165,8 @@ mod tests {
let source = rodio::source::SineWave::new(440);
let mut sound = scene.play(source);

// exaggerate doppler effect
sound.set_doppler_factor(10.0);

// move sound from right to left
sound.set_velocity([-1.0, 0.0, 0.0]);
sound.set_velocity([-10.0, 0.0, 0.0]);
for i in 0..1000 {
sound.set_position([50.0 - i as f32 / 10.0, 1.0, 0.0]);
sleep(Duration::from_millis(10));
Expand Down

0 comments on commit 8457a2f

Please sign in to comment.