3

When I implement followed functions in callback function logged_in,I get an error "resource not loaded yet".How to resolve?

link=sp_link_create_from_string("spotify:track:1NrJYpdAi7uosDRPmSYrsG");
sp_session_player_load(g_sess,sp_link_as_track(link));
sp_session_player_play(g_sess, 1);

another question:when a track is ended and end_of_track is called,the music_delivery is also called again and again.When I printf the num_frames,it's a large number and seems to be the total number of frames.

1 Answers1

0

I'm guessing that when you call sp_session_player_load you are not waiting until metadata is loaded for the track, and thus the subsequent call to play complains that the resource isn't loaded.

Nik Reiman
  • 39,067
  • 29
  • 104
  • 160