PDA

View Full Version : QTAudioOutput example question



HemiMG
10th August 2010, 07:26
Hi.
I'm working on piece of software that generates a tone for the entire time it is running, so obviously the example provided was immensely helpful in getting me started. The problem is, about every 10 seconds, there is a noticeable clicking sound.

In looking at the code, I've noticed that they multiply the DurationSeconds variable by 1,000,000 when passing it to the generateData function and only divide it by 100,000 in the function itself, which would explain the click every ten seconds as the buffer is refilled.

I've never had this problem coding for iPhone and Android, which rely on callbacks to fill the buffer so I setup a QTimer to run generateData and filled the buffer for just 1 second. I get the clicking every second now, even if I run the timer 10 times a second.

How can I generate a solid and indefinite tone using Qt?