question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Make an automated support for using either Snowboy or Pocketsphinx when one is not installed.

See original GitHub issue

Is your feature request related to a problem? Please describe.

Currently under hotword, we let the user decide if they have Snowboy installed on their device and ask them to use it if they have (due to its much more features). On the other hand if Snowboy is not installed we ask them to go for PocketSphinx and use it.

https://github.com/fossasia/susi_linux/blob/912948bf34eb43018f71fde44e6ff5ea44eaab2a/main/hotword_engine/__init__.py#L7

Instead of this we can easily do it through the code for the user by checking if the corresponding library is available without the user having to bother which hotword detection to import.

Describe the solution you’d like Make a try catch exception while importing the hotword detection library under https://github.com/fossasia/susi_linux/blob/master/main/hotword_engine/__init__.py

https://github.com/fossasia/susi_linux/blob/912948bf34eb43018f71fde44e6ff5ea44eaab2a/main/hotword_engine/__init__.py#L10

A clear and concise description of what you want to happen.

So we can see if we get an ImportError while importing snowboy, then we can import the Pocketsphinx and vice-versa. This will not let the user to bother about which library to used without having him/her to check which one is installed. It would simply try importing the libraries and if exception occurs in one it will go for importing the other module.

Describe alternatives you’ve considered A clear and concise description of any alternative solutions or features you’ve considered. NA

Additional context Add any other context or screenshots about the feature request here. NA

Would you like to work on this ? I would like to work on it

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:14 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
hongquancommented, Jul 5, 2018

@prateekiiest

SNOWBOY_AVAILABLE = False
POCKETSPHINX_AVAILABLE = False
try:
	from snowboy.snowboydetect import SnowboyDetect
	SNOWBOY_AVAILABLE = True
except ImportError:
	pass

Note, the symbol looks different (snowboy.snowboydetect.SnowboyDetect vs snowboy_detector.SnowboyDetector) because mine is using standard installation of snowboy.

0reactions
prateekiiestcommented, Jul 12, 2018

Currently the things that has been done are follows

I have already merged the patch-2 changes of PR https://github.com/fossasia/susi_linux/pull/231 into PR https://github.com/fossasia/susi_linux/pull/228

Read more comments on GitHub >

github_iconTop Results From Across the Web

cmusphinx/pocketsphinx: A small speech recognizer - GitHub
To install the C library and bindings (assuming you have access to /usr/local - if not, use -DCMAKE_INSTALL_PREFIX to set a different prefix...
Read more >
Building an application with PocketSphinx - CMUSphinx
Installation. PocketSphinx is a library that depends on another library called SphinxBase which provides common functionality across all CMUSphinx projects.
Read more >
Rhasspy offline voice assistant toolkit - Custom Integrations
I'm trying to get Mycroft Precise to work, but have an issue with installing Tensorflow 1.8.0. Once I'm passed that, that might do...
Read more >
Setting Up PocketSphinx in Mac OS X - Stack Overflow
I am running Enthought Python 2.7 as well as default Python 2.7 , Xcode 4.5.1 in Mac OS 10.8.2 . I am trying...
Read more >
Skeleton of Implementing Voice Control for Building ... - Hindawi
A building automation system (BAS) is normally installed to control and ... a skeleton for integrating voice control with any building automation system....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found