User Tools

Site Tools


speaking_20the_20contents_20of_20a_20file

Differences

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

Link to this comparison view

speaking_20the_20contents_20of_20a_20file [2018/03/31 13:19]
127.0.0.1 external edit
speaking_20the_20contents_20of_20a_20file [2018/04/15 12:54] (current)
richardrussell Added syntax highlighting
Line 1: Line 1:
 =====Speaking the contents of a file===== =====Speaking the contents of 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 speak a string (or strings) provided by your program, but what if you want to speak the contents of a text file? You could, of course, load the file into a set of strings and speak those, but the **SAPI 5** speech system (typically available in Windows 2000, XP and Vista) provides a more direct method.\\ \\  The code below speaks the text in the specified file:\\ \\ +//by Richard Russell, October 2008//\\ \\  The supplied example program **SPEAK.BBC** illustrates how you can use Windows'​ built-in speech synthesis capabilities to speak a string (or strings) provided by your program, but what if you want to speak the contents of a text file? You could, of course, load the file into a set of strings and speak those, but the **SAPI 5** speech system (typically available in Windows 2000, XP and Vista) provides a more direct method.\\ \\  The code below speaks the text in the specified file: 
 + 
 +<code bb4w> ​
         INSTALL @lib$+"​COMLIBA"​         INSTALL @lib$+"​COMLIBA"​
  
Line 14: Line 16:
         PROC_releaseobject(voice%)         PROC_releaseobject(voice%)
         PROC_comexit         PROC_comexit
 +</​code>​
 +
 The value **12** in the **PROC_callmethod** line specifies that the file may contain embedded //tags// to control parameters such as speed, volume and voice (see [[/​Setting%20speech%20parameters|this article]] for details). If you don't want such tags to be acted upon change this value to **4**. The value **12** in the **PROC_callmethod** line specifies that the file may contain embedded //tags// to control parameters such as speed, volume and voice (see [[/​Setting%20speech%20parameters|this article]] for details). If you don't want such tags to be acted upon change this value to **4**.
speaking_20the_20contents_20of_20a_20file.txt · Last modified: 2018/04/15 12:54 by richardrussell