-
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
Platform independent audio output. Stop hardcoding /home/jasper. #100
Conversation
The tests all pass on my Mac (10.9.3), but Japser is not recognizing any audio input once I boot it up. Did you do anything special to configure your microphone @astahlman? |
Hmmm, weird. No, the microphone didn't need any extra set up for me. (10.7.5) |
@@ -12,6 +16,10 @@ | |||
|
|||
import g2p | |||
|
|||
class ListWhereOrderDoesNotMatter(list): |
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.
Nit: can this be named UnorderedList
?
This is good stuff. I still need to test it out, but I've left some comments above. Hopefully we're not too far away from a merge here. Thanks! |
Thanks. All good suggestions @crm416 - see the latest diff. |
Thanks for the quick turnaround. @shbhrsaha and I will try to test this before the end of the weekend. |
Speaking of Platform-Independance, I have almost everything except audio input (thus requiring the use of local_mic) working on the Pythonista iOS app, but my TTS is a female voice named Jasper. Theoretically I could use an online TTS engine, but it would increase latency dramatically. If anyone knows about audio input on Pythonista or better iOS TTS it would be greatly appreciated. |
This is great work, @astahlman . Just one thing: on my Pi, your implementation works if I run I believe the problem lies in the bash conditional statements in Unfortunately I don't have a monitor so can't provide more cron output, and my limited Bash/cron knowledge can't offer a specific solution. Can you confirm that your implementation works on the Pi as it boots, in addition to running |
Good catch, @shbhrsaha. I disabled the automatic startup on my Pi so I didn't notice during testing. See the latest commit - I added a shebang at the beginning of the script to designate bash as the interpreter. Jasper now starts up successfully on reboot of the Pi. |
Excellent. I'll get a chance to test this out in the next few days and will report back and merge this in if it's all good! |
I did this to my fork as well. I use $HOME for the system calls and in the shell scripts. |
Platform independent audio output. Stop hardcoding /home/jasper.
Great, thanks! Merged into master and your contribution acknowledged in the README |
Summary
This commit includes changes to support platform independence. This implementation detects the current platform and chooses an appropriate system command for audio output. It also does not rely on a directory structure rooted at
/home/pi
Changes
$JASPER_HOME
as base directory instead of assuming that root is/home/pi
. This change is backwards-compatible, as the boot script will export$JASPER_HOME=/home/pi
if this directory exists. On OS X, I set this environment variable in my ~/.zshrc.espeak
, or OS X, which uses the built-insay
command.boot/test.py
to validate the list of vocabulary words passed to g2p without respect to ordering.Testing
boot/test.py
andclient/test.py
pass on the RPi.Notes
I wanted to minimize the scope of the changes included in this pull request, so I didn't mess with the directory structure. I was uneasy, however, appending
client/
to the path in order to import the speaker module from insideboot/boot.py
. What do others think should be the right approach here?