File tree Expand file tree Collapse file tree 1 file changed +6
-13
lines changed Expand file tree Collapse file tree 1 file changed +6
-13
lines changed Original file line number Diff line number Diff line change @@ -681,8 +681,11 @@ fn input_eq_cmd(serialdevs: &Vec<String>) {
681
681
move |info, samples| {
682
682
analyzer. analyze ( samples) ;
683
683
684
+ let sampled_volume = samples. volume ( 0.3 ) * 400.0 ;
685
+ let display_max_width = 34.0 ;
686
+
684
687
info. spectrum . fill_from ( & analyzer. average ( ) ) ;
685
- info. volume = samples . volume ( 0.3 ) * 400.0 ;
688
+ info. volume = if sampled_volume < 34.0 { sampled_volume } else { display_max_width } ;
686
689
info. beat = info. spectrum . slice ( 50.0 , 100.0 ) . max ( ) * 0.01 ;
687
690
info
688
691
} ,
@@ -697,21 +700,11 @@ fn input_eq_cmd(serialdevs: &Vec<String>) {
697
700
for serialdev in serialdevs {
698
701
eq_cmd (
699
702
serialdev,
700
- & [
701
- info. volume as u8 ,
702
- info. volume as u8 ,
703
- info. volume as u8 ,
704
- info. volume as u8 ,
705
- info. volume as u8 ,
706
- info. volume as u8 ,
707
- info. volume as u8 ,
708
- info. volume as u8 ,
709
- info. volume as u8 ,
710
- ] ,
703
+ & [ info. volume as u8 ; 9 ]
711
704
)
712
705
}
713
706
} ) ;
714
- thread:: sleep ( Duration :: from_millis ( 30 ) ) ;
707
+ thread:: sleep ( Duration :: from_millis ( 15 ) ) ;
715
708
}
716
709
}
717
710
You can’t perform that action at this time.
0 commit comments