Request for Guide: synchronized music streaming with Phoenix

@doliver posted about a super interesting side project named LiveCue used for syncing music playback across devices.

The underlying technique would make an amazing guide, I think many people would love to build something like, and “get media from one place, play it in multiple” is a good general purpose Elixir clustering example that can be reapplied.

If @doliver wants to tackle this one, it’s his! If not, we want it anyway. :wink:

1 Like

Oh, cool. :slight_smile: To check we’re not talking at cross purposes, as it stands LiveCue relies on files being locally readable by all nodes. (My brother and I keep our music file collections synced.) E.g, play_track phx-click events are handled by broadcasting track info (album ID and track number) to a channel, and then all connected nodes, including the initiating person’s one, handle that info by starting a task which simply runs a cmus-remote play command. (cmus does all the actual playing.)

I wonder if it’s actually streaming audio data from one node to all other nodes and playing in-browser that you have in mind? If so, I could have a look into that.

Edit: if not, and my simpler existing scenario is what you had in mind, yes, I could create a simplified repo and write an article. Thanks!

Oh I think streaming an mp3 across an Elixir cluster is more what I had in mind! I suspect it’s not very hard, but I could be wrong.

Maybe a good intermediate step would be synchronized playback of one or two music files deployed with an app. This could easily be a two part project:

  1. Synchronize music playback with Phoenix (maybe LiveView?)
  2. Now do it with user uploaded files

I suspected so - thanks very much for creating this and clarifying! Sounds good to me, and I’ll have a look into how it might be done over the weekend if that’s okay.

If memory serves, I did start to look at going that way when starting LiveCue but backed away due to things seeming beyond me, but I shall have another look.

Having started a little research I think that with some learning (channels, etc.) I should be able to handle this, so if you’d still like me to I’d be very happy to take it on.

Repo with deploy instructions and article/blog post as per the latency triangulation guide?

Yes do it!

Exactly. Feel free to post in progress work here and we can look at it early, if it’s helpful.

Okay, great - thanks!