|
@@ -1110,7 +1110,6 @@ namespace XHWK.WKTool
|
1110
|
1110
|
InitializeUpload();
|
1111
|
1111
|
}
|
1112
|
1112
|
//btnStop.IsEnabled = true;//停止录制按钮可点击
|
1113
|
|
- StartRecord();
|
1114
|
1113
|
}
|
1115
|
1114
|
/// <summary>
|
1116
|
1115
|
/// 初始化上传
|
|
@@ -1229,49 +1228,6 @@ namespace XHWK.WKTool
|
1229
|
1228
|
model_VideoList = new List<Model_Video>();
|
1230
|
1229
|
foreach (Model_WKData Vdata in APP.WKDataList)
|
1231
|
1230
|
{
|
1232
|
|
- #region 检测麦克风扬声器是否可用
|
1233
|
|
- string audioSpeakerPath = FileToolsCommon.GetFileAbsolutePath("adoS.m");
|
1234
|
|
- string audioMicrophonePath = FileToolsCommon.GetFileAbsolutePath("adoM.m");
|
1235
|
|
- try
|
1236
|
|
- {
|
1237
|
|
- FileToolsCommon.DeleteFile(audioSpeakerPath);
|
1238
|
|
- FileToolsCommon.DeleteFile(audioMicrophonePath);
|
1239
|
|
- }
|
1240
|
|
- catch (Exception)
|
1241
|
|
- {
|
1242
|
|
-
|
1243
|
|
- }
|
1244
|
|
- //扬声器
|
1245
|
|
- if (APP.FFmpeg.StartRecordSpeakerAudio(audioSpeakerPath))
|
1246
|
|
- {
|
1247
|
|
- APP.FFmpeg.StopRecordAudio();
|
1248
|
|
- //Thread.Sleep(500);
|
1249
|
|
- //麦克风
|
1250
|
|
- if (APP.FFmpeg.StartRecordAudio(audioMicrophonePath))
|
1251
|
|
- {
|
1252
|
|
- }
|
1253
|
|
- else
|
1254
|
|
- {
|
1255
|
|
- //无法录制麦克风
|
1256
|
|
- MessageBoxResult Res = MessageWindow.Show("当前电脑无法录制麦克风,是否继续?", "消息提示", MessageBoxButton.OKCancel);
|
1257
|
|
- if (Res == MessageBoxResult.Cancel)
|
1258
|
|
- {
|
1259
|
|
- return;
|
1260
|
|
- }
|
1261
|
|
- }
|
1262
|
|
- APP.FFmpeg.StopRecordAudio();
|
1263
|
|
- }
|
1264
|
|
- else
|
1265
|
|
- {
|
1266
|
|
- //无法录制扬声器音频
|
1267
|
|
- MessageBoxResult Res = MessageWindow.Show("当前电脑无法录制音频,是否继续?", "消息提示", MessageBoxButton.OKCancel);
|
1268
|
|
- if (Res == MessageBoxResult.Cancel)
|
1269
|
|
- {
|
1270
|
|
- return;
|
1271
|
|
- }
|
1272
|
|
- }
|
1273
|
|
- #endregion
|
1274
|
|
-
|
1275
|
1231
|
#region 计时器初始化
|
1276
|
1232
|
if (Vdata.VideoList == null)
|
1277
|
1233
|
continue;
|
|
@@ -1821,6 +1777,49 @@ namespace XHWK.WKTool
|
1821
|
1777
|
{
|
1822
|
1778
|
if (IsFirstR)//是否第一次录制 初始化录制
|
1823
|
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
|
+
|
1824
|
1823
|
#region 计时器初始化
|
1825
|
1824
|
if (t == null)
|
1826
|
1825
|
{
|