qsoundeffect(qaudio): error decoding source file
-
I'm trying to play a sound effect but QT always gives me this error:
QSoundEffect(qaudio): Error decoding source file:///home/baty/Qt Projects/testproj/untitled/click2.mp3
The file does exist in the location, i also tried adding it as a resource file but it cant play the sound.
QSoundEffect effect; effect.setSource(QUrl::fromLocalFile("/home/baty/Qt Projects/testproj/untitled/click2.mp3")); effect.setLoopCount(QSoundEffect::Infinite); effect.setVolume(10.f); effect.play(); qDebug()<<effect.status();
the qDebug() gives me a QSoundEffect::Loading state, which is, according to the documentation trying to load the file. (it only gives me the error when i paste the code into main.cpp just before w.show();
-
@jsulm I installed Gstreamer plugin, it still doesnt work, but i converted the mp3 file to a .wav file, and now it gives me QSoundEffect::Ready status, so the file is ready to play, but i still can't hear the sound. Maybe theres some problem with the audiooutput
-
Hi,
QSoundEffect only works with uncompressed data.
For the missing output, are you sure you selected a valid one and that the volume is not 0 ?