|
|
|
@ -401,10 +401,7 @@ namespace AksWebBrowser
|
|
|
|
|
{ |
|
|
|
|
if (ispaye) |
|
|
|
|
{ |
|
|
|
|
Task.Run(() => |
|
|
|
|
{ |
|
|
|
|
Task.Run(() => { string command = $"pkill sox"; ShllCommad(command); }); |
|
|
|
|
}); |
|
|
|
|
Task.Run(() => { string command = $"pkill sox"; ShllCommad(command); }); |
|
|
|
|
string result = "{\"timestamp\":\"" + Utils.GetTimestamp() + "\",\"keycode\":\"" + param.code + "\",\"message\":\"success\",\"code\":\"200\",\"status\":true,\"data\":\"" + "停止播放成功" + "\"}"; |
|
|
|
|
SubmitLogs(result, "payleText"); |
|
|
|
|
return result; |
|
|
|
@ -451,7 +448,7 @@ namespace AksWebBrowser
|
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
Task.Run(() => { string command = $"sox {tempFile} -d"; ShllCommad(command); }); |
|
|
|
|
Task.Run(() => { string command = $"sox {tempFile} -d"; ShllCommad(command); }); |
|
|
|
|
result = "{\"timestamp\":\"" + Utils.GetTimestamp() + "\",\"keycode\":\"" + param.code + "\",\"message\":\"success\",\"code\":\"200\",\"status\":true,\"data\":\"" + "开始播放" + "\"}"; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -1012,10 +1009,7 @@ namespace AksWebBrowser
|
|
|
|
|
{ |
|
|
|
|
if (ispaly) |
|
|
|
|
{ |
|
|
|
|
Task.Run(() => |
|
|
|
|
{ |
|
|
|
|
Task.Run(() => { string command = $"pkill sox"; ShllCommad(command); }); |
|
|
|
|
}); |
|
|
|
|
Task.Run(() => { string command = $"pkill sox"; ShllCommad(command); }); |
|
|
|
|
string result = "{\"timestamp\":\"" + Utils.GetTimestamp() + "\",\"keycode\":\"" + param.code + "\",\"message\":\"success\",\"code\":\"200\",\"status\":true,\"data\":\"" + "停止播放成功" + "\"}"; |
|
|
|
|
SubmitLogs(result, "PalyFile"); |
|
|
|
|
return result; |
|
|
|
@ -1024,37 +1018,33 @@ namespace AksWebBrowser
|
|
|
|
|
{ |
|
|
|
|
Task.Run(() => |
|
|
|
|
{ |
|
|
|
|
Task.Run(() => |
|
|
|
|
{ |
|
|
|
|
Task.Run(() => { string command = $"pkill sox"; ShllCommad(command); }); |
|
|
|
|
}); |
|
|
|
|
Uri uri = new Uri(url); |
|
|
|
|
//返回 123.xlsx |
|
|
|
|
var filename = HttpUtility.UrlDecode(uri.Segments.Last()); |
|
|
|
|
//获取文件后缀 |
|
|
|
|
string ext = System.IO.Path.GetExtension(filename); |
|
|
|
|
DateTime dateTime = DateTime.Now; |
|
|
|
|
string time = DateTime.Now.ToString( |
|
|
|
|
"yyyyMMddHHmmss", DateTimeFormatInfo.InvariantInfo); |
|
|
|
|
string dirpath = Utils.getSystemPaht() + @"/wwwroot/WaveOutFile"; |
|
|
|
|
if (!Directory.Exists(dirpath)) |
|
|
|
|
{ |
|
|
|
|
Directory.CreateDirectory(dirpath); |
|
|
|
|
} |
|
|
|
|
string path = dirpath + @"/" + time + ext; |
|
|
|
|
WebRequest request = WebRequest.Create(url); |
|
|
|
|
WebResponse response = request.GetResponse(); |
|
|
|
|
using (Stream stream = response.GetResponseStream()) |
|
|
|
|
{ |
|
|
|
|
using (FileStream fileStream = new FileStream(path, FileMode.Create)) |
|
|
|
|
{ |
|
|
|
|
stream.CopyTo(fileStream); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
response.Close(); |
|
|
|
|
|
|
|
|
|
string command = $"pkill sox"; ShllCommad(command); |
|
|
|
|
//Uri uri = new Uri(url); |
|
|
|
|
////返回 123.xlsx |
|
|
|
|
//var filename = HttpUtility.UrlDecode(uri.Segments.Last()); |
|
|
|
|
////获取文件后缀 |
|
|
|
|
//string ext = System.IO.Path.GetExtension(filename); |
|
|
|
|
//DateTime dateTime = DateTime.Now; |
|
|
|
|
//string time = DateTime.Now.ToString( |
|
|
|
|
// "yyyyMMddHHmmss", DateTimeFormatInfo.InvariantInfo); |
|
|
|
|
//string dirpath = Utils.getSystemPaht() + @"/wwwroot/WaveOutFile"; |
|
|
|
|
//if (!Directory.Exists(dirpath)) |
|
|
|
|
//{ |
|
|
|
|
// Directory.CreateDirectory(dirpath); |
|
|
|
|
//} |
|
|
|
|
//string path = dirpath + @"/" + time + ext; |
|
|
|
|
//WebRequest request = WebRequest.Create(url); |
|
|
|
|
//WebResponse response = request.GetResponse(); |
|
|
|
|
//using (Stream stream = response.GetResponseStream()) |
|
|
|
|
//{ |
|
|
|
|
// using (FileStream fileStream = new FileStream(path, FileMode.Create)) |
|
|
|
|
// { |
|
|
|
|
// stream.CopyTo(fileStream); |
|
|
|
|
// } |
|
|
|
|
//} |
|
|
|
|
//response.Close(); |
|
|
|
|
//开始播放 |
|
|
|
|
string command = $"sox {path} -d"; |
|
|
|
|
command = $"sox {url} -d"; |
|
|
|
|
ShllCommad(command); |
|
|
|
|
//AutoAudio(ispaly, path); |
|
|
|
|
}); |
|
|
|
|