Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Generating a sound
Hey, is there a tone generator in qt, where you could generate a sound? (the beep kind of sound.. - single frequency tone)
For generating arbitrary tones? No. There is a "beep":http://doc.qt.nokia.com/4.7/qapplication.html#beep function in QApplication that will play your system beep. But not a tone generator in the "play simple tunes" sense.
There are various multimedia APIs in Qt, but primarily are concerned with playback of media files and that sort of thing.
ok, thanks anyway.
Jupiter last edited by
if you have a sound file you can play it with QSound::play
No, haven't got any file.
I've found this "tutorial":http://doc.qt.nokia.com/4.7-snapshot/multimedia-audiooutput.html , it seems to be generating a sound, I'll try to understand the code.
smileeFace last edited by
I know this post was from a few years ago. Is there still no way to generate a tone if I were to pass volume and frequency?
Edit: Found that I could just use Windows.h's Beep(..). All I needed was a basic tone of which I could set the frequency. How pretty it sounded didn't matter. Planning on making an abstraction layer so that when I change to another platform, I would only have to change this system specific file.