Closed Psychokiller1888 closed 1 year ago
I have the same issue on Raspberry Pi with the text-to-speech package, google-cloud-texttospeech==2.3.0
. I get this error:
File "/usr/src/app/speech_synthesis.py", line 9, in <module>
from google.cloud import texttospeech
File "/usr/local/lib/python3.7/dist-packages/google/cloud/texttospeech/__init__.py", line 18, in <module>
from google.cloud.texttospeech_v1.services.text_to_speech.async_client import (
File "/usr/local/lib/python3.7/dist-packages/google/cloud/texttospeech_v1/__init__.py", line 18, in <module>
from .services.text_to_speech import TextToSpeechClient
File "/usr/local/lib/python3.7/dist-packages/google/cloud/texttospeech_v1/services/text_to_speech/__init__.py", line 18, in <module>
from .client import TextToSpeechClient
File "/usr/local/lib/python3.7/dist-packages/google/cloud/texttospeech_v1/services/text_to_speech/client.py", line 27, in <module>
from google.api_core import gapic_v1 # type: ignore
File "/usr/local/lib/python3.7/dist-packages/google/api_core/gapic_v1/__init__.py", line 18, in <module>
from google.api_core.gapic_v1 import config
File "/usr/local/lib/python3.7/dist-packages/google/api_core/gapic_v1/config.py", line 23, in <module>
import grpc
File "/usr/local/lib/python3.7/dist-packages/grpc/__init__.py", line 22, in <module>
from grpc import _compression
File "/usr/local/lib/python3.7/dist-packages/grpc/_compression.py", line 15, in <module>
from grpc._cython import cygrpc
ImportError: /lib/arm-linux-gnueabihf/libc.so.6: version `GLIBC_2.33' not found (required by /usr/local/lib/python3.7/dist-packages/grpc/_cython/cygrpc.cpython-37m-arm-linux-gnueabihf.so)
When I replace google-cloud-texttospeech
with google-cloud-speech
, I get an error because I did not install Rust (and when I install it, I get another error because cargo
is missing).
Yep, you have to install Rust as well, same here. Raspi 4? I had to migrate to Microsoft Azure, as there's no way my project can use Google services, many are broken on raspberry distros
I have Raspberry Pi Model 3 B+. I tried installing Rust and gave up in the first hell of dependency hell (when I found I needed cargo
as well). If I install Rust and Cargo, and all the other dependencies, do you think it would work? Yes, Azure is probably more future-proof, I will probably take the plunge and migrate too.
No it won't, I'm just amazed it's also the case on pi3b+, so that means @google broke everything by addind glibc 2.33 (pi4 with buster ships with 2.28) as minimum dependency. This means, no more google ASR and TTS on any raspberry pi..... Re MS Azure, yes and no, you can't use their SDK on your 3b+ as it requires 64 bits OS, so on a pi 4, with latest OS you could. You can use their REST Api, but it doesn't support intermediate results and no utterance end detect..... I'm testing whatever I can, for my ProjectAlice, and Google was at least one of the good ASR, with speed, precision, intermediate and end detection. I implemented Azure, going to give a shot at Amazon and IBM also, but I know for a fact Amazon doesn't support streaming.......
At the moment I only need text-to-speech, not speech-to-text and utterance end detect, so I'll give Amazon a shot. Thanks for the tip!
Oh, if you only need TTS, Amazon Polly is awesome! Just curious for this bug report, are you running bullseye on your pi or buster?
Yes, just checked, and they don't seem to have neural voices in Portuguese. I'll check the pros and cons of these providers. And maybe Google also has a REST API, too.
I'm running buster on the Pi 3B+.
Yes they do :-)
Is there any news @aribray or should all Raspberry Pi users migrate away from Google and start using other services that work such as Amazon or Azure?
I succeeded in moving to the REST API. I used code from a lot of different places, as the documentation on this use case is flimsy, and I post it here in case it can help someone:
import base64
import requests
text = "Hello world!"
language = "en-GB"
voice = "en-GB-Wavenet-A"
filepath = "/tmp/audio.wav"
def synthesize(text, language, voice, filepath):
doc = {
"input": {
"text": text,
},
"voice": {
"languageCode": language,
"name": voice_name
},
"audioConfig": {
"audioEncoding": "LINEAR16",
"pitch": "0.00",
"speakingRate": "1.00"
}
}
r = requests.post("https://texttospeech.googleapis.com/v1beta1/text:synthesize?key="+GOOGLE_API_KEY, json=doc)
content = json.loads(r.content.decode("ascii"))
binary = base64.b64decode(content["audioContent"])
# The response's audio_content is binary, and base-64 encoded.
# Convert with base-64.
with open(filepath, 'wb') as out:
# Write the response to the output file.
out.write(binary)
log('Audio content written to file "%s".' % filepath)
synthesize(text, language, voice, filepath)
This problem is not specific to client library, but rather a problem with gRPC. I recommend you open bug with gRPC, if this is still an issue.
Seems like others resolved it by using --no-binary
option in pip install
-- https://stackoverflow.com/questions/71054519/glibc-2-33-not-found-in-raspberry-pi-python
Thanks for stopping by to let us know something could be better!
PLEASE READ: If you have a support contract with Google, please create an issue in the support console instead of filing on GitHub. This will ensure a timely response.
Please run down the following list and make sure you've tried the usual "quick fixes":
If you are still having issues, please be sure to include as much information as possible:
Environment details
google-cloud-speech
version:pip show google-cloud-speech
2.12.0Steps to reproduce
Code example
Stack trace
Making sure to follow these steps will guarantee the quickest resolution possible.
Thanks!