python_audio_server v1.0.0
Version 1.0.0 Reaches!
Pretty much completed, and most likely, no more big updates will be made to this code base in the future. It worked!
Backend
TTL Triggers
On the backend, the biggest update is that we can now send out a TTL pulse when the audio starts or stops playing. This is extremely useful when you want to trigger some other system when the audio plays. The settings for the TTL pulse (target COM device, number of pulses to send, the length of the pulse, etc.) can be customized via the .env file at the project's top level. If you cannot see the .env file, try doing Ctrl + H on both Windows and Linux to show hidden files. If there is nothing, create one yourself!
To figure out the available COM port for sending the TTL pulse, a convenient command ls is available:
./audio_server/audio_server ls # Linux release
./audio_server.exe ls # Windows release
python main.py ls # Python3The Other Things
The server can do tons of things now that I figure we can stop adding more stuff. Playing audio files, playing playlists, both sequentially or gaplessly, saving playlists as gapless audio files, generating tones and sweeps from parameters and playing them on the fly, playing random audio files, etc etc you get the point!
If there is ever a need to add new features, they will be added as minor version releases. Version 2.0 will only be released if there is any breaking change, which seems unlikely.
Frontend
Did I mention that we have a web GUI now? The root route / is now dedicated to the GUI, and the old documentation is moved to /docs. All the basic things you might be doing regularly can be accessed directly through the GUI. Everything is handwritten in plain old HTML, CSS, and JS. The GUI is tested for variable screen size and mobile compatibility and made sure to work and display properly on Chrome version 59.0+. Machines frozen in time from 2017 should be able to use this right.
Installation
To get the app installed, simply download the packaged ZIP file for your system. The code is bundled with PyInstaller and can be run directly without the need to install Python.
If you want to run the app directly with Python, simply do a git clone, then make a quick virtual environment with python -m venv venv, activate said environment, then pip install -r requirements.txt. Note that the requirement files are slightly different between Windows and Linux.
Lastly, check the .env file for any settings you might want to change, and start the app!
./audio_server/audio_server # using the packaged Linux executable
./audio_server.exe # or double-click this .exe file when using the Windows executable
python main.py # run with PythonTroubleshooting
- Note that the working directory (where the audio files and playlists should be added) is different for the Windows and Linux releases.
- If there is a permission issue on Linux, run
chmod a+x -R ./audio_serverto give yourself the permission.