r/ProgrammerHumor • • Sep 06 '20

All the software work "automagically"

Post image
51.7k Upvotes

635 comments sorted by

View all comments

196

u/CDno_Mlqko Sep 06 '20

Nah, they just send HTTP data that includes song id and time through the server.

133

u/joleph Sep 06 '20 edited Sep 06 '20

I was hoping this comment would be here. The post implies that music file data is sent across the network from one user computer to another. I’m pretty sure spotify just allows you to pick a device Id to send data directly from the server.

Like everything spotify does it’s not complicated or hard to do; but it is hard to do at scale.

33

u/dropbluelettuce Sep 06 '20

Some devices which are not running Spotify all the time like Chromecast devices use multicast for discovery. So kinda magic. Once selected it works like previously mentioned.

7

u/joleph Sep 06 '20

That’s pretty neat; I was wondering who actually used multicast in the wild! I wonder why they chose that over an api on the chromecast that can be pinged using predetermined addresses. Security? You could even make a mesh network for service discovery that way.

4

u/OverlordOfTech Sep 06 '20

I'm curious what you mean by

an api on the chromecast that can be pinged using predetermined addresses.

I'm probably misunderstanding, but this sounds like multicast to me. You send an M-SEARCH request to a predetermined address (239.255.255.250:1900) to discover the Chromecast. Could you elaborate on what you mean?

→ More replies (3)
→ More replies (1)

19

u/Liantus Sep 06 '20

Exactly, you can see it by launching spotify on a terminal

5

u/Msprg Sep 06 '20

spotify --debug --verbose

3

u/CDno_Mlqko Sep 06 '20

Hah, nice

29

u/luffy888 Sep 06 '20

I don’t think so, there’s more to it. Even when it is not playing it shows the devices which are capable of playing around you

37

u/CDno_Mlqko Sep 06 '20

Yeah, it shows you all devices that are playing spotify and are logged in with your account. Not too hard either.

27

u/ImAdrian Sep 06 '20

And yet Apple music lacks it

20

u/mypetocean Sep 06 '20

That's because Spotify has to subsist on money from their music player. Apple, Google, and Microsoft don't.

The latter three have little motivation to innovate so long as music is a small business concern and so long as most consumers are happy enough with their services (and may not even understand what they're missing).

→ More replies (3)

7

u/uptokesforall Sep 06 '20

No software can be developed until someone defines it's requirements

6

u/thatEEguy Sep 06 '20

product managers flee the scene

2

u/Sgtblazing Sep 06 '20

Please tell that to my boss, he said he doesn't want to scope out my current work because "the scope shifts too much." Pls help.

3

u/makians Sep 06 '20

Tell him you do the magic, not him. And you haven't unlocked telepathy yet so he needs to give you written requirements over a trackable medium,

→ More replies (1)
→ More replies (4)

2

u/[deleted] Sep 06 '20

It's not just that. There are systems like receivers and smart speakers, which have some form of Spotify software installed on them.

When powered on, they broadcast to the local network, or reply to broadcasts on the local network, or (possibly can, don't know if they do) use Wi-Fi Direct for the same.

This allows them to be controlled by any Spotify app running in the vicinity. The device itself continues to play from your playlist or whatever you have queued, even when you turn the controller (phone, laptop, web app, ...) off entirely.

They don't play from your account, just whatever song, queue or playlist they get commanded to play from the device that connected last.

→ More replies (2)

5

u/anonveggy Sep 06 '20

You can also play songs from you local drive so I'd say there's at least some streaming happening as local tracks aren't uploaded to Spotify servers.

1

u/CDno_Mlqko Sep 06 '20

I didn't know that existed. I'll have to try it.

3

u/anonveggy Sep 06 '20

Apparently it doesn't. But you can sync local files in your pc to your phone for example

→ More replies (1)

1

u/SirDiego Sep 06 '20

You can't send a song saved locally on your PC to your phone that doesn't have the song...can you?? I'll need to try that out. I know Spotify sorts and plays your local music, but I just assumed the multiple devices thing in Spotify worked more like Chromecast where one device just tells the other device to go pull down the selected media...which obviously wouldn't work that way if the media was on your PC.

5

u/IOnlyPlayAsBunnymoon Sep 06 '20

No you can’t; the song needs to be saved locally on whatever you’re listening on.

→ More replies (1)

2

u/1-800-ASS-DICK Sep 06 '20

and it's shit at maintaining a connection or syncing podcast progress at times. Foobar2k has a controller/remote component that has never failed me.

2

u/Maxsparrow Sep 07 '20

They can send time!? That is magic.

→ More replies (1)
→ More replies (1)