From 49b0e692992fddd2fd6f4bbc9a168fd9e27eab3e Mon Sep 17 00:00:00 2001 From: polsevev Date: Sun, 5 Mar 2023 04:16:59 +0100 Subject: [PATCH] maybe fixed audio issues --- src/GuiHookVec.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/GuiHookVec.rs b/src/GuiHookVec.rs index 8dd6393..10b1845 100644 --- a/src/GuiHookVec.rs +++ b/src/GuiHookVec.rs @@ -80,7 +80,7 @@ impl SortingList for GuiVec{ //Generate sounds let mut sounds = Vec::with_capacity(1000); for i in (50..2051).step_by(2){ - sounds.push(soundGenerator::generateTone(i as f32, 0.05).await); + sounds.push(soundGenerator::generateTone(i as f32, 0.1).await); } GuiVec{ @@ -178,12 +178,12 @@ impl SortingList for GuiVec{ self.list.swap(index1, index2); - if time::get_time() + 0.05 >= self.lastPlayed{ + if time::get_time() + 0.1 >= self.lastPlayed{ play_sound(self.sounds[ (self.list[index1].position * 1000 / self.list.len()) ], PlaySoundParams{ looped:false, volume:0.5 }); - self.lastPlayed = time::get_time()+0.05; + self.lastPlayed = time::get_time()+0.1; } self.lastTouched.clear(); @@ -234,12 +234,12 @@ impl SortingList for GuiVec{ self.reads += 1; self.list[i] = elem; self.draw().await; - if time::get_time() + 0.05 >= self.lastPlayed{ + if time::get_time() + 0.1 >= self.lastPlayed{ play_sound(self.sounds[ (self.list[i].position * 1000 / self.list.len()) ], PlaySoundParams{ looped:false, volume:1. }); - self.lastPlayed = time::get_time()+0.05; + self.lastPlayed = time::get_time()+0.1; } self.lastTouched.clear(); self.lastTouched.push(i);