From 304420fe97fe0d377e7afcb525fffecc619f7c02 Mon Sep 17 00:00:00 2001 From: schneefux Date: Wed, 1 Oct 2014 19:10:45 +0200 Subject: Use diagnose module in stt.py and tts.py --- client/stt.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'client/stt.py') diff --git a/client/stt.py b/client/stt.py index cfaced6..485f5d9 100644 --- a/client/stt.py +++ b/client/stt.py @@ -5,12 +5,12 @@ import traceback import wave import json import tempfile -import pkgutil import logging from abc import ABCMeta, abstractmethod import requests import yaml import jasperpath +import diagnose """ The default Speech-to-Text implementation which relies on PocketSphinx. @@ -171,7 +171,7 @@ class PocketSphinxSTT(AbstractSTTEngine): @classmethod def is_available(cls): - return (pkgutil.get_loader('pocketsphinx') is not None) + return diagnose.check_python_import('pocketsphinx') """ Speech-To-Text implementation which relies on the Google Speech API. @@ -274,7 +274,7 @@ class GoogleSTT(AbstractSTTEngine): @classmethod def is_available(cls): - return True + return diagnose.check_network_connection() """ Returns a Speech-To-Text engine. -- cgit v1.3.1