|
@@ -1228,49 +1228,6 @@ namespace XHWK.WKTool
|
1228
|
1228
|
model_VideoList = new List<Model_Video>();
|
1229
|
1229
|
foreach (Model_WKData Vdata in APP.WKDataList)
|
1230
|
1230
|
{
|
1231
|
|
- #region 检测麦克风扬声器是否可用
|
1232
|
|
- string audioSpeakerPath = FileToolsCommon.GetFileAbsolutePath("adoS.m");
|
1233
|
|
- string audioMicrophonePath = FileToolsCommon.GetFileAbsolutePath("adoM.m");
|
1234
|
|
- try
|
1235
|
|
- {
|
1236
|
|
- FileToolsCommon.DeleteFile(audioSpeakerPath);
|
1237
|
|
- FileToolsCommon.DeleteFile(audioMicrophonePath);
|
1238
|
|
- }
|
1239
|
|
- catch (Exception)
|
1240
|
|
- {
|
1241
|
|
-
|
1242
|
|
- }
|
1243
|
|
- //扬声器
|
1244
|
|
- if (APP.FFmpeg.StartRecordSpeakerAudio(audioSpeakerPath))
|
1245
|
|
- {
|
1246
|
|
- APP.FFmpeg.StopRecordAudio();
|
1247
|
|
- //Thread.Sleep(500);
|
1248
|
|
- //麦克风
|
1249
|
|
- if (APP.FFmpeg.StartRecordAudio(audioMicrophonePath))
|
1250
|
|
- {
|
1251
|
|
- }
|
1252
|
|
- else
|
1253
|
|
- {
|
1254
|
|
- //无法录制麦克风
|
1255
|
|
- MessageBoxResult Res = MessageWindow.Show("当前电脑无法录制麦克风,是否继续?", "消息提示", MessageBoxButton.OKCancel);
|
1256
|
|
- if (Res == MessageBoxResult.Cancel)
|
1257
|
|
- {
|
1258
|
|
- return;
|
1259
|
|
- }
|
1260
|
|
- }
|
1261
|
|
- APP.FFmpeg.StopRecordAudio();
|
1262
|
|
- }
|
1263
|
|
- else
|
1264
|
|
- {
|
1265
|
|
- //无法录制扬声器音频
|
1266
|
|
- MessageBoxResult Res = MessageWindow.Show("当前电脑无法录制音频,是否继续?", "消息提示", MessageBoxButton.OKCancel);
|
1267
|
|
- if (Res == MessageBoxResult.Cancel)
|
1268
|
|
- {
|
1269
|
|
- return;
|
1270
|
|
- }
|
1271
|
|
- }
|
1272
|
|
- #endregion
|
1273
|
|
-
|
1274
|
1231
|
#region 计时器初始化
|
1275
|
1232
|
if (Vdata.VideoList == null)
|
1276
|
1233
|
continue;
|
|
@@ -1820,6 +1777,49 @@ namespace XHWK.WKTool
|
1820
|
1777
|
{
|
1821
|
1778
|
if (IsFirstR)//是否第一次录制 初始化录制
|
1822
|
1779
|
{
|
|
1780
|
+ #region 检测麦克风扬声器是否可用
|
|
1781
|
+ string audioSpeakerPath = FileToolsCommon.GetFileAbsolutePath("adoS.m");
|
|
1782
|
+ string audioMicrophonePath = FileToolsCommon.GetFileAbsolutePath("adoM.m");
|
|
1783
|
+ try
|
|
1784
|
+ {
|
|
1785
|
+ FileToolsCommon.DeleteFile(audioSpeakerPath);
|
|
1786
|
+ FileToolsCommon.DeleteFile(audioMicrophonePath);
|
|
1787
|
+ }
|
|
1788
|
+ catch (Exception)
|
|
1789
|
+ {
|
|
1790
|
+
|
|
1791
|
+ }
|
|
1792
|
+ //扬声器
|
|
1793
|
+ if (APP.FFmpeg.StartRecordSpeakerAudio(audioSpeakerPath))
|
|
1794
|
+ {
|
|
1795
|
+ APP.FFmpeg.StopRecordAudio();
|
|
1796
|
+ //Thread.Sleep(500);
|
|
1797
|
+ //麦克风
|
|
1798
|
+ if (APP.FFmpeg.StartRecordAudio(audioMicrophonePath))
|
|
1799
|
+ {
|
|
1800
|
+ }
|
|
1801
|
+ else
|
|
1802
|
+ {
|
|
1803
|
+ //无法录制麦克风
|
|
1804
|
+ MessageBoxResult Res = MessageWindow.Show("当前电脑无法录制麦克风,是否继续?", "消息提示", MessageBoxButton.OKCancel);
|
|
1805
|
+ if (Res == MessageBoxResult.Cancel)
|
|
1806
|
+ {
|
|
1807
|
+ return;
|
|
1808
|
+ }
|
|
1809
|
+ }
|
|
1810
|
+ APP.FFmpeg.StopRecordAudio();
|
|
1811
|
+ }
|
|
1812
|
+ else
|
|
1813
|
+ {
|
|
1814
|
+ //无法录制扬声器音频
|
|
1815
|
+ MessageBoxResult Res = MessageWindow.Show("当前电脑无法录制音频,是否继续?", "消息提示", MessageBoxButton.OKCancel);
|
|
1816
|
+ if (Res == MessageBoxResult.Cancel)
|
|
1817
|
+ {
|
|
1818
|
+ return;
|
|
1819
|
+ }
|
|
1820
|
+ }
|
|
1821
|
+ #endregion
|
|
1822
|
+
|
1823
|
1823
|
#region 计时器初始化
|
1824
|
1824
|
if (t == null)
|
1825
|
1825
|
{
|