提交 00dbe9ec 编写于 作者: D dev@dev.com

1.发现一个新功能。Qt声卡采样率可以任意设置。

2.修复声卡模块播放BUG
上级 2b29231b
......@@ -109,11 +109,18 @@ void DialogSoundCard::InitMonitor()
mFormatSound.setSampleRate(ui->spinbox_sprate->value());
mFormatSound.setChannelCount(ui->spinbox_channels->value());
QAudioDevice infoOut(QMediaDevices::defaultAudioOutput());
//QAudioDevice infoOut(QMediaDevices::defaultAudioOutput());
QAudioDevice infoOut;
if (ui->comboBox_audioDevices->currentIndex()>=0 &&
ui->comboBox_audioDevices->currentIndex()<m_devOutputModule->rowCount())
infoOut = m_devOutputlist[ui->comboBox_audioDevices->currentIndex()];
else
infoOut = QMediaDevices::defaultAudioOutput();
if (!infoOut.isFormatSupported(mFormatSound))
{
//Default format not supported - trying to use nearest
mFormatSound = infoOut.preferredFormat();
//mFormatSound = infoOut.preferredFormat();
}
CreateAudioOutput();
......
......@@ -130,7 +130,7 @@ void DialogSoundCard::CreateAudioInput()
if (!infoIn.isFormatSupported(mFormatSound))
{
//Default format not supported - trying to use nearest
mFormatSound = infoIn.preferredFormat();
//mFormatSound = infoIn.preferredFormat();
}
QAudioDevice inputDevice(infoIn);
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册