<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Thank you so much for your help, it works much better, I can clearly hear the music now!<div><br></div><div>Also, about your tips, it's just for the example, to make the code easier to read (but I agree with you).</div><div><br></div><div>That said, I made some changes in the code, and I still have a few more questions:</div><div><br></div><div>1 - Even if the sound is much better, it's unfortunately still bad: on the left channel, there is only crackling, while on the right channel, the sound is much better, but still with some crackling too, even if the sound doesn't saturate. Also, the sound is low-pitched (only if I useĀ <font face="monospace, monospace">AV_SAMPLE_FMT_FLT</font> forĀ <font face="monospace, monospace">swr_alloc_set_opts()</font>). Where could that come from?</div><div><br></div><div>2 - My sound is encoded in 44100 Hz, while my device expects sound in 48000 Hz. I think that there is a command in FFMpeg that allows upscaling (not sure about the term), i.e. provide 48000 frames per second from a file encoded in 44100 Hz, for example. How can I achieve that?</div><div><br></div><div>3 - <i>" You have no idea if the buffer passed to getPcmFloat() fits the samples you wanna write. It would be to pass a size_t bufferLength as well."</i> : I agree, and again, I provide this code to make it easy to understand, but I found a workaround for that. That said, if it's possible to ask FFMpeg to extract a specific number of frames, I'm interested. Is it possible, and if yes, how?</div><div><br></div><div>Thanks again for your help.</div><div><br></div></div></div></div></div>