QSoundEffect(qaudio): Error decoding source

  • I tried to play mp3/wma files using QSound, however I got "Error decoding source" runtime message (windows mediaplayer played files ok).

    Only way I was able to play sounds, was to use QMediaPlayer do the playing.

    Is there something odd related QSound (5.1/5.4) ?

  • @mnokka

    Are you sure your path is correct? If Qt can't find the file it gives the "error decoding source" message which is misleading.

    Add files to your resource file:

    • (If you haven't already created one go to File | New | Qt | Qt Resource File).
    • Click Add existing files then select sound files you want
    • Right click and copy path
    • Paste path to play filename. e.g. QSound::play(":/lose.wav");