C#桌面程序希望使用语音识别 将语音转成文字有很多方法
使用讯飞变得比较麻烦,主要是因为所有平台都需要用sdk,不知道是不是不能用web调用(没有研究,按道理应该有。。。)
下面在使用百度的语音识别来完成这个工作,主要代码来自网友,我写成了类(具体从哪里来的我忘了,在此感谢)
找到原作者 http://www.cnblogs.com/bfyx/p/3915297.html
下面是我改写的音频转文字的类,由于返回json,所以用了json.net来解析返回结果,类前面的token和apikey需要自己去申请百度语音识别
传送门 http://yuyin.baidu.com
using System;
using System.Text;
using System.Net;
using System.IO;
using Newtonsoft.Json.Linq;
namespace TestBaiDuAudio2Txt
{
public class AudioToString
{
string token = "";//你自己注册百度语音识别所建立的app给的
string apiKey = "";//同上
string secretKey = "";<span style="font-family: Arial, Helv