Qt 5.1 or later:
I need to play a notification sound of frequency x for n milliseconds. It'd also be nice if I could combine tones like this: 1000Hz for 2 secs, then 3000Hz for 1 sec, ..
The easiest way is to use files (WAV, MP3, ..), e.g. as described here: How to play sound with Qt But then I have to generate such files for each of my scenarios.
Qt's audio output example generates such tones in memory ( Generator::generateData(const QAudioFormat &format, qint64 durationUs, int sampleRate)
). I could write such a generator for my purpose. But do I have to?
So what is the easiest way to just play frequency x for n milliseconds?