Skip to content

This is a backend of Lunar Music project on Raspberry Pi to play music according to command sent from the Lunar.Music.Web.

License

Notifications You must be signed in to change notification settings

goh-chunlin/Lunar.Music.RaspberryPi

Repository files navigation

Lunar.Music.RaspberryPi

Go Build Go Report Card License: GPL v3 Donate

This is a backend of Lunar Music project on Raspberry Pi to play music according to command sent from the Lunar.Music.Web.

This Golang application is designed as a music player hosted on a Raspberry Pi. It has a listener which will receive message from RabbitMQ server and perform the following actions.

  • Play a music
    • The music needs to be in MP3 format;
    • The music file needs to be stored online Since this project is designed to work together with Lunar.Music.Web which is using Microsoft OneDrive as the storage, the music files are originally all stored on the Microsoft OneDrive Music folder. Before playing a music, this program will download the MP3 file from Microsoft OneDrive and then keep it locally so that subsequent plays of the same music file can be loaded locally at /home/pi/audio on the Raspberry Pi without downloading it again.
  • Play all music
    • This will play all the MP3 files which are stored in the /home/pi/audio.

How to use?

  1. Install Golang on the Raspberry Pi;

  2. Clone this project to Raspberry Pi;

  3. Install necessary Golang packages;

  4. Create a .env file in the app directory with the following content;

    RABBITMQ_SERVER_CONNECTION_STRING=
    RABBITMQ_CHANNEL_NAME=
    

    If you are using this project together with Lunar.Music.Web, then the RabbitMQ part above must be same as the ones defined in the .env file in Lunar.Music.Web so that the communication between the Raspberry Pi and the web app can work;

  5. Build the go web project in the root directory of this project;

  6. Run the output program. Optionally, you can set this program to be run automatically when Raspberry Pi is connected so that you don't have to manually run the program to make the music player work.

Contributing

First and foremost, thank you! I appreciate that you want to contribute to this project which is my personal project. Your time is valuable, and your contributions mean a lot to me. You are welcomed to contribute to this project development and make it more awesome every day.

Don't hasitate to contact me, open issue, or even submit a PR if you are intrested to contribute to the project.

Together, we learn better.

License

This library is distributed under the GPL-3.0 License found in the LICENSE file.

About

This is a backend of Lunar Music project on Raspberry Pi to play music according to command sent from the Lunar.Music.Web.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages