i everyone !
As the title suggest, I’m having an issue with QAudioOutput::setVolume .
It works fine until I reach 50% (0.5).
Can someone try and tell me if it’s a bug or if I did something wrong please ?
To check if it works correctly, you can try to link it to a slider (0-100 range), signal-slot it, set it to the QAudioOuput volume (don’t forget to divide it by 100 to get it from 0 to 1) and check in your windows mixer if your app move beyond 50%.
Thanks in advance for your help :) !
Here is a minimalist code exemple :
void MainWindow::on_volumeSlider_valueChanged(int value)
{
qreal newVolume = (qreal)value/100;
qDebug() << QString::number(value) + "->" + QString::number(newVolume);
...
//I access my audioOutput and set the volume after that
}
showing : “10->0.1” etc… so it’s working.
Sound volume changes from 0 to 0.5, then after this I can’t hear any difference and the windows mixer cursor doesn’t move further than 50% which confirm volume isn’t set up correctly beyond this.
Edit : I also called the “volume” methode to see it the volume is correctly set, and it seems to be okay as it returns values from 0 to 1.
I have no idea where the problem is.
↧