-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Speech] speech_streaming.py code does not worl #344
Comments
@jerjou can you take a look here? |
Hm... looks like a grpc on ARM thing. A quick search turns up this bug, which seems to indicate that grpc has a fix. Try replacing Let me know how that goes. |
thanks for your help,
quick google search shows me this link: grpc/grpc#6083 Can you give me more advices? |
This is my new requirement file
Then I go to the grpcio src folder, issue command: After that, I issue command: And this is the error:
Any advices? |
anyone? |
@heroddaji found the solution: make sure you are using gcc 4.7 to make gcc 4.7 the default compiler con raspbian follow this link: http://www.rpiblog.com/2014/07/installing-gcc-on-raspberry-pi.html hope this helps! |
Thank you, i will try that and let you know the result soon |
Finally can compile all the dependencies for the So what I did is plugin the camera with mic build-in, and talk after I execute the program. Pls help me again, thank you all
|
Also, when I run the code on MacOS, I got this error message (it hangs for a while before showing the error message)
|
After fixing the audio driver, I got a new error, the special part is google error. Any help?
|
@heroddaji im suffering the same issue. battled with it all weekend, but i didnt get to the solution. if you have any info, please let me know. thx |
Any Google employee can help?
|
So at this moment, all the test file work, my audio device also working fine. Nothing wrong. Pls give some feedback
|
Sorry - I've been at a conference these past couple of days.. Yeah - the LocalError is thrown when there's some error within one of the threads that the grpc client library spins up for the streaming process. For some reason the grpc library swallows the original exception, so it's not shown in the stack trace - and instead you get the generic LocalError. I've been getting around it using brute force, adding debug statements variously around my code to try to isolate where the exception is thrown, and what the problem is. I would suggest running the different components of the code in isolation, to try to figure out what is going wrong, and where. |
well, this is not my code, this is the google sample code... |
Right - but it's still helpful to know where exactly the problem is occurring. For example, perhaps there's a permissions problem accessing the audio interface, or perhaps the pyAudio library doesn't have support for some device or platform, or perhaps there's some assumption I made when writing the sample that isn't valid on your setup. Whatever it is, we need to figure out where the problem is occurring and why, in order to start to try to fix it. |
@heroddaji got it working with some exception handling and modifying RATE and CHUNKS. check if it works for you too: https://gist.github.com/httpdss/c116b4b3a056e350d9f4ed4ae6325270 |
Thank you @httpdss . I follow your code and test on my rpi2 again. while not stop_audio.is_set():
print i;
try:
data = audio_stream.read(chunk)
if not data:
raise StopIteration()
# Subsequent requests can all just have the content
audio_request = cloud_speech.AudioRequest(content=data)
yield cloud_speech.RecognizeRequest(
audio_request=audio_request)
i += 1
except Exception as inst:
print type(inst)
print type(inst.args)
print inst |
ok, so I got the code to work on my mac machine (still has input overflowed randomly) on the rpi, i still have the input overflowed, it might the rpi limitation, i'm not sure. If you have code using callback, pls let me know as well |
@heroddaji dont have any callback example. one thing i forgot to mention is that playing arround with rate, channels and chunks was also part of the solution cuz i was getting a message that i wasnt streaming the data in realtime or something like that. check which is your mic rate using arecord and change the params based on that info. |
Thx, any way some time it works, some time it shows error, and on rpi it seems the combination of So to recap: For other: Thx for all the help |
Source-Link: googleapis/synthtool@1b71c10 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:00c9d764fd1cd56265f12a5ef4b99a0c9e87cf261018099141e2ca5158890416 Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
* chore(deps): update all dependencies * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * revert Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <[email protected]>
Hello,
I am testing the new google cloud speech api on raspberry-pi2, I have access to the beta and have the json key ready.
I can run the file speech_rest.py and get the result, like this:
But for the streaming version (we need this for our product), I encountered error.
I follow all the requirement by install package gcloud, grpcio, PyAudio, grpc-google-cloud-speech. All of the packages are installed successfully. But when I run the example:
I got this error:
I don't know how to solve this, I would appreciate some help here.
The text was updated successfully, but these errors were encountered: