Skip to content

detect silence #1837

Closed Answered by pschatzmann
ffaerber asked this question in Q&A
Discussion options

You must be logged in to vote

I think the following logic would make more sense to me:

  • starting: immediately if defined sound level is exeeded (= active level) and update last_active_time_ms = millis();
  • stopping: use a timeout value (e.g. 1000ms) and stop when millis() > last_active_time_ms + timeout value

In regard of your approach: with your current setting you are generating 32000 bytes/second. If you use a default copy size (which is 1024 bytes) this gives a volume for the last 32 ms. If you look at 5 readings, this means you still only look at only the last 160 ms

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by pschatzmann
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants