Soundboard made in Python for use on Linux
GPL-3.0 License
I couldn't find any soundboards compatible with Linux that fit my standards, so I made my own that uses the numpad.
PyYaml
for easy reading and writing of configuration file(s).TKInter
to create the interface. On Ubuntu, do sudo apt install python3-tk
to install it.PyOpenAL
to play sounds.PyOgg
to allow PyOpenAL
to play .ogg
files.Two soft requirements would be pavucontrol
(PulseAudio Volume Control, to control where output is redirected) and the
sister project to this, the
Pulseaudio-Loopback-Tool. (to create loopbacks,
null sinks, and remapped sources)
Install pavucontrol
on Ubuntu by doing sudo apt install pavucontrol
Install Pulseaudio-Loopback-Tool by clicking the
link and downloading that project.
Clean way: follow steps normally. Dirty way: Do step 1, skip to step 4, and follow steps normally from then.
python3 -m venv venv
to make a Virtual Environment.source venv/bin/activate
pip3 install -r requirements.txt
pip3 install wheel && pip3 install --force-reinstall -r requirements.txt
python3 start.py
or ./start.py
The "Clean" installation keeps the requirements of this project away from your local Python 3 installation, making sure
that these requirements don't interfere with the requirements of your other Python programs. The cost is that more work
has to be done to start up the project, requiring you to source venv/bin/activate
before starting the soundboard up.
The "Dirty" installation has the requirements installed into your local Python 3 installation, possibly interfering with
other Python programs. The upside is that it is easier to start the project, and double clicking start.py
to start the
soundboard is easily possible.
Small list of "How to do this common thing", if you either have a question or found something that you think belongs here, make an issue for it and I'll probably add it!
Three different ways, actually:
Top middle of the soundboard is a pulldown. In the pulldown is all the input devices the soundboard found in
/dev/input/by-id
. Select the keyboard that you want the soundboard to listen to, press the "Use Event File" button,
and the numpad on the keyboard should now trigger the soundboard buttons.
Ten not enough for you? Edit soundboard_config.yaml
with any text editor and change max_sounds
from 10 to whatever
number you want. Increasing this number will not decrease performance, it's playing many sounds at once that will.
Using pavucontrol
you can set the soundboard to output to any available sink, and sinks can be created by PALT.
(PulseAudio-Looback-Tool)
Ideally, you'd have the following basic setup:
pavucontrol
: Set your recording application to use "Output_Mic"If you haven't run the soundboard yet, run it once to create the config file.
Edit soundboard_config.yaml
with any text editor and change "Sound Files" to the path of the desired root folder,
either relative to where you are executing start.py
or absolute.
Simply add more folders in the root folder! It's alphabetically sorted in the list, so adding 1, 2, 3, etc. to the beginning of the folder name will force it to go in that order. There is (theoretically) no limit to how many different folders you can have.
Put audio files into into the sub-folders. Just like the folders, it's alphabetically sorted in the list. Again, there is (theoretically) no limit to how many different audio files you can have.
Rename the sound file to have a number and a space at the beginning of the filename, with the number being what
number button you want it mapped to. If you want a sound called hey.ogg
mapped to the 3 button, rename it to
3 hey.ogg
Renaming it to 3hey.ogg
or 3_hey.ogg
will not work, the space is required.
If multiple files start with the same number, the soundboard will pick the first one it finds.
Well, if its not listed below here, submit an issue for it and it will get fixed as soon as possible!
pavucontrol
!It's a configuration setting in OpenAL, edit the config file and change allow-moves
to true.
For example:
sudo nano /etc/openal/alsoft.conf
allow-m
, press enter.#allow-moves = false
and change it to allow-moves = true
The change should take effect immediately, but may require a restart of the soundboard.
If on Ubuntu, do sudo apt install python3-tk
to get TKinter for Python3. Else, use pip to install it or find
instructions for your distribution.
Rejected file <file path here>
!As far as I know, OpenAL supports .wav
, but because of pyogg
it also supports .ogg
files. The soundboard will
reject all non-.wav
/.ogg
files it finds. If OpenAL can run more than those files, make an issue for it and I'll
update it.
If you are impatient, edit SOUND_FILE_EXTENSIONS
in soundboard/storage_module/storage_manager.py
and add
the file format there to make it show up.
If you have any questions, concerns, ideas, etc, make an issue for it! I'm all up for recommendations on how to make this better.