Open kmcoulson opened 8 years ago
Sorry, no. I haven't looked at it in literally years, so I have no idea what might be causing it. One thing you can do though is to make sure that the music data is actually delivered to your sink by logging something or similar.
to make sure that the music data is actually delivered to your sink
This. libspotify is recently causing more and more problems itself. It's deprecated, after all.
Thanks, but how do I check that? Where in the code?
Insert a Console.WriteLine("Music delivered!");
or something like that into this method.
Oh, it is definitely hitting that event and the e.Samples length is not zero. However if I put a breakpoint here the BufferedBytes is always zero (I don't know if that is right or not).
Hah. The samples are not added to the buffer. It just outputs "Enqueue" instead of enqueueing them. :D
You're very welcome to PR this into the repo. :)
OK, could you give any advice on what needs to be done?
I added this:
buffer.AddSamples(samples, 0, samples.Length);
before this line and it seems to work. Does that seems like the correct thing to do?
Exactly. I suggest you get a little into audio programming, ie. read about what PCM, audio samples, bit rates and sample rates are (and of course how libspotify's music delivery works). You'll get a much better understanding of whats happening within the code.
Thanks, yeah I am reading up on it now. What I am trying to achieve is a server that shows up as a player in the spotify app so you can control what is playing from the native app. But then for it to broadcast whatever is playing and for that broadcast to be picked up and played by Raspberry Pis that are connected to speakers around the house. So I can play spotify in any room or multiple rooms.
Not doable unfortunately, until we get a new libspotify.
Hi, I cloned the repo for the first time today and it looks really good. However, I tried running the WinForms app to test it out and although everything seems to run fine no audio is output when a track is playing. Any idea why?