codejet9/MusiX

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 

Repository files navigation

A command line music streamer.

The goal was to make a simple, light-weight and less memory consuming terminal based music streamer.

musix-demo1.mp4
musix_win_demo1.mp4

In windows version warnings are frequently shown by VLC on command line. Could'nt find a solution to shut them. Ignore them.

  • [space] to pause/play
  • ctrl+c to quit
  • User input the song name.
  • Using youtube v3 API, search results are produced.
  • User selects the song.
  • From the JSON data sent by the API, URL and other data like video title and duration are extracted.
  • Using pafy and python-vlc audio is extracted and streamed.
  • Using keyboard for windows and pynput for linux, pause/play control is created.
  • The functionality of these libraries was like keylogger. No matter where you press the key, the function is triggered. So, I added an extra block of code which checks if the current window is same as the window at the time program was started. Only then function is triggered. This is like pause/play control is valid only when window is in focus.
  • Another good option was to make a TUI to implement the controls.
  • Autoplay is implemented using API's relatedVideo query. It sends the video related to current video. In my testing, I experienced the autoplay stuck in an endless loop between two videos. Will try to implement a better autoplay code in future!
  • If you face any issues or observe high CPU or RAM consumption please let me know. In one of the earlier uploads the CPU consumption was too high because I was printing few lines in every loop. Now, I removed it and print them olny once and optimised the code. The CPU consumption has dropped by almost 50%.
  • Changed installation method for linux. Previous installation method was more prone to dependency conflicts and was harmful(ex: packages like ipython3 stopped working). Solved this using pipx. Will try to change for windows as well. Till now didn't face any problems with windows.
  • The demos were recorded before the above two updates.

About

A command line music streamer

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published