A simple program for avid listeners of audio content.
Because sometimes you just want to listen to the audiobook/podcast/youtube video without also rushing to take notes. This allows you to quickly mark the passages that you deemed important and continue listening.
Knowing well that you'll come back and review your saved notes later. The Ai won't be perfect.
Oh and also we want all this magic to happen without us needing an internet connection (unless you use notion, readwise, or other things). Transcription to a local file works without internet.
A few things to keep in mind:
- It only runs on Windows for the time being.
- You need to figure out which device the recording should happen through on your own.
- You need to figure out your own Notion (and other API) tokens.
With that in mind, here's how you get it going.
git clone https://github.com/0x20F/listen-wise.git
cd listen-wise
Make sure you have poetry installed
poetry install
Also make sure you install ffmpeg
since Whisper needs it:
# on Ubuntu or Debian
sudo apt update && sudo apt install ffmpeg
# on Arch Linux
sudo pacman -S ffmpeg
# on MacOS using Homebrew (https://brew.sh/)
brew install ffmpeg
# on Windows using Chocolatey (https://chocolatey.org/)
choco install ffmpeg
# on Windows using Scoop (https://scoop.sh/)
scoop install ffmpeg
Copy the example environment file
(powershell)
Copy .env.example .env
(bash)
cp .env.example .env
And update the contents of the file to suit your needs. Remove any variables that you don't need.
If you don't want anything to do with notion, remove the whole notion section, and so on.
The required variables are
HIGHLIGHT_LENGTH_IN_SECONDS
,INPUT_DEVICE_INDEX
andWHISPER_SIZE
If you don't know what index your input device is at you can run the program with the
--list-devices
parameter to get a list of all devices and their indexes.
Once configured, you can run the entire program with the following:
poetry run python code/main.py
and you should be greeted with some information about all the modules that are being set up based on your configuration file. Something like this:
[transcribe] Initializing Whisper neural net with size small
[notion] Initializing Notion client. Tokens were provided!
[local-storage] Highlights will not be saved locally.
[~] Recorder started
...
Note: On the first run, it might look like it's stuck on initializing the whisper neural net. That's because it's actually downloading the model that you asked for, it's purely dependent on your internet connection.
You control the program through hotkeys (web interface might come later).
Note: Do not press the keys at the same time. Press one, release it; press the second one, release it. If all required keys are pressed in order the command will be executed.
Ctrl + Alt + s
This will get the last specified amount of seconds, save it to an audio file, and queue it for transcription. The logs should tell you what's going on.
Ctrl + Alt + c
The program will always keep just enough recorded data to always have the amount of seconds that you asked for in a highlight, nothing more. If you'd like to force a wipe of that data, this is the command for you.