-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Cleanup client.speaker and add additional tts speakers #155
Conversation
@@ -56,7 +195,7 @@ def newSpeaker(): | |||
ValueError if no speaker implementation is supported on this platform | |||
""" | |||
|
|||
for cls in [eSpeakSpeaker, saySpeaker]: | |||
for cls in [googleSpeaker, picoSpeaker, eSpeakSpeaker, saySpeaker]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to add a profile option to configure the speaker?
OK. I'll do that tomorrow. |
Error message, IMO. I don't think that will happen very often and, when it does, you probably want to know that the speaker failed. |
Parsing |
Done. |
Can I merge this in? |
I will test this shortly. Hopefully we can merge it in today. |
On the Pi, for whatever reason, the output is incredibly choppy. Must be something to do with using |
""" | ||
import os | ||
import platform | ||
import re | ||
import sys | ||
import json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused import.
I've tried a bunch of different chunk sizes (12000, 44100) to no avail. |
Have You tried the example from documentation? |
The PyAudio example code runs without problems. I've added testing code to This also works fine on my Raspberry Pi (running ArchLinuxARM). Can you confirm that? |
If that works for you, too, the problem could be caused by:
If the latter is true, we should create a dedicated audio class as a wrapper for pyaudio (which is probably a good idea anyway, so that we can easily switch from pyaudio to something else, if we need to.) |
Thanks @Holzhaus. Will test again tonight and look into a few of these suggestions. |
I still get the same poor audio quality. I tried flushing the file as well, but to no avail. Not nearly familiar enough with the Pi audio settings to figure out what's wrong with my config--I'm using the primary disk image that we ship. I suspect that it's a buffering problem, perhaps related to the SD card. Is there a reason why we need to do this |
@crm416 What tests did you run exactly? Please do these test in that order to isolate the problem. 1. ALSA configDoes playing a wave file with aplay work without any other arguments (i.e.
You may need to edit the card numbers. You can look them up by using 2. PyAudio InitDid you execute the 3. Slow SD cardReplace lines 52-55 with this: frame_num = f.getnframes()
data = f.readframes(frame_num)
# The whole file has now been read into memory
stream.write(data) If that works fine, the problem is probably a slow SD card. |
@crm416
The original code was also using the
Anyway, we can't rely on Also, we want to use platform-independent output, so using plain And last but not least: We need code to play wave files anyway, e.g. the beeps in |
If we fail to fix the problem, I can live with changing the |
Okay. When I do run
I do not get these errors when I run |
This is kind of normal, as PyAudio likes to spam stderr. Ill revert the play nethod to aplay for now. |
1f2e8a0
to
be241c8
Compare
… playback see jasperproject#188 for more info
8d4c62a
to
bbc688e
Compare
I rebased to latest upstream version to make this mergeable again. |
If nobody has comments or finds a problem, I'll merge this tomorrow. |
Cleanup client.speaker and add additional tts speakers
This is the second chunk of split up pull request #124.
I've added svox-pico-tts and google-tts. Pico TTS is the old Google OpenSource TTS Engine. Try it, it's much better than espeak!
Also, get rid of aplay and use pyaudio instead (pyaudio is a dependency anyway, so why rely on an external tool that might not be installed)