mrehayden
mrehayden

Reputation: 171

Spotify raw output sounds garbled when interpreted as PCM

The output from music_delivery callback, when interpreted as a little endian 16bit signed integer PCM, with the same sample rate (44100Hz) and number of channels (2) as the audio samples in the sp_audioformat object, sounds recognisable, but very garbled, and in addition there are random bursts of noise throughout.

Does Spotify use a PCM format that isn't the same as standard, interleaved, PCM?

Upvotes: 2

Views: 548

Answers (1)

mrehayden
mrehayden

Reputation: 171

I had misunderstood what frames meant in the context of the documentation for the music_delivery callback.

To find out how many samples there are available in the delivery callback, you have to multiply the number of frames by the number of channels.

It sounds great now!

Upvotes: 2

Related Questions