Skip to content

Commit efcd524

Browse files
committed
fix port and bad indexing
1 parent 931111e commit efcd524

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

dsp/analyzer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ func (az *analyzer) ProcessBin(ch, idx int, src []complex128) float64 {
103103
}
104104

105105
if f := az.freqToIdx(400.0, math.Floor); fftFloor < f {
106-
mag *= (0.55 * (float64(fftFloor) / float64(f)))
106+
mag *= (0.55 * (float64(fftFloor+1) / float64(f)))
107107
}
108108

109109
// time smoothing

input/portaudio/portaudio.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,13 +162,13 @@ func (s *Session) Start(ctx context.Context, dst [][]input.Sample, kickChan chan
162162
case kickChan <- true:
163163
break loop
164164
default:
165-
fmt.Println("waiting")
165+
// fmt.Println("waiting")
166166
}
167167

168168
if ready, _ := stream.AvailableToRead(); ready >= samples {
169-
if ready > samples {
170-
fmt.Println("OVER", ready)
171-
}
169+
// if ready > samples {
170+
// fmt.Println("OVER", ready)
171+
// }
172172
break
173173
}
174174
}

0 commit comments

Comments
 (0)