3
3304xfq
Unregistered / Unconfirmed
GUEST, unregistred user!
OK的话,另开贴子给分,这里的100分用来给顶贴的人
Recognizer:=TSpInProcRecoContext.Create(self);
Recognizer.OnRecognition:=Recognition; //处理结果值的过程
CreateGrammar:=Recognizer.CreateGrammar(0);
recognizer.Recognizer.AudioInputStream:=SpFileStream1.DefaultInterface; //如果是文件就是SpFileStream1.DefaultInterface (SpFileStream1.open(fn,0,false);
Recognizer.EventInterests:= SREAllEvents;
CreateGrammar.DictationUnload;
CreateGrammar.DictationSetState(1)
这里是初始化的代码
------------------
//下面怎么处理SpMemoryStream1
var
f:TFileStream;
buff:array of byte;
begin
f:=TFilestream.creaet('c:/aa.wav',fmOpenRead); //本来应该是采集卡上来的PCM声音,不过这里可以wave文件模拟一下
f.read(buff[0],1024*1024);
SpMemoryStream1.write(buff);
不一定要用SpMemoryStream1的方法,网上找不到例子,我只是看sapi猜的,
SpeechLib_TLB:
C:/Program Files/Common Files/Microsoft Shared/Speech/sapi.dll
speechsdk从microsoft.com/speechsdk上下载
我主要是想处理采集卡上来的声音数据,进行识别(PCM格式)
Recognizer:=TSpInProcRecoContext.Create(self);
Recognizer.OnRecognition:=Recognition; //处理结果值的过程
CreateGrammar:=Recognizer.CreateGrammar(0);
recognizer.Recognizer.AudioInputStream:=SpFileStream1.DefaultInterface; //如果是文件就是SpFileStream1.DefaultInterface (SpFileStream1.open(fn,0,false);
Recognizer.EventInterests:= SREAllEvents;
CreateGrammar.DictationUnload;
CreateGrammar.DictationSetState(1)
这里是初始化的代码
------------------
//下面怎么处理SpMemoryStream1
var
f:TFileStream;
buff:array of byte;
begin
f:=TFilestream.creaet('c:/aa.wav',fmOpenRead); //本来应该是采集卡上来的PCM声音,不过这里可以wave文件模拟一下
f.read(buff[0],1024*1024);
SpMemoryStream1.write(buff);
不一定要用SpMemoryStream1的方法,网上找不到例子,我只是看sapi猜的,
SpeechLib_TLB:
C:/Program Files/Common Files/Microsoft Shared/Speech/sapi.dll
speechsdk从microsoft.com/speechsdk上下载
我主要是想处理采集卡上来的声音数据,进行识别(PCM格式)