reddit / emacs
Orion: Voice to Org-mode bot
lxsameer · 2022-04-18 18:01
I use org-mode to manage my life (like any sane person would do :P) and also I use Feynman technique (it is super useful, look it up if you're interested) to learn new stuff or keep up with my chain of thoughts. Originally the Feynman technique involved with writing your thoughts, questions that you have and things that you learn in a notebook and review them later. Using a notebook is really inefficient to me coz it's hard for me to carry around one to take notes. I used to leave voice messages to myself via my phone and later on manually transcribe them and move them to an org file to organize them.
Finally I spend a bit of time and created a bot that converts telegram (just because it was easier at the moment. Otherwise it would be easy enough to create backends for the bot to use matrix or whatever) voice messages to org-mode entries and store them in an org-file. It's trainable as well. So one can train it to be more precise. Therefore the more you use it the more precise it can get.It still is rough around the edges and I need to feature tune it, but it is usable and I use it all the time. I thought other people might have the same needs as I have so it might worth sharing.
Heads up though, the bot is in golang (coz I wanted to finish it up fast, but I have plans to create a native Emacs module for it to replace the golang implementation)
The repository is at: [https://devheroes.codes/lxsameer/Orion](https://devheroes.codes/lxsameer/Orion)
Also it comes with a text to speech engine (Rigel dir in the same repo) as well that spins up a tcp server and reads out anything that it receives over the socket. This one is trainable as well. Since I use Emacs as my window manager (thank you folks who made EXWM) I wrote a simple client that reads any text that i want in any program for me. Refer to the read me for more info and you can find the elisp client at: [https://devheroes.codes/FG42/FG42/src/branch/master/core/cubes/rigel/core.el](https://devheroes.codes/FG42/FG42/src/branch/master/core/cubes/rigel/core.el)
Hope you find it useful and looking forward to your feedback :)
Adham327 · 2022-04-18 18:25
This is awesome!
I've been thinking about telegram <-> Emacs bots for a while now, one would be a capture bot that takes messages and appends them to an org file.
lxsameer · 2022-04-18 18:26
Nice, it would be so easy to add this feature to this one as well. that would be super useful
thevoidzero · 2022-04-18 21:25
I don't use voice messages as I can't even talk properly to people (too introverted). But I found that text-to-speech part interesting, I've been using festival and thought it works, it doesn't feel natural and is a little slow, does Rigel perform better? If you've tried both I'd appreciate your opinion.
lxsameer · 2022-04-18 21:31
Interesting. Sure i'll give it a try and let you know
thevoidzero · 2022-04-18 21:52
Thanks, I think the slow part could be overcome if we used (or maybe it has the option idk) sockets and then have it initialize only one.
Right now I have a `say` script with following content:
#!/usr/bin/env bash
echo "$@" | festival --tts
which pipes anything I write after `say` to festival tts system and it'll speak it out. But festival has to initialize everytime. You can initialize it as a inferior process in emacs and have it speak out the sentence, I've used it that way too as it comes with `festival.el` when you install it. But I'm thinking of more global solution that I could use anywhere. (considering you use EXWM you might not need it if you have festival.el)
lxsameer · 2022-04-18 22:08
I just tried it. Festival seems very robatic and rigid, but Rigel (i'm using Coqui as the backend) is very human like. Since the voice is AI generated sometimes it might sound funny but overall is much better and on top of that you can train it
thevoidzero · 2022-04-19 01:00
Ok I'll look into it. There are many different options for festival but I do agree it sounds robotic as it's based on phonics from dictionary or something like that (I'm not expert in tts). I think I read somewhere you can calibrate the pitch and things to make it sound different but it'll probably be still robotic.
Maverobot · 2022-04-20 15:49
Can you please recommend resources (books, websites etc) regarding Feynman technique?
lxsameer · 2022-04-20 15:51
I learned the technique by reading his bio and watching/reading his interviews, but I'll look it up and post the closest thing I find
lxsameer · 2022-04-21 09:25
This one seems close: [https://e-student.org/feynman-technique/#what-is-the-feynman-technique](https://e-student.org/feynman-technique/#what-is-the-feynman-technique)
But in general Feynman technique is more than that. He used to carry a notepad and write questions that popped in his head and he didn't know the answer to them. Also he used to write down his observations about the world.
Maverobot · 2022-05-02 00:24
Sorry for the late reply. Thank you so much for your information!
thevoidzero · 2022-05-02 21:19
Sorry for late reply, finally had time to try it out but `Coqui` seems to be for Ubuntu, and not only the install instruction but also the makefile contents are for Ubuntu, I couldn't install it through pip or through github for the same reason. So unless someone makes it available for other distro, or at least make a generalized makefile or give better instructions I don't think I want to go through the trouble of figuring out all the requirements for it to build it myself.
lxsameer · 2022-05-02 21:47
Hey friend, I'm using Gentoo and I installed the components through pip. If you have a look at the 'builder' script in the repo you can find the instructions to install it. let me know if you need help with it.
thevoidzero · 2022-05-02 22:45
The makefile has this line so I thought it wasn't probably made to work on other distro.
system-deps: ## install linux system deps
sudo apt-get install -y libsndfile1-dev
Anyway if you made it in gentoo then I should probably be able to make it in arch. What I did was `pip install TTS` which says there is no packages matching it, which I'd assume is because there is no built package for arch in pypi. (or my pip is broken?)
After that I tried directly from github with `pip install <github link>` and that one initially cloned the repo but got stuck in installing for a really long time, then failed saying some error on building numpy, which I already have installed so idk why it installed again.
I then tried to manually clone the repo and build it and gave up after seeing that `apt-get`, I already have `libsndfile` package installed but I have no idea if it'll work same as the `libsndfile1-dev` in that makefile or not. If it works then pip should have worked as that seemed like the only requirement I could find.
All of these problems combined with the fact that it's not in the list of applications in archwiki (https://wiki.archlinux.org/title/List_of_applications/Other#Speech_synthesizers) made me think maybe it wasn't supported well enough, or isn't used by a lot of people.
So after giving up on this, I am currently trying out `flite` which seems to be lighter version of `festival` and now my problem with festival being slow will probably be gone, I still need to figure out about that mechanical voice.