TalAter / SpeechKITT

🗣 A flexible GUI for Speech Recognition

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

There is a way to get the SpeechKITT as require('speechKITT')?

opened this issue · comments

There is a way to get the SpeechKITT as require('speechKITT')?

Expected Behavior

const SpeechKITT = require('speechKITT');

@sayeko have you finded a way to the issue ?

I didn't try to find a solution, but I think the best way you can handle it is to load the script and listen when it fully loaded then fire event to your application and create a service that will wrap speechKITT.
And of course the service will use the commonjs module so you will not have any problem to share the facade service for speechKITT across your application via simple require.

@MxMGirou

@sayeko , I've heard that Speech reconiztion have beed removed form tools likes electron/chromnium... :(

@MxMGirou I did not hear about removing voice recognition api from chrome..
If you want I created a small api facade that wrap voice recognition for webapps and hybrid application.
Moreover if pepole will ask I may recreate it in ES6/ES7 class implementation.

Github.com/sayeko/carolina

@sayeko Yes, i saw that. I will look at it thank you ;)

commented

For fixing the issue you have to add the right path in your package.json:
"main" property should be "src/speechkitt.js" and not just "speechkitt.js".

A work around is to import the package with the full path, something like
import speechKitt from './node_modules/speechkitt/src/speechkitt';
or
var speechKitt = require('./node_modules/speechkitt/src/speechkitt');

@maximusmars thanks. Though import speechKitt from './node_modules/speechkitt/src/speechkitt';
did not work for me. Instead I used:
import { SpeechKITT } from './node_modules/speechkitt/src/speechkitt'