Audioserve: Simple personal server to serve audio files from directories
github.com
github.com
I wrote boringstreamer to listen to my collection. I start one or more instances on different ports in different directories and connect to different ports similar to fm radio frequencies. (With tailscale I can listen from anywhere without any explicit access control.)
Being entirely selfish, I do wish audio servers would focus a bit more on what kind of audio they can serve up. Something with robust support for tracker (mod, s3m, xm, it, mtm, 669, etc), chip (most old 8-bit PCs), and game music formats (SNES, Genesis/MD, etc.) for old systems would be amazing and something I've long looked for as it would instantly open up millions of songs without requiring several terabytes of storage. Many libraries like FFmpeg support many of those internally, but software build on those libraries simply don't expose it.
Might even be able to take in funds for doing so.
Anything, which is supported by ffmpeg can be considered.
I mean, you can just serve mp3 files over HTTP. The browser can download the whole file, and load it until whatever mp3 playing library there is.
This is exactly what I did for my first personal project that landed me an internship at FANG. My music player had a pretty nice UI at the time ( Yahoo music days ), but music players from professionals like Yahoo or Spotify ( web player released one year later ) is that they are resilient to network failure, rather than assuming the mp3 file downloaded it one go, that it would be fast, and you can just point your JavaScript library at it, now that it's cached by the browser and can be loaded into memory.
If you have the right container/encoding format (my experience is that it works well with mkv) you can even start watching a video file locally with VLC while wget is still downloading it via HTTP... works amazingly well.
Agree - audioserve is now handling this with quite simple trick - just cache ahead couple of tracks/files from current folder (aka audiobook), so responsibility is move to client.
Surprisingly this simple trick did work for me for years (as I'm intensive user of audioserve). It kind of depends on file/chapter duration - but for most common cases - which are beetween 5 mins to say 90 mins it did work fine.
Historically only Android client was using this caching, but with new web client https://github.com/izderadicka/audioserve-web and broad Service Worker support in browsers it is also available in browser.
Jane Austen: "Player error: MEDIA_ERR_DECODE : Media failed to decode" Chesterton: No error, but silence when playing, and skips to next file. Perhaps server overload? Dumas: "Player error: MEDIA_ERR_SRC_NOT_SUPPORTED : Unsupported source type"
I'll add some chapter to README about this.
As I'm using audioserve myself, I try to evolve it continuosly, however my view of good simple audiobooks streaming server might be quite optioned (prefer textual information to covers, strong preference of opus codec, etc.), but do not hesitate to share your experiences and ideas via issues on project.
- audiobookshelf requires some rules for directory structure (which caused that some subfolders from my collections were not loaded), audioserve serves any directory structure
- bigger collections - for collections with 10k audiobooks audiobookshelf was just too slow it went on for couple of hours loading before I kill it. Audioserve is able to handle within collections scan in tens of minutes.
I'm currently modifying the directory listing template of Caddy to achieve similar functionality.