Guidance (or actual code) for how to detect when speech has ended from an I2S input (or from the output) #1661
-
Hi All, Further to my Show and Tell post here - https://github.com/pschatzmann/arduino-audio-tools/discussions/1629 Presently, when the I2S Microphone is disabled, I have set it to automatically play a short static noise track (MP3). However, the users have asked if this can be re-designed to trigger when they stop speaking, as they do not wish to keep enabling and disabling the Microphone input. For information, when a Storm Trooper stops speaking in the films, they have this static noise at the end, which is what I have tried to replicate. Code which currently triggers the static.mp3 files as follows:
Thanks in anticipation. |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 5 replies
-
I guess you talk about the "annoying feature" of the new ESP32 I2S API which provides some nose, if no audio data is provided. You could determine if you have any audio input by measuring the volume... Or you can roll back to a pre 3.0 ESP32 Arduino Core... |
Beta Was this translation helpful? Give feedback.
-
As mentioned above, the best and easiest way would be to just measure the volume. You could try to build and train an AI model to distinguish between noise and speech, but that that would be quite involving... |
Beta Was this translation helpful? Give feedback.
-
Thanks Phil, I'll see what I come up with. If I solve it, I will post it here for others. |
Beta Was this translation helpful? Give feedback.
-
Just put the VolumeMeter into your input chain: e.g. I2SStream -> VolumeMeter -> ConverterStream |
Beta Was this translation helpful? Give feedback.
-
Thanks for replying this late! I have, as follows, but the output shows 0, although the Microphone still works. New parameters
Enabled Mic function, updated as follows:
Loop updated for output, but all data comes back as 0
|
Beta Was this translation helpful? Give feedback.
-
I told you to create the following chain: I2SStream -> VolumeMeter -> ConverterStream -- copy > I2SStream |
Beta Was this translation helpful? Give feedback.
I told you to create the following chain: I2SStream -> VolumeMeter -> ConverterStream -- copy > I2SStream
Instead you did this I2SStream -> ConverterStream -- copy > VolumeMeter