Modify the audio recording code in listen_node.py to restrict the amount of audio recorded and stored in memory as a single segment.
In a noise environment, the background noise may exceed the silence threshold and trigger voice activity detection, which starts the recording of audio into memory. There needs to be a threshold to limit the amount of audio recorded, and therefore, memory used. A threshold is already applied when writing the WAV file which is sent for Speech-to-Text translation, but the audio recording is not currently limited. A similar threshold used for the WAV file writing can be used.
Modify the audio recording code in listen_node.py to restrict the amount of audio recorded and stored in memory as a single segment.
In a noise environment, the background noise may exceed the silence threshold and trigger voice activity detection, which starts the recording of audio into memory. There needs to be a threshold to limit the amount of audio recorded, and therefore, memory used. A threshold is already applied when writing the WAV file which is sent for Speech-to-Text translation, but the audio recording is not currently limited. A similar threshold used for the WAV file writing can be used.