schollz / musicsaur

Music synchronization from your browser.
https://radio.schollz.com/
MIT License
281 stars 17 forks source link

MPD integration #52

Closed roizcorp closed 5 years ago

roizcorp commented 8 years ago

I guess this would be the ultimate feature for the most of us

leverage the MPD maturity and stability while supply the (probably only) missing feature of syncing clients

schollz commented 8 years ago

I've never used MPD. Do you have some idea of where to start?

roizcorp commented 8 years ago

MPD is highly configurable music player, with HiFi capbilities and uses ffmpeg as well. what so great with the integration with it is all your solution needs to do is sync between the remote players, all other stuff (playlist, file format etc) MPD can take care of.

With MPD you may configure multiple "output" devices, the most naive one is your own audio card (the one that actually runs mpd) then you can expand to more "complex" outputs. from the mpd.conf: audio_output { name "Free text name for your audio card" type "alsa" # - this is where you want to integrate device "hw:0,0" auto_resample "no" # configurable parameter auto_format "no" # configurable parameter enabled "yes" # indication for mpd whether to channel the audio through this output }

Furthermore MPD has a http streaming solution, but its lacking the powerful sync value that you are offering. In the example below I tired to keep the audio as is as much as possible for the sake of high fidelity, but you can see that there are a lot of options to reduce the size of the stream audio_output { type "httpd" name "My HTTP Stream" #encoder "lame" port "8000" quality "10.0" # bitrate "128" #format "44100:16:1" always_on "yes" # prevent MPD from disconnecting all listeners when playback is stopped. tags "yes" # httpd supports sending tags to listening streams. }

This is your lead, now, do your magic :). MPD is an open source so all doumentation and code is available to you for integration.

schollz commented 8 years ago

Great, thanks! I'll see what I can do :)

roizcorp commented 8 years ago

hey, any update on this?

schollz commented 8 years ago

Not yet! I think it will be pretty hard to do though, because I want to stick with using browsers.

Have you tried this solution? I tried it, but didn't get it working (but I'm not so familiar with MPD still).

roizcorp commented 8 years ago

reading the solution it seems that there is a lot of loss in terms of quality, the source component pass the audio in 48000 quality. HiFi is about 192000 or 96000