nodejs-speech | js client for Google Cloud Speech | Speech library
kandi X-RAY | nodejs-speech Summary
kandi X-RAY | nodejs-speech Summary
Cloud Speech Client Library for Node.js. A comprehensive list of changes in each version may be found in the CHANGELOG. Read more about the client libraries for Cloud APIs, including the older Google APIs Client Libraries, in Client Libraries Explained.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of nodejs-speech
nodejs-speech Key Features
nodejs-speech Examples and Code Snippets
Community Discussions
Trending Discussions on nodejs-speech
QUESTION
Time offsets for streaming audio transcriptions through Google Speech-To-Text are not working for me. My configuration looks like this:
...ANSWER
Answered 2020-Nov-11 at 21:40The preponderance of evidence suggests that time offsets for words transcribed through Google Speech-To-Text are returned only when the bit is_final
is True
.
Said another way, timestamped word-boundaries for real-time transcriptions appear only to be available at the end of the transcription.
I know I am not the only API consumer out there asking for this feature. I can't imagine this is hard to do, and I suspect the fix would not break the current API.
QUESTION
I'd like to be able to end a Google speech-to-text stream (created with streamingRecognize
), and get back the pending SR (speech recognition) results.
In a nutshell, the relevant Node.js code:
...ANSWER
Answered 2020-Nov-02 at 02:03This: "I'm looking for a potential workaround." - have you considered extending from SpeechClient as a base class? I don't have credential to test, but you can extend from SpeechClient with your own class and then call the internal close()
method as needed. The close()
method shuts down the SpeechClient and resolves the outstanding Promise.
Alternatively you could also Proxy the SpeechClient() and intercept/respond as needed. But since your intent is to shut it down, the below option might be your workaround.
QUESTION
I was in a meeting on Google Meet and saw that you could turn on real time subtitles. They've actually got a demo here on how realtime speech to text can be done, so that bit doesn't confuse me.
I had also been wanting to experiment with WebRTC (which I believe GoogleMeet uses) just to see its capabilities - e.g. the ability to share a screen without any additional screens.
However, I've always been under the impression that a WebRTC video/audio stream is client peer-to-peer. The questions I have therefore are
- How then are Google able to send the audio stream off to a server for analysis?
- Is it possible to send the audio stream to the client as well as to a server?
- Would you have to create two of the same audio stream (i don't know if this is even possible), send one over WebRTC to the other peer(s) and the other to a server for analysis?
How do they achieve this - and if they don't use WebRTC, is it possible to achieve this with WebRTC?
...ANSWER
Answered 2020-Mar-27 at 07:49Google Meet is using WebRTC. The "peer" in that case is a server, not a browser. While six years old and some details have changed, much of this old article is still true. From the server Google can do audio processing.
This video describes the architecture required for speech-to-text (and actually translation + text-to-speech again).
QUESTION
I have built a web based Speech-to-Text application with Google Speech-to-Text API.
The application flow:
- Get audio stream from browser
- Stream audio data to a speech recognition service and get real time results as our user talks
I have referenced the sample code in my application, the streamingRecognize
request works perfectly with a signal client call, and my server can receive the interim-transcription result from Google Speech API.
However, when there are more then one client call streamingRecognize
simultaneously, Google Speech API will get stuck. So, may I know how to handle more than one streamingRecognize
request concurrently? Do I need to create another client
to process the second streamingRecognize
request? Thanks.
Back-end server specifications:
- NodeJS
- Socket.io
ANSWER
Answered 2020-Feb-27 at 19:47Trying to do same, and meeting same troubles as you, or they stop working, or just one client works time to time and other giving strange results, sometimes both, looks like you have single buffer for your main account, have you tried generating api/tokens for each user? Does it worth it, or still there will be same buffer
QUESTION
Am trying to call the speech-to-text api of google console for nodejs and apparently is working, but when i try to run the example provider for here the example node MicrophoneStream.js and doing the installation like this here, am having the following error.
STDERR: sox FAIL sox: Sorry, there is no default audio device configured
i dont really know how to pass the device with arguments and i assuming is the default microphone but not sure cause in some page i found a possible value for this like "AUDIOWAVE", also configured in my system and still not working.
the recorder
object have a function record and i can start the recorder from that passing arguments ( i suppose are passed to sox binaries ), like this
ANSWER
Answered 2019-Nov-05 at 16:24Well i see the question dont get any answer, but i apologize because i found a solution few months ago.
In resumen the version 14.4.2 of sox have some issues in my windows 10 OS, (i test in linux version with fedora 30.1 distribution and works correctly), so i found a solution in the node-speakable repo, just downgrading the version to 14.4.1.
I solved this problem by installing sox 14.4.1 rather than 14.4.2 (here)
i solved this problem in the same way.
anyway (there) is another way in the same post who can solved with the version 14.4.2, but i think is a little tricky cause you play with the command and not implement the library or scripts files but is still a option.
QUESTION
I'm currently playing with a GCP service called API Speech-to-Text, using the NodeJS client library.
For that, I followed the quickstart documentation, trying to recognize a short local audio file (quite simply) first. However, I keep getting this error when I run node test_sample.js
:
ANSWER
Answered 2019-Jun-11 at 07:10You noted that the project number isn't the same as the one you're seeing the error result, so that seems to be the bigger problem here... The Google Cloud client libraries get the project information and credentials from a few different places (with different priorities for each), so it's possible that you're accidentally picking up credentials and identity from the application defaults (possible the gcloud
command-line tool). Can you update the question with the code you're running to get this error?
There are a few ways to fix an issue like this, but the easiest is probably to just run:
gcloud auth application-default login
in the command line (documentation).
Once you follow the authentication flow, you should end up with credentials for the intended project.
You also might want to take a look at the Getting Started with Authentication guide for GCP in Node.js which talks about creating a service account and setting those credentials using an environment variable.
QUESTION
Is there a way to terminate Google STT streamingRecognize() RPC call from client side? I am using NodeJS library and node-audiorecorder to achive streaming from the Mic.
Also, how do you handle the network unavailability when google client disconnected?
Thanks in advance!
...ANSWER
Answered 2018-Dec-12 at 10:41To terminate the the RPC call from the client side you can use audioRecorder.stop()
from the node-audiorecorder.
You can get more information on how gRPC works in the gRPC concepts documentation.
On how to handle network failures and other errors you can take a look at this. Here you can find some examples.
QUESTION
ANSWER
Answered 2018-Mar-22 at 15:17As the error message said, you should read this to get your credentials set up.
QUESTION
I'm trying to use Google cloud speech API, by recording audio in my Angular FrontEnd, converting it to base64, sending it to my Node backend, which does the query to google speech API.
So far I have had no success with it, google only sending me empty results.
You'll see that in order to identify the problem, I'm looping through all possible sampleRate and audio format.
Another thing to note is that testing with Google example audio.raw (found here https://github.com/googleapis/nodejs-speech/tree/master/samples), it works, and I get a transcription.
Here is my front end:
...ANSWER
Answered 2018-Feb-21 at 11:47Since the audio.raw from the Google example works, the issue is likely with the audio you're using. The Speech API is a bit finicky with the audio it accepts. (Mono only for example, see this article). The problem you're seeing is described in the troubleshooting section for the Speech API, where it states why you can get an empty response.
I've tested the mozdevs MediaRecorder examples here to create an audio file and pass that to the Speech API, and it seems the API really doesn't like the format that MediaRecorder creates.
You'll have to convert the audio into something like FLAC or LINEAR16 to get the Speech API to interpret it. Doing some digging I found this github example, and passing the resulting audio from that to the Speech API I get the correct transcript back from the API.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install nodejs-speech
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page