This shows you the differences between two versions of the page.
outputting_20speech_20to_20a_20file [2018/03/31 13:19] 127.0.0.1 external edit |
outputting_20speech_20to_20a_20file [2018/04/15 12:52] richardrussell Added syntax highlighting |
||
---|---|---|---|
Line 1: | Line 1: | ||
=====Outputting speech to a file===== | =====Outputting speech to a file===== | ||
- | //by Richard Russell, October 2008//\\ \\ The supplied example program **SPEAK.BBC** illustrates how you can use Windows' built-in speech synthesis capabilities to output speech to your PC's loudspeakers, but what if you want to create a sound file containing the speech? Fortunately the **SAPI 5** speech system (typically available in Windows 2000, XP and Vista) supports this facility directly.\\ \\ The code below outputs speech to a specified WAV file:\\ \\ | + | //by Richard Russell, October 2008//\\ \\ The supplied example program **SPEAK.BBC** illustrates how you can use Windows' built-in speech synthesis capabilities to output speech to your PC's loudspeakers, but what if you want to create a sound file containing the speech? Fortunately the **SAPI 5** speech system (typically available in Windows 2000, XP and Vista) supports this facility directly.\\ \\ The code below outputs speech to a specified WAV file: |
+ | |||
+ | <code bb4w> | ||
INSTALL @lib$+"COMLIBA" | INSTALL @lib$+"COMLIBA" | ||
Line 23: | Line 25: | ||
SYS "PlaySound", file$, 0, &20001 | SYS "PlaySound", file$, 0, &20001 | ||
+ | </code> | ||
+ | |||
Note that this code requires **COMLIB** (or **COMLIBA**) version **3.3** or later, as supplied with //BBC BASIC for Windows// version 5.90a. | Note that this code requires **COMLIB** (or **COMLIBA**) version **3.3** or later, as supplied with //BBC BASIC for Windows// version 5.90a. |