Show HN: Simple access to your music from the web
github.com
github.com
My first big project, like 20 years ago, was a streaming interface to my music collection at this point around 7k mp3s.
I had almost no programming knowledge. It took me like 12 month to the first working version (http auth, usermanagement, playlists) which I iterated at least 3 more times. I think this version [1] ran for me and my shared flat people for like 3 years. Used it daily to stream music while being in school and coded my tumbelog.
Later I proceeded to rewrite it in ruby [2]. Much less code. Same features. I think it had even the functionality to not download playlists and stream but also play the music locally on the server.
At some point my goal was a wrapper to play music depending on moods, previous played songs and stuff like that (that was way before spotify existed) but I never came far.
The code is on github only for historical reasons.
[1] https://github.com/entropie/Jamp [2] https://github.com/entropie/bagpipe
Cool project. So little code.
My server was called GNUMP3d, and was originally written in Perl, later rewritten in C:
https://web.archive.org/web/20030219092730/http://gnump3d.so...
Not a terribly original project, but it was a little popular for a while.
https://git-annex.branchable.com/ https://github.com/junegunn/fzf
[edit] Ooooh, git annex seems super useful! I'm definitely going to have fun with that, for other things
fetchplay() {
git annex get "$@" && vlc "$@"
}
Combined with the keybindings that ship with fzf, I can type "fetchplay [CTRL-T]", select some subset of the directory tree, and the files will play. Git annex will locate the files (in this case, on another machine in my apartment) and fetch them before playing only if needed (if they are already present, "git annex get" verifies that and exits silently). I have my music collection backed up on several different forms of removable media, across several machines, and on AWS S3.Here is a recording of me fetching and playing three tracks:
I do wonder what happens with the temp file when the full file is loaded. The quick and dirty way that most people do it is to simply delete/move the temp file as completion, but of course that interrupts the media player as the file is now “missing”. I feel like I’m going to find out shortly when I research or test...
Inspiring to see it done in a relatively small amount of code, too! Right now I rely on Google Music for desktop and mobile streaming but it kind of sucks. It's nice to know I could make my own player relatively easily!
[0] https://github.com/navidrome/navidrome
[2] https://apps.apple.com/us/app/play-sub-music-streamer/id9553...
I live in an area where I frequently lose signal for about 45 minutes (a dead zone during my drive), so that's my #1 feature.
I generally download a small subset of my music to the phone, and stream the full library when I have service. But I'm really ready to replace Apple Music--the Android experience is just so bad.
I've been making and using my own music player for 8 years. And my player still a single html file under 300 loc. I also stick with nginx autoindex_format json so I don't need to run a backend server. For searching I put all music files in one single folder so I can just use the "Find in page" in Chrome. https://github.com/soruly/music/
You may also take a look at MediaSession. You can have media controls with CD covers on mobile lockscreen/notification center in just 20 lines of code. https://developer.mozilla.org/en-US/docs/Web/API/MediaSessio...
Vanilla JS helps immensely to jump right into it actually.
Perhaps I am a complete idiot, but I have off and on tried to get MPD reliable enough to do something like this and I can never make it happen consistently; the killer tends to be the separation between the interface/client and the audio stream. It's just so cumbersome and there doesn't seem to be a good reliable way to unify them easily and consistently.
There are a few reasons I couldn't live with that (I did samba over openvpn on my phone for quite a while, vlc as the player).
Primary reason is I want it to be https so I can listen to my music at work, on my workstation without needing to poke through their firewall.
Secondary reason is that I listen to music the entire day and want a very quick way to find what I want, browsing lists and picking files is not working for me, I got addicted to the "j" key in winamp many years ago and this is kind of that idea distilled and redined a bit.
I made this after seeing another player here on HN called mstream, I used it for a while but the UI managed to both do too much and not entirely what I wanted.
Nice work!
So far my favourite has been zmusic-ng, by the creator of WireGuard: https://git.zx2c4.com/zmusic-ng/about/
It's been a while since I've done this, but from what I remember the main weakness is that there's no buffering: you always hear exactly the point the mpd player is at.
You'd have to run the browser on the pi, which is no problem, but then you need a was to access that browser from the outside.
LOL
[0] https://developer.mozilla.org/en-US/docs/Web/API/CacheStorag...
[0] https://developer.chrome.com/docs/extensions/reference/stora...
[1] https://docs.microsoft.com/en-us/microsoft-edge/extensions-c...