OpenSound is an open-source project that can allow anyone with a Raspberry PI (3+) to convert their PI into a smart speaker. The entire speaker focuses on privacy and can play music on YouTube without ads or any trackers.
NOTE: This project isnt perfect and just a project I did for school, please don't expect this to be a world class, production smart speaker yet. This project might get better if I ever get motivated to work on it outside of school.
- Searching and playing music on YouTube.
- Simple and efficient interface
- Raspberry PI friendly system
- Favouriting Music
- A Functioning Raspberry PI or Windows Computer
- A Speaker (Optional but you probably need it)
- Internet Connectivity
- A device that can SSH onto a Raspberry PI (Optional)
- Python 3.12 or above installed on device you wish to install on (Should be preinstalled on Raspberry PI, make sure for Windows that Python is added to PATH in order to make things easier)
Installing on windows is relatively easy. First install the project, install the modules and lastly install FFMPEG.
pip install -r "<PATH TO Requirements.txt FILE>"Next install ffmpeg from here, extract it and place it somewhere easy to access.
Then go to Editing the configuration to configurate the project.
Finally run OpenSound.py to start.
Installing on Raspberry PI will take longer. The recommended installation is Raspberry Pi OS Lite.
First connect to your Raspberry Pi using the method of your choice, you can either connect to it via SSH or connect it to a display.
Next you will need to do the following installations:
Start with: sudo apt update
Text to Speech Engine: sudo apt install espeak-ng
XVFB (Required for audio to work): sudo apt install xvfb
Create a folder in the root directory called Opensound
Put all the content of this project into that folder and configure the InternalSettings.json (Go to "Editing the configuration")
Next get the file opensound.service which is in the Opensound folder and move it to /etc/systemd/system
Next you should enable the autostart and your speaker should autoboot to the project:
| Action | Command |
|---|---|
| Start Service | sudo systemctl start opensound.service |
| Stop Service | sudo systemctl stop opensound.service |
| Restart Service | sudo systemctl restart opensound.service |
| Enable Autostart | sudo systemctl disable opensound.service |
| Check Status | sudo systemctl status opensound.service |
| Read logs | journalctl -u opensound.service -f |
Both before starting the project you will need to first make changes to the InternalSettings.json file which is located in OpenSound/Data/InternalSettings.json
| Configuration | Description |
|---|---|
| MusicCacheLocation | This is where the music is stored, set this to any empty folder |
| FFMpegConverterLocation | This is only required for Windows installation set this to the ffmpeg-x.x.x-essentials_build/ffmpeg-x.x.x-essentials_build/bin/ffmpeg.exe |
| IsPI | Set this to true if you are installing on Raspberry PI |
| TTSEnabled | Set this to true if you want Text to Speech to announce any action you do such as play a song or favourite something |
If you set things up properly and run the project you will hear your device announce the IP Address of your speaker. Simply open a browser and type in the ip. It should look like this 192.168.53:5000 it might look different but make sure you type in an ip along side the port being 5000.
To play music just press the button thats says Music and then you can search for songs. or go to <CURRENTURL>/Music.