你在Azure的市場稱爲語音API是一個名爲ProjectOxford的AI微軟項目,提供了計算機視覺,語音和語言的API陣列的一部分。
這些都是RESTful API中,這意味着你將構建HTTP請求發送給在雲中託管的在線服務。 語音到文本文檔可here,你可以找到示例代碼在github各種客戶端。特別是對於C#,您可以在this sample project中看到一些代碼。
請注意,ProjectOxford仍處於預覽版(測試版)。使用這些API的額外支持可以在ProjectOxford MSDN forum上找到。
但只是給你的你的程序將如何看起來像一個想法(從上面的示例代碼在GitHub上獲取):
AccessTokenInfo token;
// Note: Sign up at http://www.projectoxford.ai for the client credentials.
Authentication auth = new Authentication("Your ClientId goes here", "Your Client Secret goes here");
...
token = auth.GetAccessToken();
...
string requestUri = "https://speech.platform.bing.com/synthesize";
var cortana = new Synthesize(new Synthesize.InputOptions()
{
RequestUri = new Uri(requestUri),
// Text to be spoken.
Text = "Hi, how are you doing?",
VoiceType = Gender.Female,
// Refer to the documentation for complete list of supported locales.
Locale = "en-US",
// You can also customize the output voice. Refer to the documentation to view the different
// voices that the TTS service can output.
VoiceName = "Microsoft Server Speech Text to Speech Voice (en-US, ZiraRUS)",
// Service can return audio in different output format.
OutputFormat = AudioOutputFormat.Riff16Khz16BitMonoPcm,
AuthorizationToken = "Bearer " + token.access_token,
});
cortana.OnAudioAvailable += PlayAudio;
cortana.OnError += ErrorHandler;
cortana.Speak(CancellationToken.None).Wait();
謝謝你,我不知道它是仍處於測試階段。看了在Azure網站上的定價,將花費我們幾乎$ 1mil的語音請求,我們目前處理的數量(250英里每年,成本我們在AWS EC2實例約50K,提供相同的服務),所以我試圖驗證是否我已經正確地閱讀了定價信息,3個不同的人發了3封電子郵件,我發現自己回到了他們的蔚藍價格頁面,對不起,「我們不確定」。看起來Azure不會爲我們的特定使用情況飛行:( – MayoMan
您指的是哪個定價網站? ProjectOxford的定價可以在這裏找到:https://www.projectoxford.ai/pricing –
請注意,由於它是在預覽,價格如有變動,這些API無論如何,如果你正在使用其他的方法來處理這些對EC2實例,並考慮遷移到Azure的,它的價值比較Azure的虛擬機的定價,以及在這裏:https://開頭蔚藍。 microsoft.com/en-us/pricing/calculator/這將是一個更「蘋果」比較「蘋果」的比較 –