C# ChatGPT取回後轉語音合成 將base64轉音檔

從ChatGPT的api,取得文件後,再透過語音合成轉為base64音檔念出。

 

台灣雅婷 https://www.yating.tw/zh/api-text-to-speech-zh/

雅婷文字轉語音 https://tts.yating.tw/

文件  https://developer.yating.tw/doc/tts-%E8%AA%9E%E9%9F%B3%E5%90%88%E6%88%90#%E7%AF%84%E4%BE%8B

後台: https://developer.yating.tw/zh-TW/dashboard

其他參考

https://ai.baidu.com/tech/speech/tts

 

https://aws.amazon.com/tw/polly/

https://tw.piliapp.com/text-to-speech/

https://azure.microsoft.com/zh-tw/products/cognitive-services/text-to-speech/#overview

https://cloud.google.com/text-to-speech?hl=zh-tw

https://azure.microsoft.com/zh-tw/products/cognitive-services/text-to-speech/

https://www.xfyun.cn/services/online_tts

https://everest-ai.ximalaya.com/charm-studio/


static void DecodeBase64ToFile(string Base64String, string filenames)
{
try
{

byte[] bytes = Convert.FromBase64String(Base64String);
using (var fs = new FileStream(filenames, FileMode.Create, FileAccess.Write))
{
fs.Write(bytes, 0, bytes.Length);
fs.Flush();
}
}
catch (Exception e)
{

}
}