-
Notifications
You must be signed in to change notification settings - Fork 129
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
Unable to output audio on Arch Linux #1
Comments
What was the command you ran to get to this return? |
I don't think ALSA is your problem. In the directory stephanie-va-master/Stephanie/TextManager, there's a file called speaker.py. In there on line 15, it says os.startfile(self.speak_result). The problem with that is os.startfile is windows only. I replaced that line with os.system("xdg-open " + self.speak_result) and everything started working. |
@highmindedlowlife Is there an os independant option? |
@highmindedlowlife I tried this, still getting the same errors on startup. This seems to be very broken on Arch. I'll try using KDE Plasma instead of i3, as I think it is trying to get some OS variables that don't exist in i3. |
There is pygame, which can be set in config.ini file under [TTS] tts_player = pygame, but it is quite buggy, and I am afraid but I don't have a linux based system with me right now, if anyone could send me pull request that can accommodate linux systems, then that'd be really helpful. |
It's pretty easy to spin up a Linux VM. I don't have a huge amount of experience with python, but I'll do some digging. |
There is a pretty easy way but it's basically just a function with an if statement inside. Should I make a pull request? |
@JoshKellyVFX
I'm not sure that there is but both could be wrapped in try catch blocks so that if os.startfile fails, it can try os.system("xdg-open"). It could also just use sys.platform to see what it's running on and use the right one that way. Unfortunately I'm an amateur pythonista so who knows.
|
@JoshKellyVFX
Yes please, put up try and catch block as well! |
Can anyone try |
Works on linux |
Just tried it and it doesn't work. os.system needs a specific command to run so in this case, it needs the name of the media player you want to use, e.g., os.system("mplayer " + self.speak_result) or os.system("xdg-open " + self.speak_result). It's subtly different from os.startfile which doesn't need the name of the application itself, just the mp3 to be played. |
As @highmindedlowlife mentioned, I think this is the best solution, it's working for me.
if sys.platform == "win32":
os.startfile(self.speak_result)
else:
os.system("xdg-open " + self.speak_result) |
Hmm, so what's your thoughts on something like this:
|
@SlapBot it seems a bit over the top, the fix @highmindedlowlife mentioned is probably best |
Also @SlapBot, any particular reason for the aggressive error messages? |
Sorry for that will fix this, but the above commit doesn't take win64 as well as any other irregularities, I think nested try approach can be better? I can remove |
@SlapBot Try statements bring iffy code, we can add a x86-64 check in the if statement |
@JoshKellyVFX We don't need a check, as if the system is running windows it will return win32 to sys.platform, I have a 64bit version of python, and I got win32. |
@J-tt I thought so, I just couldn't remember if that was the case. So the pull request is good |
@JoshKellyVFX |
@J-tt Oh crap instead of merging I did it myself, sorry man, I am still kind of new with github! |
All good, just hit merge on the pull :) |
Fix #1, non OS dependant audio output
Running Arch Linux (64bit). Python 3.6.1 is installed.
ALSA Is installed (info)
The text was updated successfully, but these errors were encountered: