File tree Expand file tree Collapse file tree 3 files changed +25
-5
lines changed Expand file tree Collapse file tree 3 files changed +25
-5
lines changed Original file line number Diff line number Diff line change 1313we are working on this project all the time. its a sort of time filler for us at this point. expect lots of additions and changes at random times.
1414
1515## supported audio backends
16- - PortAudio (linux/macOS/* windows ** )
16+ - PortAudio (linux/macOS/* windblows ** )
1717- PulseAudio (parec/FFmpeg)
1818- AVFoundation (FFmpeg)
1919- ALSA (FFmpeg)
@@ -27,7 +27,7 @@ we are working on this project all the time. its a sort of time filler for us at
2727 - github.com/lawl/pulseaudio
2828 - gonum.org/v1/gonum
2929
30- - c libraries (` CGO_ENABLED=1 ` )
30+ - c libraries (optional, disable with ` CGO_ENABLED=0 ` )
3131 - fftw (fftw3)
3232 - portaudio (portaudio-2.0)
3333
@@ -52,10 +52,10 @@ CGO_ENABLED=0 go get github.com/noriah/tavis
5252# get source
5353git clone https://github.com/noriah/tavis.git
5454
55- # move to source
55+ # cd to source
5656cd tavis
5757
58- # build tavis
58+ # build and install tavis
5959go install
6060# without cgo
6161CGO_ENABLED=0 go install
Original file line number Diff line number Diff line change 11package main
22
33import (
4+ "errors"
5+
46 "github.com/noriah/tavis/dsp"
57 "github.com/noriah/tavis/graphic"
68 "github.com/noriah/tavis/input"
@@ -62,6 +64,24 @@ func NewZeroConfig() Config {
6264
6365func sanitizeConfig (cfg * Config ) error {
6466
67+ if cfg .SampleRate < float64 (cfg .SampleSize ) {
68+ return errors .New ("sample rate lower than sample size" )
69+ }
70+
71+ if cfg .SampleSize < 4 {
72+ return errors .New ("sample size too small (4+ required)" )
73+ }
74+
75+ switch {
76+
77+ case cfg .ChannelCount > 2 :
78+ return errors .New ("too many channels (2 max)" )
79+
80+ case cfg .ChannelCount < 1 :
81+ return errors .New ("too few channels (1 min)" )
82+
83+ }
84+
6585 switch {
6686 case cfg .WinVar > 1.0 :
6787 cfg .WinVar = 1.0
Original file line number Diff line number Diff line change @@ -163,7 +163,7 @@ func (sp *Spectrum) Process(win window.Function) {
163163 mag = 0.0
164164
165165 case sp .bins [xB ].floorFFT < bassCut :
166- pow *= math .Max (0.75 , float64 (xF )/ fBassCut )
166+ pow *= math .Max (0.5 , float64 (xF )/ fBassCut )
167167 }
168168
169169 mag *= sp .bins [xB ].eqVal
You can’t perform that action at this time.
0 commit comments