encs-humanoid / speech-and-hearing

speech and hearing systems for the IEEE ENCS Humanoid Robot Project
1 stars 1 forks source link

Prevent indefinitely long audio recordings in noisy environment #3

Closed danielmcd closed 8 years ago

danielmcd commented 8 years ago

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.

danielmcd commented 8 years ago

Fix checked into listen_node.py. Recording is now limited to approx. 200000 samples.