Using a USB sound card, I'm trying to play mp3 files, with the default omxplayer. But although all other software works fine, omxplayer play my mp3 files at 2x speed, sometimes even 4 times.
Is there any solution for this?
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It only takes a minute to sign up.Sign up to join this community
The answer is that those mp3 files are using a non-standard
sample-rate, that cannot be set in omxplayer. Any sample-rate below the standard (CD quality) of 44100 Hz, will be ignored and thus the audio data conversion will go through the data faster.
$ ffprobe quaterSR.mp3 2>&1 | grep Stream Stream #0:0: Audio: mp3, 11025 Hz, mono, s16p, 32 kb/s $ ffprobe halfSR.mp3 2>&1 | grep Stream Stream #0:0: Audio: mp3, 22050 Hz, stereo, s16p, 56 kb/s $ ffprobe normalSR.mp3 2>&1 | grep Stream Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16p, 128 kb/s
Similarly, if the sample-rate is higher than 44100 Hz, the sound will be slowed down, when played.