Comments (34)
- Which version are you using?
- Which options are you setting on
SpeechRecognition
? - If you debug or
console.log
the properties injected bySpeechRecognition
, what do you see? - Are you using it offline? (I recall your previous issue on this repo, which asked about offline use)
from react-speech-recognition.
Version: 1.1.0
Options: none, just the default.
Console.log for these items...
console.log(transcript);
console.log(resetTranscript);
console.log(browserSupportsSpeechRecognition);
returns "True", a blank line, and a function...
"Ζ () {
interimTranscript = '';
finalTranscript = '';
_this.disconnect('RESET');
_this.setState({ interimTranscript: interimTranscript, finalTranscript: finalTranβ¦"
Haha, no, not offline, you made that clear it's not possible :) Even in that case though it gave an error, this is just nothing.
Here is the full code of the app I'm trying to make work now. It was just taken from a stack exchange sample file.
import React, {Component } from 'react'
import SpeechRecognition from 'react-speech-recognition'
class Dictaphone extends Component {
render() {
const { transcript, resetTranscript, browserSupportsSpeechRecognition } = this.props
if (!browserSupportsSpeechRecognition) {
return null
}
return (
<div>
<button onClick={resetTranscript}>Reset</button>
<span>{transcript}</span>
</div>
)
}
}
export default SpeechRecognition(Dictaphone)
from react-speech-recognition.
I have used this same example code using version 1.1.0 and it behaves as normal.
When you run the app, do you see the red recording icon in your Chrome tab?
from react-speech-recognition.
No. I used to, but now for some reason it doesn't. I must've done something to goof it up, but not sure how to track it down since it was working last time I ran it about 3 weeks ago.
from react-speech-recognition.
To help me determine if this is a bug in 1.1.0 (which was released last week), can you revert back to 1.0.7 and see if you still get the issue?
from react-speech-recognition.
Hard-code the version with:
"react-speech-recognition": "1.0.7",
in your package.json
and then run npm install
.
from react-speech-recognition.
Another test to see if the Web Speech API is working in your browser:
- Open Dev Tools
- Open Console
- Run
const recognition = new webkitSpeechRecognition();
recognition.start();
- Do you see the red recording icon?
from react-speech-recognition.
Another possibility is that you accidentally blocked your app from using your microphone in Chrome. If that is the case, you will see this icon in the right-hand side of your address bar:
from react-speech-recognition.
Using 1.0.7 did not fix.
It's not the blocked microphone, checked that earlier.
When I try to run...
const recognition = new webkitSpeechRecognition();
recognition.start();
I get...
undefined
from react-speech-recognition.
When I try to run...
const recognition = new webkitSpeechRecognition();
recognition.start();I get...
undefined
Yes, but does the recognition start and the red icon appear on your tab?
from react-speech-recognition.
No
from react-speech-recognition.
Which browser are you using?
from react-speech-recognition.
Google Chrome
Version 73.0.3683.86 (Official Build) (64-bit)
from react-speech-recognition.
I have the same version and the two lines of code I posted above turned on the recognition. Web Speech API isn't working in your browser for some reason.
Two thoughts:
- Restart your browser and run those two lines again
- Is your microphone broken?
from react-speech-recognition.
gonna restart whole computer again, and browser, and then test mic, will be back with results.
from react-speech-recognition.
Haha drastic measures indeed! π I look forward to the results.
from react-speech-recognition.
still not working :(
I restarted computer, restarted chrome and disabled all extensions... I gotta be doing something really stupid to make this not work lol
from react-speech-recognition.
oh and mic seems to be working, did a test record and the test setup in system prefs
from react-speech-recognition.
And to double-check, when you run
const recognition = new webkitSpeechRecognition();
recognition.start();
in a new tab, you do not see the flashing red recording icon in your tab?
from react-speech-recognition.
correct.
from react-speech-recognition.
What properties are on your recognition
object? Just run
const recognition = new webkitSpeechRecognition();
recognition
Do you see an object like this?
from react-speech-recognition.
from react-speech-recognition.
Did you instantiate it first?
from react-speech-recognition.
const recognition = new webkitSpeechRecognition();
recognition
from react-speech-recognition.
from react-speech-recognition.
And when you run recognition.start()
, no flashing icon... Weird.
Here's a good test: try this website https://www.cs.cmu.edu/~dst/SpeechDemo/
from react-speech-recognition.
yeah, super weird.
This is interesting, it's saying not allowed even though in site settings it's set to "ask" and when I toggle it to "allowed" it still says not allowed. I wonder if there's some global permission I messed up at some point.
from react-speech-recognition.
Could you screenshot the thing that says the microphone is not allowed?
from react-speech-recognition.
from react-speech-recognition.
I'm pulling at straws here, but is it possible that Chrome itself is blocked by your operating system from using the microphone? You mentioned System Preferences earlier, so I guess you're using a Mac. Maybe check this out? https://support.apple.com/en-gb/guide/mac-help/control-access-to-your-microphone-on-mac-mchla1b1e1fe/mac
from react-speech-recognition.
Though that link says you'd get prompted if the app tried to access the microphone again...
from react-speech-recognition.
THAT WAS IT!!!!!
THANKS FOR GRASPING THE STRAWS!!!
I was googling for hours for something like this but just kept coming across stuff about SSLs.
I guess this was in the system update and I just had no idea it was even a thing.
AGAIN THANK YOU SO MUCH (and sorry it had nothing to do with your component really).
from react-speech-recognition.
Though that link says you'd get prompted if the app tried to access the microphone again...
Yeah, it says that, but there was no such prompt lol hence having no idea where to check. Thank you again!
from react-speech-recognition.
Glad to hear you're unblocked! This was fun. π
from react-speech-recognition.
Related Issues (20)
- (browserSupportsContinuousListening): does not exist on useSpeechRecognition π¬
- regeneratorRuntime is not defined when using react with vite HOT 7
- Update/Remove Speechly Support
- Final transcript is always empty
- It is not working in mozilla firefox
- Hi it not working in mobile Chrome and some desktop HOT 3
- "onEnd" does not work properly. HOT 1
- regeneratorRuntime is not defined HOT 9
- Issue in Commands
- Can you create a plane JavaScript library for this?
- requesting Speech to text for Tamil language
- Reference Error
- Uncaught (in promise) TypeError: Cannot read properties of null HOT 1
- not working after deployment HOT 1
- browserSupportsSpeechRecognition returns true on Chrome iOS when it should be false HOT 1
- startListening is not a function HOT 2
- Working on Edge in MacOS
- Stopped working after latest chrome update HOT 4
- The speechrecogination dosen't work HOT 2
- Is there any way to change which microphone it uses?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-speech-recognition.