Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
colorEagleStdio
taskbus
提交
9354a00e
taskbus
项目概览
colorEagleStdio
/
taskbus
通知
166
Star
12
Fork
6
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
taskbus
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
9354a00e
编写于
4月 24, 2022
作者:
D
dev@win10Host.com
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
解决 soundcard 输入只能采用系统默认设备的问题。
上级
83fb4320
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
12 addition
and
13 deletion
+12
-13
modules/sources/source_soundcard/dialogsoundcard.cpp
modules/sources/source_soundcard/dialogsoundcard.cpp
+12
-13
未找到文件。
modules/sources/source_soundcard/dialogsoundcard.cpp
浏览文件 @
9354a00e
...
@@ -106,18 +106,6 @@ void DialogSoundCard::InitMonitor()
...
@@ -106,18 +106,6 @@ void DialogSoundCard::InitMonitor()
mFormatSound
.
setSampleFormat
(
QAudioFormat
::
Int16
);
//set sample sze to 16 bit
mFormatSound
.
setSampleFormat
(
QAudioFormat
::
Int16
);
//set sample sze to 16 bit
mFormatSound
.
setSampleRate
(
ui
->
spinbox_sprate
->
value
());
mFormatSound
.
setSampleRate
(
ui
->
spinbox_sprate
->
value
());
mFormatSound
.
setChannelCount
(
ui
->
spinbox_channels
->
value
());
mFormatSound
.
setChannelCount
(
ui
->
spinbox_channels
->
value
());
QAudioDevice
infoIn
;
if
(
ui
->
comboBox_audioDevices
->
currentIndex
()
>=
0
&&
ui
->
comboBox_audioDevices
->
currentIndex
()
<
m_devInputModule
->
rowCount
())
infoIn
=
m_devInputlist
[
ui
->
comboBox_audioDevices
->
currentIndex
()];
else
infoIn
=
QMediaDevices
::
defaultAudioInput
();
if
(
!
infoIn
.
isFormatSupported
(
mFormatSound
))
{
//Default format not supported - trying to use nearest
mFormatSound
=
infoIn
.
preferredFormat
();
}
CreateAudioInput
();
CreateAudioInput
();
mpInputDevSound
=
mpAudioInputSound
->
start
();
mpInputDevSound
=
mpAudioInputSound
->
start
();
...
@@ -133,8 +121,19 @@ void DialogSoundCard::CreateAudioInput()
...
@@ -133,8 +121,19 @@ void DialogSoundCard::CreateAudioInput()
disconnect
(
mpInputDevSound
,
0
,
this
,
0
);
disconnect
(
mpInputDevSound
,
0
,
this
,
0
);
mpInputDevSound
=
0
;
mpInputDevSound
=
0
;
}
}
QAudioDevice
infoIn
;
if
(
ui
->
comboBox_audioDevices
->
currentIndex
()
>=
0
&&
ui
->
comboBox_audioDevices
->
currentIndex
()
<
m_devInputModule
->
rowCount
())
infoIn
=
m_devInputlist
[
ui
->
comboBox_audioDevices
->
currentIndex
()];
else
infoIn
=
QMediaDevices
::
defaultAudioInput
();
if
(
!
infoIn
.
isFormatSupported
(
mFormatSound
))
{
//Default format not supported - trying to use nearest
mFormatSound
=
infoIn
.
preferredFormat
();
}
QAudioDevice
inputDevice
(
QMediaDevices
::
defaultAudioInput
()
);
QAudioDevice
inputDevice
(
infoIn
);
mpAudioInputSound
=
new
QAudioSource
(
inputDevice
,
mFormatSound
,
this
);
mpAudioInputSound
=
new
QAudioSource
(
inputDevice
,
mFormatSound
,
this
);
//Broadcast sample rates
//Broadcast sample rates
TASKBUS
::
push_subject
(
0xffffffff
,
0
,
TASKBUS
::
push_subject
(
0xffffffff
,
0
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录