google-cloud-speech

How to get the result of a long-running Google Cloud Speech API operation later?

给你一囗甜甜゛ 提交于 2019-12-05 03:25:09
问题 Below is a snippet that calls the Google Cloud Speech API long running operation to convert an audio file to text from google.cloud import speech speech_client = speech.Client() audio_sample = speech_client.sample( content=None, source_uri=gcs_uri, encoding='FLAC', sample_rate_hertz=44100) operation = audio_sample.long_running_recognize('en-US') retry_count = 100 while retry_count > 0 and not operation.complete: retry_count -= 1 time.sleep(60) operation.poll() However, as it is a long running

Save Google Cloud Speech API operation(job) object to retrieve results later

随声附和 提交于 2019-12-04 06:31:32
问题 I'm struggling to use the Google Cloud Speech Api with the ruby client (v0.22.2). I can execute long running jobs and can get results if I use job.wait_until_done! but this locks up a server for what can be a long period of time. According to the API docs, all I really need is the operation name(id). Is there any way of creating a job object from the operation name and retrieving it that way? I can't seem to create a functional new job object such as to use the id from @grpc_op What I want to

How to get the result of a long-running Google Cloud Speech API operation later?

被刻印的时光 ゝ 提交于 2019-12-03 17:28:50
Below is a snippet that calls the Google Cloud Speech API long running operation to convert an audio file to text from google.cloud import speech speech_client = speech.Client() audio_sample = speech_client.sample( content=None, source_uri=gcs_uri, encoding='FLAC', sample_rate_hertz=44100) operation = audio_sample.long_running_recognize('en-US') retry_count = 100 while retry_count > 0 and not operation.complete: retry_count -= 1 time.sleep(60) operation.poll() However, as it is a long running operation, it could take a while and I ideally don't want to keep the session on while it waits. Is it

Save Google Cloud Speech API operation(job) object to retrieve results later

☆樱花仙子☆ 提交于 2019-12-02 10:03:50
I'm struggling to use the Google Cloud Speech Api with the ruby client (v0.22.2). I can execute long running jobs and can get results if I use job.wait_until_done! but this locks up a server for what can be a long period of time. According to the API docs, all I really need is the operation name(id). Is there any way of creating a job object from the operation name and retrieving it that way? I can't seem to create a functional new job object such as to use the id from @grpc_op What I want to do is something like: speech = Google::Cloud::Speech.new(auth_credentials) job = speech.recognize_job

ImportError: No module named google.cloud

泪湿孤枕 提交于 2019-11-30 16:23:26
问题 I am unable to import google.cloud.speech from google.cloud import speech I have installed it using : pip install --upgrade google-cloud-speech -t dir-name It is giving me below error while importing it from dir-name ImportError: No module named google.cloud google package with all the sub package is present over there but without __init__ .py in every sub packages as well. How can I import this packages without adding __init__ .py in package folder? PS : I have also tried from __future__

How do I stream live audio from the browser to Google Cloud Speech via socket.io?

本小妞迷上赌 提交于 2019-11-28 22:09:43
I have a situation with a React-based app where I have an input for which I wanted to allow voice input as well. I'm okay making this compatible with Chrome and Firefox only, so I was thinking of using getUserMedia . I know I'll be using Google Cloud's Speech to Text API. However, I have a few caveats: I want this to stream my audio data live , not just when I'm done recording. This means that a lot of solutions I've found won't work very well, because it's not sufficient to save the file and then send it out to Google Cloud Speech. I don't trust my front end with my Google Cloud API

Difference between Android Speech to Text API (Recognizer Intent) and Google Cloud Speech API?

拜拜、爱过 提交于 2019-11-28 18:40:16
So i'm looking into building a speech to text app for fun. I did some research and found an inbuilt Speech to Text API using RecognizerIntent that is free, but also found that google is now offerieng a cloud speech API that the charge for. My question is, what is the difference between them, and If i use the inbuilt RecognizerIntent, is it free? Patrick R For the Google Cloud Speech API, refer to the following link: https://cloud.google.com/speech/ . Here are the highlights: It supports 80 different languages. It can recognize audio uploaded in the request. It returns text results in real-time

How can I extract the preceding audio (from microphone) as a buffer when silence is detected (JS)?

ぐ巨炮叔叔 提交于 2019-11-28 07:33:14
I'm using the Google Cloud API for Speech-to-text, with a NodeJS back-end. The app needs to be able to listen for voice commands, and transmit them to the back-end as a buffer. For this, I need to send the buffer of the preceding audio when silence is detected. Any help would be appreciated. Including the js code below if (!navigator.getUserMedia) navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia; if (navigator.getUserMedia) { navigator.getUserMedia({audio: true}, success, function (e) { alert('Error

How do I stream live audio from the browser to Google Cloud Speech via socket.io?

百般思念 提交于 2019-11-27 02:01:07
问题 I have a situation with a React-based app where I have an input for which I wanted to allow voice input as well. I'm okay making this compatible with Chrome and Firefox only, so I was thinking of using getUserMedia. I know I'll be using Google Cloud's Speech to Text API. However, I have a few caveats: I want this to stream my audio data live , not just when I'm done recording. This means that a lot of solutions I've found won't work very well, because it's not sufficient to save the file and

How can I extract the preceding audio (from microphone) as a buffer when silence is detected (JS)?

早过忘川 提交于 2019-11-27 01:51:49
问题 I'm using the Google Cloud API for Speech-to-text, with a NodeJS back-end. The app needs to be able to listen for voice commands, and transmit them to the back-end as a buffer. For this, I need to send the buffer of the preceding audio when silence is detected. Any help would be appreciated. Including the js code below if (!navigator.getUserMedia) navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia; if