-
Notifications
You must be signed in to change notification settings - Fork 9
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
update from python2 to python3 #18
Comments
That would be great! I tried a couple of times and got stuck, then had to put it aside. If you get stuck I will do my best to help. |
Output as of https://github.com/andy5995/blather/commit/1399dd01bef080da8cbd4fc9b0530dc0caec0090 https://gist.github.com/andy5995/83dbfd2fcf31898cd42c2b7129991ab1 Errors out at L235 (gist above) with the msg
Some info about that error at
I'm on Debian stretch (9). I installed I don't know how to proceed from that yet. Any ideas? |
Feel free to check out the changes I've made in the update_gstreamer branch. I also included a README_Ubuntu.md file so that you can install the right applications and plugins. This file will eventually be merged into the README if the instructions work well. I should point out that "vader" is no longer a plugin. The gstreamer developers have merged the voice activity detection into the decoder.
https://cmusphinx.github.io/wiki/gstreamer/ The changes I made above are a simple hack to get the code working with Python 2.7 on Ubuntu. Your Python 3 code is more in line with what we want, I believe. |
Great! I'll keep going with the Python 3 code then. Should I use this method then?
As opposed to changes like I made in my PR?
|
If we're going with pure Python 3 code then I would prefer to not alias variables. It's easier, in my opinion, to understand the code when you don't use aliases, although it's easier to implement as one line rather than change every instance of |
I'll keep going with python3. That seems to make the most sense. I have no idea how to debug the segfault unfortunately. I did run And that's as of 1adf9e4 |
I updated the gist. I was using
instead of |
I've found that if you comment out the |
Well I found out that pocketsphinx on my system is causing the segmentation fault. I'm not sure how to fix it though. This works: This doesn't work: |
The segfault seems to be fixed I commented out this line
Current output: https://gist.github.com/andy5995/0ec1dc24e02a3131b686bb02feb7df2b |
Got a little further (https://github.com/andy5995/blather/commit/013cff6acd34b1472e125a860dcc9f6e5d99a5fe). Blather with no args still gives a segfault, but with -i g/q it's problems are a result of Gtk and Qt outdatedness and does not segfault. I was focusing on -g. |
I'm not sure when or if I'll be able to finish this. I have less experience with Gtk, pyGtk, than I do with python. Makes porting it quite a bit more challenging. I don't mind a challenge, but it may be wise to give someone else the opportunity to finish this. If you're ok, with that, I thought perhaps it would be a good idea to issue a release of the current master branch, merge in my changes, then create separate tickets for "porting to Qt", "porting to Gtk". Might be easier to review in the long-run actually. Before I forget again, I have a question: It's my understanding that people can only be assigned to tickets on GitHub if they are project collaborators or members of an organization that a project is under. How did you assign this ticket to me? |
Thanks for all your help. I think we both got to the same problem and it lies in pocketsphinx IMO. Some option is causing a segfault but I don't know what's wrong. I'll create a new branch for both of our changes with open issues and descriptions for help wanted. I've also been considering a fork of this project using NodeJS or electron (or both). There may be available packages that support this functionality. Regarding assigning issues, I think that since you made a comment on the issue first you became an available contributor. I haven't ever tried to assign an issue to a person who had not already commented or contributed to a project. |
Hmmm... maybe there is something I'm not understanding. (Although I see I wasn't too clear in my last progress update.) Isn't it significant that we got past the first segfault? When I removed this line Blather got a lot further than before. then it fails when while running GtkUI.py, with this output
What I tried today was removing my ~/.config/blather/sentences.corpus file and running `Blather.py' with no args. It generated a new sentences.corpus file before it segfaulted. But when I run Blather with Have you tested the patch yet since I removed |
I'm researching the speech_recognition library instead of using pocketsphinx directly through gst. It seems to work perfectly in once installed using https://github.com/Uberi/speech_recognition/blob/master/reference/pocketsphinx.rst |
Well the good news is I got SpeechRecognition working. I still have to refactor the code in Recognizer to work with it, but pocketsphinx is working now and it's recognizing words. I can only spend a couple hours at a time on this, so it might be a few more days before I have a working version again. Below is the basic code (very rough), hope this helps. Also, don't forget to install PocketSphinx using pip. That seems to help. Here's my rough installation instructions. I'll be removing unnecessary things later. Installation:
Code (only new or changed code is included, everything else is the same):
|
Here's the latest code. Please feel free to use the example in Recognizer.py for your development. https://github.com/ajbogh/blather/pull/22/files Oh, apparently the dictionary file and language files are unnecessary now. Without them pocketsphinx may be more error prone, but I haven't figured out how to configure it to use them. |
I saw this request by @piegamesde in #17
I'd be interested in starting to update the py files to be compatible with python3. If I get stuck, can I do a PR and get some help along the way?
The text was updated successfully, but these errors were encountered: