Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix for passive listen #187

Merged
merged 1 commit into from
May 25, 2019

Conversation

aaronchantrill
Copy link
Contributor

Description

When testing today I discovered that using the google stt plugin
no audio was being transcribed due to the fact that that plugin
does not seek a location in the passed file handle, which the
pocketsphinx and deepspeech plugins I tested against before do.
Since it is not a requirement that stt plugins set the file
location, and it is reasonable to assume that the file handle is
currently pointed to the beginning of the file, it seemed
reasonable to fix this in the naomi/mic.py module.

This patch just sets the file pointer back to the beginning of
the file before calling active_stt_engine.transcribe() on the
active file handle when using passive_listen mode.

Related Issue

Issue #48 - Passive Listening for commands

Motivation and Context

In passive listen mode, the passive listener is used to check the audio for the keyword. If the keyword is found, then the same block of audio is passed directly to the active listener. The active listener might, rightly, assume that the file handle should be pointed to the beginning of a file that was just opened. When the file handle is still set to the end of the file, then it appears to the plugin as if the file itself is empty, resulting in an empty transcription.

How Has This Been Tested?

Tested using pocketsphinx for passive listening and google stt plugin for active listening.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

When testing today I discovered that using the google stt plugin
no audio was being transcribed due to the fact that that plugin
does not seek a location in the passed file handle, which the
pocketsphinx and deepspeech plugins I tested against before do.
Since it is not a requirement that stt plugins set the file
location, and it is reasonable to assume that the file handle is
currently pointed to the beginning of the file, it seemed
reasonable to fix this in the naomi/mic.py module.

This patch just sets the file pointer back to the beginning of
the file before calling active_stt_engine.transcribe() on the
active file handle when using passive_listen mode.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants