亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? speech synthesis & speech recognition using sapi 5_1.htm

?? softonline.dll中函數(shù)的使用,請(qǐng)見不同的例程,VB函數(shù)見VB例子,VC函數(shù)見VC例子,VFP函數(shù)見VFP的例子,BCB函數(shù)見BCB例子, Delphi函數(shù)見Delphi例子
?? HTM
?? 第 1 頁 / 共 5 頁
字號(hào):
<P>The SAPI 5.1 SDK comes with a C++ example called TTSApp, which displays an 
animated cartoon microphone whose mouth is drawn to represent each viseme. The 
microphone is made up from a number of separate images that can all be loaded 
into an image list. The additional <A 
href="http://www.blong.com/Conferences/DCon2002/Speech/SAPI51/SAPI51.zip">demo 
program</A> TextToSpeechAnimated.dpr makes use of these images to show how the 
effect can be achieved.</P>
<TABLE bgColor=white border=1>
  <TBODY>
  <TR>
    <TD><PRE><CODE><FONT color=black size=2>
<B>const</B>
  Visemes: <B>array</B>[0..21] <B>of</B> Byte = (
   	0,  <FONT color=#003399><I>// SP_VISEME_0 = 0,    // Silence</I></FONT>
    11, <FONT color=#003399><I>// SP_VISEME_1,        // AE, AX, AH</I></FONT>
    11, <FONT color=#003399><I>// SP_VISEME_2,        // AA</I></FONT>
    11, <FONT color=#003399><I>// SP_VISEME_3,        // AO</I></FONT>
    10, <FONT color=#003399><I>// SP_VISEME_4,        // EY, EH, UH</I></FONT>
    11, <FONT color=#003399><I>// SP_VISEME_5,        // ER</I></FONT>
    9,  <FONT color=#003399><I>// SP_VISEME_6,        // y, IY, IH, IX</I></FONT>
    2,  <FONT color=#003399><I>// SP_VISEME_7,        // w, UW</I></FONT>
    13, <FONT color=#003399><I>// SP_VISEME_8,        // OW</I></FONT>
    9,  <FONT color=#003399><I>// SP_VISEME_9,        // AW</I></FONT>
    12, <FONT color=#003399><I>// SP_VISEME_10,       // OY</I></FONT>
    11, <FONT color=#003399><I>// SP_VISEME_11,       // AY</I></FONT>
    9,  <FONT color=#003399><I>// SP_VISEME_12,       // h</I></FONT>
    3,  <FONT color=#003399><I>// SP_VISEME_13,       // r</I></FONT>
    6,  <FONT color=#003399><I>// SP_VISEME_14,       // l</I></FONT>
    7,  <FONT color=#003399><I>// SP_VISEME_15,       // s, z</I></FONT>
    8,  <FONT color=#003399><I>// SP_VISEME_16,       // SH, CH, JH, ZH</I></FONT>
    5,  <FONT color=#003399><I>// SP_VISEME_17,       // TH, DH</I></FONT>
    4,  <FONT color=#003399><I>// SP_VISEME_18,       // f, v</I></FONT>
    7,  <FONT color=#003399><I>// SP_VISEME_19,       // d, t, n</I></FONT>
    9,  <FONT color=#003399><I>// SP_VISEME_20,       // k, g, NG</I></FONT>
    1   <FONT color=#003399><I>// SP_VISEME_21,       // p, b, m</I></FONT>
  );

<B>procedure</B> TfrmTextToSpeech.SpVoiceViseme(Sender: TObject;
  StreamNumber: Integer; StreamPosition: OleVariant; Duration: Integer;
  NextVisemeId, Feature, CurrentVisemeId: TOleEnum);
<B>const</B>
  EyesNarrow = 14;
  EyesClosed = 15;
<B>begin</B>
  imgsMic.Draw(pbMic.Canvas, 0, 0, Visemes[CurrentVisemeId]);
  <B>if</B> Visemes[CurrentVisemeId] <B>mod</B> 6 = 2 <B>then</B>
    imgsMic.Draw(pbMic.Canvas, 0, 0, EyesNarrow)
  <B>else</B>
    <B>if</B> Visemes[CurrentVisemeId] <B>mod</B> 6 = 5 <B>then</B>
      imgsMic.Draw(pbMic.Canvas, 0, 0, EyesClosed);
<B>end</B>;

<B>procedure</B> TfrmTextToSpeech.pbMicPaint(Sender: TObject);
<B>begin</B>
  imgsMic.Draw(pbMic.Canvas, 0, 0, 0);
<B>end</B>;
</FONT></CODE></PRE></TD></TR></TBODY></TABLE>
<P>The <FONT face="Courier New, Courier, mono">OnViseme</FONT> event gets the 
image list to draw on a paint box component and the image to draw is identified 
from a simple lookup table. There are 22 different visemes, but only 13 images 
(as in the Disney approach). Occasionally the code also draws narrowed or closed 
eyes, but whenever the silence viseme is received (at the start and end of each 
sentence) the default microphone (the first image in the image list) is 
drawn.</P>
<P align=center><IMG 
src="Speech Synthesis &amp; Speech Recognition Using SAPI 5_1.files/TextToSpeechAnimated.png"></P>
<P>You can take this idea further if you need, by using images of a person's 
face saying each of the 22 visemes (for real people it seems to work best if you 
use 22 images, rather than 13). This way you can animate a real person's face in 
sync with the spoken text quite trivially.</P>
<P align=center><IMG 
src="Speech Synthesis &amp; Speech Recognition Using SAPI 5_1.files/TextToSpeechAnimatedReal.png"></P>
<H3><A name=KeepingTrack>Keeping Track Of Spoken Text</A></H3>
<P>We can use <FONT face="Courier New, Courier, mono">OnWord</FONT> and <FONT 
face="Courier New, Courier, mono">OnSentence</FONT> to highlight the currently 
spoken work or sentence, as the events provide the character offset and length 
of the pertinent characters in the text. So when a sentence is started, the 
<FONT face="Courier New, Courier, mono">OnSentence</FONT> event tells you which 
character in the text is the start of the sentence, and also how long the 
sentence is.</P>
<TABLE bgColor=white border=1>
  <TBODY>
  <TR>
    <TD><PRE><CODE><FONT color=black size=2>
<B>procedure</B> TfrmTextToSpeech.SetTextHilite(FirstChar, Len: Integer);
<B>begin</B>
  reText.SelStart := FirstChar; <FONT color=#003399><I>//highlight word</I></FONT>
  reText.SelLength := Len;
<B>end</B>;

<B>procedure</B> TfrmTextToSpeech.SetTextStyle(FirstChar, Len: Integer; Styles: TFontStyles);
<B>begin</B>
  <B>with</B> reText <B>do</B>
  <B>begin</B>
    Lines.BeginUpdate;
    <B>try</B>
      SelStart := FirstChar; <FONT color=#003399><I>//highlight word</I></FONT>
      SelLength := Len;
      SelAttributes.Style := Styles; <FONT color=#003399><I>//apply requested style</I></FONT>
      SelLength := 0; <FONT color=#003399><I>//unhighlight word</I></FONT>
    <B>finally</B>
      Lines.EndUpdate
    <B>end</B>
  <B>end</B>
<B>end</B>;

<B>procedure</B> TfrmTextToSpeech.SpVoiceSentence(Sender: TObject;
  StreamNumber: Integer; StreamPosition: OleVariant; CharacterPosition,
  Length: Integer);
<B>begin</B>
  Log(<I>'OnSentence: stream %d, position: %s, char. pos. %d, length %d'</I>,
    [StreamNumber, <B>String</B>(StreamPosition), CharacterPosition, Length]);
  SetTextStyle(OldSentencePos, OldSentenceLen, []);
  <B>if</B> Length &gt; 0 <B>then</B>
  <B>begin</B>
    SetTextStyle(CharacterPosition, Length, [fsItalic]);
    OldSentencePos := CharacterPosition;
    OldSentenceLen := Length;
  <B>end</B>;
  <B>if</B> <B>not</B> StreamJustStarted <B>then</B>
    memEnginePhonemes.Text := memEnginePhonemes.Text + #13#10;
  StreamJustStarted := False;
<B>end</B>;

<B>procedure</B> TfrmTextToSpeech.SpVoiceWord(Sender: TObject;
  StreamNumber: Integer; StreamPosition: OleVariant; CharacterPosition,
  Length: Integer);
<B>begin</B>
  Log(<I>'OnWord: stream %d, position: %s, char. pos. %d, length %d'</I>,
    [StreamNumber, <B>String</B>(StreamPosition), CharacterPosition, Length]);
  SetTextHilite(CharacterPosition, Length);
