Compare commits
No commits in common. "97a1f901b481a048001b68836f00d111a2600d86" and "9b1bf9c2526f9137e4790ef9d9ec0d71fdfd9cc8" have entirely different histories.
97a1f901b4
...
9b1bf9c252
@ -101,7 +101,7 @@ func (au *Audio) ProcessInput(conn *ircevent.Connection, channel string) error {
|
||||
defer stream.Stop()
|
||||
|
||||
data := make([]byte, 480)
|
||||
// debounce := 0
|
||||
debounce := 0
|
||||
for frame := range inChan {
|
||||
C.rnnoise_process_frame(
|
||||
st,
|
||||
@ -109,14 +109,14 @@ func (au *Audio) ProcessInput(conn *ircevent.Connection, channel string) error {
|
||||
(*C.float)(unsafe.Pointer(&frame[0])),
|
||||
)
|
||||
|
||||
// if rms(frame) < 0.02 {
|
||||
// debounce++
|
||||
// if debounce >= 10 {
|
||||
// continue
|
||||
// }
|
||||
// } else {
|
||||
// debounce = 0
|
||||
// }
|
||||
if rms(frame) < 0.02 {
|
||||
debounce++
|
||||
if debounce >= 10 {
|
||||
continue
|
||||
}
|
||||
} else {
|
||||
debounce = 0
|
||||
}
|
||||
|
||||
n, err := enc.EncodeFloat32(frame, data)
|
||||
if err != nil {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user