After checking out this, this, and this post, I understand that I have to stream
audio using something like NAudio
and also that playing a song is done by:
libspotify.sp_session_player_load(_sessionPtr, trackPtr);
libspotify.sp_session_player_play(_sessionPtr, true);
Now, if I understood correctly, I am receiving the stream
as raw PCM data. How can I access that data?
According to the documentation, I see that that I have to populate libspotify.sp_audioformat
How do I do this exactly? and from where?
I was checking out this project (Jamcast), and they do something like:
libspotify.sp_audioformat format = (libspotify.sp_audioformat)Marshal.PtrToStructure(formatPtr, typeof(libspotify.sp_audioformat));
Could someone point me in the right direction?
I am completely lost on how to retrieve the stream