<B>end</B>;
</FONT></CODE></PRE></TD></TR></TBODY></TABLE>
<P>Each sentence that gets spoken is italicised through the <FONT 
face="Courier New, Courier, mono">SetTextStyle</FONT> helper routine (which 
records the position details so the sentence can be set back to non-italic when 
the next sentence starts). Similarly, each spoken word is highlighted using the 
<FONT face="Courier New, Courier, mono">SetTextHilite</FONT> helper routine.</P>
<P><U><B>Note:</B></U> the comment in the <FONT 
face="Courier New, Courier, mono">OnSentence</FONT> event handler points out 
that the last <FONT face="Courier New, Courier, mono">OnSentence</FONT> event 
for some text has the character position set to the last character and the 
length set to the negative equivalent. This gives an opportunity to reset all 
the text formatting back to the default styles. However it is only true if the 
text ends with a full stop; if not you can use the <FONT 
face="Courier New, Courier, mono">OnEndStream</FONT> event for tidying up.</P>
<H3><A name=SpeakingDialogs>Speaking Dialogs</A></H3>
<P>As an example of using speech synthesis you can make all your VCL dialogs 
talk to you using this small piece of code.</P>
<TABLE bgColor=white border=1>
  <TBODY>
  <TR>
    <TD><PRE><CODE><FONT color=black size=2>
<B>uses</B>
  ComObj;

<B>var</B>
  Voice: Variant;

<B>procedure</B> TForm1.FormCreate(Sender: TObject);
<B>begin</B>
  Screen.OnActiveFormChange := ScreenFormChange;
<B>end</B>;

<B>procedure</B> TForm1.ReadVCLDialog(Form: TCustomForm);
<B>var</B>
  I: Integer;
  ButtonCaptions, LabelCaption, DialogText: <B>string</B>;
<B>const</B>
  SVSFlagsAsync = 1;
<B>begin</B>
  <B>try</B>
    <B>if</B> VarType(Voice) &lt;&gt; varDispatch <B>then</B>
      Voice := CreateOleObject(<I>'SAPI.SpVoice'</I>);
    <B>for</B> I := 0 <B>to</B> Form.ComponentCount - 1 <B>do</B>
      <B>if</B> Form.Components[I] <B>is</B> TLabel <B>then</B>
        LabelCaption := TLabel(Form.Components[I]).Caption
      <B>else</B>
        <B>if</B> Form.Components[I] <B>is</B> TButton <B>then</B>
          ButtonCaptions := Format(<I>'%s%s, '</I>,
            [ButtonCaptions, TButton(Form.Components[I]).Caption]);
    ButtonCaptions := StringReplace(ButtonCaptions,<I>'&amp;'</I>,<I>''</I>, [rfReplaceAll]);
    DialogText := Format(<I>'%s.%s%s.%s%s'</I>,
      [Form.Caption, sLineBreak, LabelCaption, sLineBreak, ButtonCaptions]);
    Memo1.Text := DialogText;
    Voice.Speak(DialogText, SVSFlagsAsync)
  <B>except</B>
    <FONT color=#003399><I>//pretend everything is okay</I></FONT>
  <B>end</B>
<B>end</B>;

<B>procedure</B> TForm1.ScreenFormChange(Sender: TObject);
<B>begin</B>
  <B>if</B> Assigned(Screen.ActiveForm) <B>and</B>
     (Screen.ActiveForm.ClassName = <I>'TMessageForm'</I>) <B>then</B>
    ReadVCLDialog(Screen.ActiveForm)
<B>end</B>;
</FONT></CODE></PRE></TD></TR></TBODY></TABLE>
<P>The form's <FONT face="Courier New, Courier, mono">OnCreate</FONT> event 
handler sets up an <FONT 
face="Courier New, Courier, mono">OnActiveFormChange</FONT> event handler for 
the screen object. This is triggered each time a new form is displayed, which 
includes VCL dialogs. Any call to <FONT 
face="Courier New, Courier, mono">ShowMessage</FONT>, <FONT 
face="Courier New, Courier, mono">MessageDlg</FONT> or related routines causes a 
<FONT face="Courier New, Courier, mono">TMessageForm</FONT> to be displayed so 
the code checks for this. If the form type is found, a textual version of what's 
on the dialog is built up and then spoken through the SAPI Automation 
component.</P>
<P>A statement such as:</P>
<TABLE bgColor=white border=1>
  <TBODY>
  <TR>
    <TD><PRE><CODE><FONT color=black size=2>
