SpeechKITT icon indicating copy to clipboard operation
SpeechKITT copied to clipboard

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

Open ghost opened this issue 8 years ago • 7 comments
trafficstars

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

Expected Behavior

const SpeechKITT = require('speechKITT');

ghost avatar Feb 22 '17 17:02 ghost

@sayeko have you finded a way to the issue ?

MxMGirou avatar Aug 21 '17 09:08 MxMGirou

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

ghost avatar Aug 21 '17 21:08 ghost

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

MxMGirou avatar Aug 21 '17 22:08 MxMGirou

@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

ghost avatar Aug 22 '17 05:08 ghost

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

MxMGirou avatar Aug 22 '17 14:08 MxMGirou

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 avatar Dec 05 '17 10:12 maximusmars

@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'

amirgro avatar Dec 20 '17 07:12 amirgro