what is the sample rate of spotify stream (libspot

2019-03-31 23:30发布

问题:

What is the sample rate of spotify stream?

The call back function "music_delivery" in libspotify example playtrack takes audio format from libspotify directly. Is the audio decoded to be raw wave data already? Is the sample rate 44.1kHz/16bit by default? Does the libspotify convert the original audio sample rate to be 44.1KHz/16bit?

Thanks.

回答1:

The audio you get in the music_delivery callback is indeed raw PCM data. The sample rate and bit depth is described in the sp_audioformat struct given in that callback.

The audio format can change depending on the track being played, so make sure your audio pipeline can deal with that.



标签: spotify