I'm trying to use Qt5 Multimedia to record audio with QAudioInput. I noticed, however, that when my QAudioInput
starts, it raises the master volume of my sound device to 100%.
How can I prevent QAudioInput from changing the master volume?
My current development platform is Linux with PulseAudio (with flat audio disabled).
This is how I'm using QAudioInput
:
QAudioDeviceInfo device_info = QAudioDeviceInfo::defaultInputDevice();
QAudioFormat format;
format.setSampleRate(44100);
format.setChannelCount(1);
format.setSampleSize(16) ;
format.setCodec("audio/pcm");
format.setSampleType(QAudioFormat::SignedInt);
format.setByteOrder(QAudioFormat::LittleEndian);
std::cout << device_info.deviceName().toUtf8().constData() << std::endl;
QAudioInput *default_device = new QAudioInput(device_info, format);
QIODevice *default_io_device = default_device->start();