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

caller doesn't manage --no-audio correctly #8

Open
fralbo opened this issue Dec 13, 2018 · 0 comments
Open

caller doesn't manage --no-audio correctly #8

fralbo opened this issue Dec 13, 2018 · 0 comments

Comments

@fralbo
Copy link

fralbo commented Dec 13, 2018

Hello,

In case of audiodev.so import failure we cannot use caller.py module even if we specified --no-audio option.
In fact it's due to a problem in the import statement which is:

try: import audiodev, audiospeex, audiotts, audioop
except ImportError: audiodev, audiospeex = audiotts = audioop = None

so if audiodev import fails, all imports including audiotts are set to None. But later in the code we have:

if options.recognize and sr is None:
    raise ImportError('please install speech_recognition module in your PYTHONPATH to use --recognize option')
if options.textspeech and audiotts is None:
    raise ImportError('please install py-audio in your PYTHONPATH to use --textspeech option')
if options.audio and audiodev is None:
    raise ImportError('please install py-audio in your PYTHONPATH to use audio, otherwise start with --no-audio option')

So if you use --textspeech option you will verify the second if test which is wrong because the problem came from audiodev.

Imports should be:

try: import audiospeex, audiotts, audioop
except ImportError: audiospeex = audiotts = audioop = None

try: import audiodev
except ImportError: audiodev = None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant