sound absolutely fixed

This commit is contained in:
Rolf Martin Glomsrud 2023-03-05 00:23:18 +01:00
parent c3ef0c4b7b
commit 2df3d0a005

View file

@ -80,7 +80,7 @@ impl SortingList for GuiVec{
//Generate sounds //Generate sounds
let mut sounds = Vec::with_capacity(1000); let mut sounds = Vec::with_capacity(1000);
for i in (50..2100).step_by(2){ for i in (50..2100).step_by(2){
sounds.push(soundGenerator::generateTone(i as f32, 0.1).await); sounds.push(soundGenerator::generateTone(i as f32, 0.05).await);
} }
GuiVec{ GuiVec{
@ -178,9 +178,9 @@ impl SortingList for GuiVec{
self.list.swap(index1, index2); self.list.swap(index1, index2);
if time::get_time() + 0.5 >= self.lastPlayed{ if time::get_time() + 0.05 >= self.lastPlayed{
play_sound_once(self.sounds[ (self.list[index1].position * 1000 / self.list.len()) ]); play_sound_once(self.sounds[ (self.list[index1].position * 1000 / self.list.len()) ]);
self.lastPlayed = time::get_time()+0.5; self.lastPlayed = time::get_time()+0.05;
} }
//self.list[index2].playSound(); //self.list[index2].playSound();