PDA

View Full Version : How to generate simple sounds for QAudioOutput objects?



MattPhillips
17th February 2010, 18:46
Hello,

I'd like for the user to be able to generate simple sounds from the gui, that don't necessarily ever even need to be saved to a file--nothing more than pure tones. I.e. the user would key in frequency, duration, and maybe volume, and the tone would play. Does anybody know how to do this?

Matt

MattPhillips
29th July 2010, 14:35
I do, now. You can create a QIODevice from a QByteArray, not just a file. And (who knew) there is an QAudioOutput example in the Multimedia subfolder among the Qt demos which does just this.