I'm writing a C# wrapper around libspotfiy, and have a problem with the track playing. From what I can tell, when I want to start streaming a track for the first time in a session, I should call
sp_session_player_load(sessionHandle, trackHandle)
sp_session_player_play(sessionHandle, true);
This is what I'm doing, and it works fine. The problem start when I want to play something else. With a track still playing, what am I meant to do to play a new one? Should I call
sp_session_player_play(sessionHandle, false);
sp_session_player_unload(sessionHandle);
Before then calling a new round of load/play? I ask because when I do this, I often see my program hang when I call the unload, or call play with an argument of false. I'm using the get_audio_buffer_stats callback. I've got appropriate thread syncronisation in place, so I'm wondering if I'mu sing the api incorrectly?