Skip to content

Commit

Permalink
fix: Update poll interval for audio buffer monitoring
Browse files Browse the repository at this point in the history
  • Loading branch information
tphakala committed May 21, 2024
1 parent 8eb7bfb commit ab6cb90
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/myaudio/buffers.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

const (
chunkSize = 288000 // 3 seconds of 16-bit PCM data at 48 kHz
pollInterval = time.Millisecond * 100
pollInterval = time.Millisecond * 10
)

// A variable to set the overlap. Can range from 0 to 2 seconds, represented in bytes.
Expand Down Expand Up @@ -85,7 +85,7 @@ func BufferMonitor(wg *sync.WaitGroup, bn *birdnet.BirdNET, quitChan chan struct
data := readFromBuffer()
// if buffer has 3 seconds of data, process it
if len(data) == chunkSize {
startTime := time.Now().Add(-4 * time.Second)
startTime := time.Now().Add(-4500 * time.Millisecond)
err := ProcessData(bn, data, startTime)
if err != nil {
log.Printf("Error processing data: %v", err)
Expand Down

0 comments on commit ab6cb90

Please sign in to comment.