Skip to content

esteban-gasan/music-streaming-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Music streaming service

A simple project to transfer files between a server and a client, resembling a music streaming service. A user can play the songs stored in the server (which downloads them) or play songs that are stored locally. The main focus for this project was to use concurrency and client-server communication.

Installation

  1. Install Python 3.8+.

  2. In Ubuntu run the command sudo apt-get install libasound2-dev. For Windows, you may need to install Microsoft Visual C++ Build Tools.

  3. Install the requirements. It is recommended to first create a virtual environment.

    pip install -r requirements.txt

Usage

Run the server first:

$ py server.py
(Server) INFO: Server is listening ...

Then the client:

$ py client.py
(MainThread) INFO: Playlist: ['Coral.wav', 'Fushiguro.wav', 'Solitude.wav']
>

The client script gets the commands from the user. These commands are described below, the arguments inside brackets are optional. > represents the prompt for user input.

  • search [query] lists all server files, or the files that match the query.

    > search ma
    Magic.wav
    Makani.wav
    
  • ls lists the local files (from songs/).

    > ls
    Coral.wav
    Fushiguro.wav
    Solitude.wav
    
  • play [filename ...] plays the list of songs. Will play the main playlist made of all the songs from songs/ if no arguments are passed.

    > play Coral.wav Solitude.wav "What If.wav"
    
  • stop stops all audio playback.

  • pause pauses the current song.

  • resume resumes the paused song.

  • prev plays the previous song.

  • next or skip plays the next song.

  • add filename [filename ...] adds a song (or list of songs) to the main playlist. Use quotes to pass names with spaces.

    > add Makani.wav "Hollow Sun.wav"
    (Player) INFO: Playlist: ['Coral.wav', 'Fushiguro.wav', 'Solitude.wav', 'What If.wav', 'Makani.wav', 'Hollow Sun.wav']
    
  • del filename [filename ...] deletes a song (or list of songs) from songs/. Also removes them from the main playlist.

    > del Fushiguro.wav "What If.wav"
    (Player) INFO: Playlist: ['Coral.wav', 'Solitude.wav', 'Makani.wav', 'Hollow Sun.wav']
    
  • rm filename [filename ...] removes a song (or list of songs) from the main playlist.

    > rm Coral.wav "Hollow Sun.wav"
    (Player) INFO: Playlist: ['Solitude.wav', 'Makani.wav']
    
  • info prints the playlist.

    > info
    (Player) INFO: Playlist: ['Solitude.wav', 'Makani.wav']
    
  • exit or CTRL+C exits the client.py execution.

Licenses

The source code uses the MIT license, while the songs fall under the Creative Commons license.

Creative Commons Attribution 3.0 Unported

The following songs use the Creative Commons Attribution 3.0 Unported License.

Creative Commons Attribution-ShareAlike 3.0 Unported

These songs use the Creative Commons Attribution-ShareAlike 3.0 Unported.

Attribution 4.0 International (CC BY 4.0)

This song uses the Attribution 4.0 International (CC BY 4.0).

Music promoted by https://www.free-stock-music.com

About

A simple music streaming service using Python

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages