From ab0e8e60c8fb9d9a74de384badec1c586b5ad095 Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Sat, 12 Dec 2020 08:53:20 -0600 Subject: [PATCH] Add support for changing source pitch. --- src/lib.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 9c47eee..cf0c1e3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -121,6 +121,7 @@ pub struct Sound { pub autoplay: bool, pub gain: f32, pub looping: bool, + pub pitch: f32, #[reflect(ignore)] pub source: Option, } @@ -132,6 +133,7 @@ impl Default for Sound { autoplay: false, gain: 1., looping: false, + pitch: 1., source: None, } } @@ -159,6 +161,7 @@ fn source_system( if let Some(source) = sound.source.as_mut() { source.set_gain(sound.gain).unwrap(); source.set_looping(sound.looping); + source.set_pitch(sound.pitch).unwrap(); if let Some(transform) = transform { source.set_relative(false); source