static Program() { _ttsClient = new Tts("4zGAhiQANs9tjMv4p1BCGmdh", "fbb284bd4c52f984bf63c78f0d661600"); }
public SpeechDemo() { _asrClient = new Asr(Key, Secret); _ttsClient = new Tts(Key, Secret); }
public Main() { InitializeComponent(); _asrClient = new Asr(API_KEY, SECRET_KEY); _ttsClient = new Tts(API_KEY, SECRET_KEY); }
public SpeechDemo() { _asrClient = new Asr("7bZfvZvN3WpShcHwoT1hTpz1", "5b6a4e7316289ac109d6558848678991"); _ttsClient = new Tts("7bZfvZvN3WpShcHwoT1hTpz1", "5b6a4e7316289ac109d6558848678991"); }
public AddUserGroup(Face clientAll, Tts client2All) { InitializeComponent(); client = clientAll; client2 = client2All; }
public SpeechRecognitionController() { _asrClient = new Asr("FDMQIcuMyqMUuBPZVi9WHhYZ", "f5GmDPs1t34unCekiP5L0yEGQv7UG6qk"); _ttsClient = new Tts("FDMQIcuMyqMUuBPZVi9WHhYZ", "f5GmDPs1t34unCekiP5L0yEGQv7UG6qk"); }
public SpeechDemo() { //_asrClient = new Asr("Api Key", "Secret Key"); _ttsClient = new Tts("SjasQWCPjMIl8oidHKCCn6mh", "cd0945f3f5d1cdeea7504c5885764131"); }
public SpeechDemo() { _asrClient = new Asr(apikey, secretkey); _ttsClient = new Tts(apikey, secretkey); }
public SpeechAPI() { _asrClient = new Asr(Config.clientId, Config.clientSecret); _ttsClient = new Tts(Config.clientId, Config.clientSecret); }
public Speech() { _asrClient = new Asr("asMPqxyOZG8Szn0HTNlIROOu", "ac8f300c10b49d226ba8dcaad3687b8a"); _ttsClient = new Tts("Api Key", "Secret Key"); }
/// <summary> /// 语音合成1024字节最大 /// </summary> /// <param name="text"></param> /// <returns></returns> public static string Tts(string text) { try { if (!string.IsNullOrEmpty(text)) { string url = ""; if (text.Contains('{')) { //int uu = text.IndexOf("url\":\""); //if (uu > 0) //{ // text = text.Substring(uu + 6, text.Length - uu - 6); // int yy = text.IndexOf('\"'); // url = text.Substring(0, yy); // return url;//还有不是MP3的url //} //else //{ // return null; //} return(null);//json字符串的不生成url } else { if (tts == null) { string APP_ID = "14884741"; string API_KEY = "UNBsgAYhfLciqDsWRApMmSTn"; string SECRET_KEY = "bLpvCoLguv8Xg04c6E8W8LVgwluC4GC4"; tts = new Tts(API_KEY, SECRET_KEY); tts.Timeout = 60000; // 修改超时时间 } // 可选参数 var option = new Dictionary <string, object>() { { "spd", 6 }, // 语速 { "vol", 5 }, // 音量 { "per", 4 } // 发音人,发音人选择, 0为普通女声,1为普通男生,2为普通男生,3为情感合成-度逍遥,4为情感合成-度丫丫,默认为普通女声 }; var result = tts.Synthesis(text, option); string path = ""; if (result.ErrorCode == 0) // 或 result.Success { string filename = DateTime.Now.ToString("HHmmss-fff") + ".mp3"; path = $"{ mp3Path}{ DateTime.Now.Date.ToString("yyyyMMdd")}\\{filename}";//C:\IIS\MP3\20181216\150225-266.mp3 if (!Directory.Exists($"{ mp3Path}{ DateTime.Now.Date.ToString("yyyyMMdd")}")) { Directory.CreateDirectory($"{ mp3Path}{ DateTime.Now.Date.ToString("yyyyMMdd")}"); } File.WriteAllBytes(path, result.Data); url = $"{mp3Url}{ DateTime.Now.Date.ToString("yyyyMMdd")}/{filename}";//http://47.107.66.121:8044/20181216/150225-266.mp3 } return(url); } } else { return(null); } } catch (Exception) { throw; } }
public SpeechDemo() { _asrClient = new Asr("Api Key", "Secret Key"); _ttsClient = new Tts("Api Key", "Secret Key"); }
public Speech() { _asrClient = new Asr("GXrdsGDVgDKOutcdlo3jNnmq", "29AfMqIO4CN5rOl0cu3lRo2BuAEvqsIG"); _ttsClient = new Tts("GXrdsGDVgDKOutcdlo3jNnmq", "29AfMqIO4CN5rOl0cu3lRo2BuAEvqsIG"); }
public MP3SpeechGenerator(SpeechAppData appData, TTSParam ttsParam = default(TTSParam)) { _tts = new Tts(appData.apiKey, appData.secretKey); }