User Tools

Site Tools


asynchronous_20speech

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Last revision Both sides next revision
asynchronous_20speech [2018/03/31 13:19]
127.0.0.1 external edit
asynchronous_20speech [2018/04/15 12:49]
richardrussell Added syntax highlighting
Line 1: Line 1:
 =====Asynchronous speech===== =====Asynchronous speech=====
  
-//by Richard Russell, October 2016//\\ \\  The supplied example program **SPEAK.BBC** outputs the speech synchronously,​ that is **PROCspeak()** does not return to the caller until the speech output is complete. That will often be what is wanted, but in some circumstances you may wish to get on with doing something else while a phrase is being spoken. The programs below illustrate how that may be achieved; the first uses the **ActiveX** (COM automation) approach used in SPEAK.BBC and the second uses direct calls to the **SAPI5 COM objects**.\\ \\ +//by Richard Russell, October 2016//\\ \\  The supplied example program **SPEAK.BBC** outputs the speech synchronously,​ that is **PROCspeak()** does not return to the caller until the speech output is complete. That will often be what is wanted, but in some circumstances you may wish to get on with doing something else while a phrase is being spoken. The programs below illustrate how that may be achieved; the first uses the **ActiveX** (COM automation) approach used in SPEAK.BBC and the second uses direct calls to the **SAPI5 COM objects**. 
 + 
 ===== ActiveX method ===== ===== ActiveX method =====
-\\  ​The **PROCspeakasync()** routine returns immediately and the **FNisspeaking()** function allows the current status to be polled so you can discover when the speech is finished:\\ \\ + 
 +The **PROCspeakasync()** routine returns immediately and the **FNisspeaking()** function allows the current status to be polled so you can discover when the speech is finished: 
 + 
 +<code bb4w>
         REM. Text-to-speech demonstration program using COMLIB         REM. Text-to-speech demonstration program using COMLIB
         REM. R.T.Russell,​ 24-Apr-2007         REM. R.T.Russell,​ 24-Apr-2007
Line 49: Line 53:
         DEF FNisspeaking(tts%)         DEF FNisspeaking(tts%)
         = FN_getvaluestr(tts%,"​Status.RunningState"​) <> "​1"​         = FN_getvaluestr(tts%,"​Status.RunningState"​) <> "​1"​
-\\ +</​code>​ 
 + 
 ===== COM object method ===== ===== COM object method =====
-\\  ​The **PROC_voice_speak()** routine returns immediately and the **FN_voice_status()** function allows the current status to be polled so you can discover when the speech is finished:\\ \\ + 
 +The **PROC_voice_speak()** routine returns immediately and the **FN_voice_status()** function allows the current status to be polled so you can discover when the speech is finished: 
 + 
 +<code bb4w>
         REM. Text-to-speech demonstration program: asynchronous         REM. Text-to-speech demonstration program: asynchronous
         REM. Richard Russell, 18-Apr-2012         REM. Richard Russell, 18-Apr-2012
Line 116: Line 125:
         SYS !(!V%+8), V%         SYS !(!V%+8), V%
         ENDPROC         ENDPROC
 +</​code>​
asynchronous_20speech.txt · Last modified: 2019/03/31 21:41 by richardrussell