robotology / assistive-rehab

Assistive and Rehabilitative Robotics
https://robotology.github.io/assistive-rehab/doc/mkdocs/site
BSD 3-Clause "New" or "Revised" License
20 stars 11 forks source link

Investigate possible race condition in `googleSpeech` module #346

Closed mfussi66 closed 1 year ago

mfussi66 commented 1 year ago

The googleSpeech module is responsible to gather audio samples from the microphone, and send them to a Google service dedicated to transcription. The data is gathered through a callback function, and inside this function the module checks if the recording stop was triggered. The start and stop of the recording are triggered by the managerTUG. However, sometimes, the callback is called only once, even though the managerTUG sent only the start.

It's a shot in the dark, but it might be the effect of a race condition. To fix it, we should make the logic of the callback a bit more robust, without the need of significant rework.