SoundEffect vs Audio

Originally posted on QuicKing, the Kingdom of QML Workaround, the blog I kept in 2011 and 2012. Here’s how that kingdom started and ended.

I don’t quite understand why there are two components for this. It could have been a bet between two developers: “My component is better than yours! I bet!”

SoundEffect

  • Positive: loops, good performance with simultaneous sounds
  • Negative: WAV files only, limited properties

Audio

  • Positive: WAV and MP3 files, seekable, playbackRate…
  • Negative: no loop property, you need a workaround! 😀

I did some tests and the performance is almost the same. Comparing the properties, I think Audio is more powerful, and the loop property of SoundEffect can easily be replaced with onStopped on Audio. The Qt docs say SoundEffect is better for quick and simultaneous sounds, and I really did have problems with simultaneous sounds using Audio, especially on Linux.

Another very important thing is the difference between MP3 and WAV files: WAV is much faster, very much faster. If your application has no size restrictions, I think WAV is the better choice.

So my bet is on Audio. Anyone want to bet against me? BolĂŁo, uma caixa de BIS?

More details in the Qt docs: QML Multimedia (via the Wayback Machine, since doc.qt.nokia.com is long gone).

You may also enjoy…

All posts →