## 腾讯小程序实时语音识别, app使用语音文件识别
## [官方文档](https://cloud.tencent.com/document/product/1093/48982)
* 微信小程序: 支持实时音频识别
* App:录音后通过后台Api进行语音文件识别。
为省事样式直接使用的color ui 的样式 , 适合引入了ColorUi的项目使用。
```vue
```
.net core 使用腾讯sdk语音转文字参考
```csharp
using (var ms = new MemoryStream())
{
var file = Request.Form.Files[0];
file.CopyTo(ms);
var bytes = ms.ToArray();
Credential cred = new Credential
{
SecretId = "",
SecretKey = ""
};
ClientProfile clientProfile = new ClientProfile();
HttpProfile httpProfile = new HttpProfile {Endpoint = ("asr.tencentcloudapi.com")};
clientProfile.HttpProfile = httpProfile;
AsrClient client = new AsrClient(cred, "", clientProfile);
SentenceRecognitionRequest req = new SentenceRecognitionRequest();
req.ProjectId = 0;
req.SubServiceType = 2;
req.EngSerViceType = "16k_zh";
req.SourceType = 1;
req.VoiceFormat = "mp3";
req.UsrAudioKey = Guid.NewGuid().ToString();
req.Data = Convert.ToBase64String(bytes);
req.DataLen = bytes.Length;
SentenceRecognitionResponse resp = client.SentenceRecognitionSync(req);
return resp;
}
```