MessageDlg(<I>'Save changes?'</I>, mtConfirmation, mbYesNoCancel, 0)
</FONT></CODE></PRE></TD></TR></TBODY></TABLE>
<P>causes the <FONT face="Courier New, Courier, mono">ReadVCLDialog</FONT> 
routine to build up and say this text:</P>
<TABLE bgColor=white border=1>
  <TBODY>
  <TR>
    <TD><PRE><CODE><FONT color=black size=2>
Confirm.
Save changes?.
Yes, No, Cancel,
</FONT></CODE></PRE></TD></TR></TBODY></TABLE>
<P>Notice the full stops at the end of each line to briefly pause the speech 
engine at that point before moving on.</P>
<H2><A name=SR>Speech Recognition</A></H2>
<P>Continuous dictation is easy to set up as no specific grammar is required, 
but Command and Control recognition will need a grammar to educate the 
recogniser as to the permissible commands.</P>
<P>When you need SR you can either use a shared recogniser (<FONT 
face="Courier New, Courier, mono">TSpSharedRecognizer</FONT>) or an in-process 
recogniser (<FONT face="Courier New, Courier, mono">TSpInprocRecognizer</FONT>). 
The in-process recogniser is more efficient (it resides in your process address 
space) but means that no other SR applications can receive input from the 
microphone until it is closed down. On the other hand the shared recogniser can 
be used by multiple applications, and each one can access the microphone. It is 
more common to use the shared recogniser in typical SAPI applications.</P>
<P>The recogniser uses the notion of a <I>recognition context</I> to identify 
when it will be active (not to be confused with the use of context in a 
context-free grammar or CFG). A context is represented by the <FONT 
face="Courier New, Courier, mono">TSpInprocRecoContext</FONT> or <FONT 
face="Courier New, Courier, mono">TSpSharedRecoContext</FONT> interfaces. An 
application may use one context for each form that will use SR, or several 
contexts for different application modes (Office XP has a dictation mode for 
adding text to a document and a control mode for executing menu commands).</P>
<P>Recognition contexts enable you to start and stop recognition, set up the 
grammar and receive important recognition notifications.</P>
<H3><A name=Grammars>Grammars</A></H3>

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕免费在线观看视频一区| 免费av网站大全久久| 亚洲高清三级视频| 国产精品66部| 欧美精品久久99| 亚洲日穴在线视频| 国产黄色精品视频| 91.xcao| 中文字幕亚洲区| 蜜桃av一区二区三区电影| 色综合视频在线观看| 日本一区二区三区国色天香 | 亚洲精品国产a| 国产激情一区二区三区四区 | 中文字幕一区视频| 久久精品国产成人一区二区三区 | 亚洲国产精品二十页| 免费看日韩精品| 777xxx欧美| 日韩精品国产精品| 色视频欧美一区二区三区| 中文字幕第一区第二区| 激情五月婷婷综合| 精品久久久久久久久久久久久久久| 亚洲成人免费在线观看| 欧美伊人久久久久久午夜久久久久| 国产精品视频九色porn| 国产酒店精品激情| 久久精品亚洲国产奇米99| 精品一区二区影视| 欧美刺激脚交jootjob| 蜜桃视频免费观看一区| 欧美电视剧免费观看| 久久99国内精品| www精品美女久久久tv| 国产一区福利在线| 国产日韩欧美综合在线| 成人av第一页| 一区二区三区国产精品| 欧美在线观看视频在线| 视频一区二区欧美| 日韩精品影音先锋| 精品在线免费视频| 欧美极品aⅴ影院| 成人免费不卡视频| 亚洲欧美另类久久久精品| 欧美影视一区在线| 毛片不卡一区二区| 国产欧美在线观看一区| 不卡的av电影在线观看| 一区二区三区资源| 欧美一级高清大全免费观看| 国产在线一区二区| 国产精品国产三级国产aⅴ中文 | 欧美性大战久久久久久久蜜臀| 亚洲影视在线播放| 日韩视频免费观看高清在线视频| 麻豆精品国产91久久久久久| 国产女人水真多18毛片18精品视频| av在线一区二区| 天天综合色天天综合| 2024国产精品| 91在线视频观看| 免播放器亚洲一区| 亚洲色图在线播放| 日韩一区二区三免费高清| 成人午夜精品在线| 五月天亚洲精品| 国产欧美一区二区精品性色| 91福利视频网站| 国产一区二区三区久久久| 亚洲欧美日韩一区二区三区在线观看| 欧美肥妇free| 91小视频在线| 久久超碰97中文字幕| 亚洲自拍都市欧美小说| 精品国产一区二区三区久久久蜜月| 成人爱爱电影网址| 久久国产乱子精品免费女| 亚洲人成人一区二区在线观看| 精品日韩在线一区| 在线观看av一区二区| 国产精品88888| 免费成人你懂的| 亚洲一区二区三区三| 国产精品视频免费| 精品美女一区二区| 欧美美女视频在线观看| 99精品视频在线免费观看| 精品一区二区三区视频 | 精品一区二区三区的国产在线播放| 亚洲丝袜制服诱惑| 久久免费视频一区| 日韩欧美在线一区二区三区| 欧美中文字幕一区| 91在线一区二区| a4yy欧美一区二区三区| 国产一区二区在线观看视频| 热久久国产精品| 午夜影院久久久| 亚洲国产精品久久不卡毛片 | 国产欧美日韩麻豆91| 日韩精品一区二区三区视频在线观看| 91九色最新地址| 色婷婷综合久色| 成人黄色免费短视频| 国产一区在线观看视频| 韩国欧美国产一区| 美女网站色91| 麻豆精品在线播放| 亚洲高清免费视频| 亚洲午夜免费电影| 亚洲制服丝袜在线| 亚洲综合久久av| 一区二区三区中文在线| 亚洲色图制服诱惑| 亚洲制服欧美中文字幕中文字幕| 中文字幕一区二区三区不卡在线| 国产日韩欧美精品综合| 欧美经典一区二区三区| 欧美极品aⅴ影院| 亚洲欧洲日产国码二区| 自拍偷拍亚洲欧美日韩| 一区二区三区在线视频观看 | 亚洲欧美日韩一区二区| 一区二区三区精品在线| 午夜电影一区二区| 免费看日韩精品| 国产精品自拍三区| 国产传媒日韩欧美成人| 白白色 亚洲乱淫| 色综合中文字幕国产 | 亚洲男人的天堂在线观看| 亚洲女同ⅹxx女同tv| 亚洲国产日韩一区二区| 麻豆精品国产91久久久久久| 国产精品一二三四五| 91视频免费观看| 制服丝袜av成人在线看| 亚洲精品在线一区二区| 中文字幕av不卡| 亚洲一区二区四区蜜桃| 蜜桃视频在线观看一区| 99这里只有久久精品视频| 在线观看欧美日本| 91精品国产综合久久蜜臀| 久久久99精品免费观看不卡| 亚洲黄色录像片| 久久国产剧场电影| 色婷婷久久综合| 精品国产一区二区三区久久影院 | 奇米777欧美一区二区| 国产成人一级电影| 欧美亚洲高清一区二区三区不卡| 欧美一三区三区四区免费在线看 | 日韩高清不卡在线| 岛国一区二区在线观看| 欧美在线观看18| 国产欧美日韩综合精品一区二区| 亚洲国产视频a| 国v精品久久久网| 日韩精品自拍偷拍| 亚洲免费观看高清| 国产一区二区三区精品视频| 欧美视频一区二区三区在线观看| 欧美精品一区二区不卡| 亚洲成人你懂的| 9久草视频在线视频精品| 精品国内片67194| 亚洲精品久久久蜜桃| 国产成人av影院| xnxx国产精品| 美国三级日本三级久久99| 欧美三级日韩三级| 国产精品美女久久久久高潮| 蜜桃久久久久久| 欧美视频精品在线观看| 中文文精品字幕一区二区| 久久99精品久久久久久动态图| 精品视频在线看| 亚洲精品免费在线观看| 99久久免费精品| 国产精品久久久久久久午夜片| 国产揄拍国内精品对白| 欧美www视频| 日本不卡中文字幕| 欧美日韩精品电影| 夜色激情一区二区| 不卡的av中国片| 亚洲色图一区二区三区| 成av人片一区二区| 国产精品网站在线播放| 国产精品99久久久久久宅男| 欧美v日韩v国产v| 韩国av一区二区三区在线观看| 91麻豆精品国产| 丝袜脚交一区二区| 欧美一区二区在线观看| 日韩影视精彩在线| 日韩亚洲欧美综合|