User Tools

Site Tools


getting_20the_20current_20voice

Getting the current voice

by Richard Russell, March 2013

This article is specific to the SAPI5 speech system, typically installed on Windows 2000, XP and later

The code below can be used to discover the currently selected voice name:

        voice$ = FN_getvaluestr(tts%, "Voice.GetDescription")

Where tts% is the value returned from “FN_createobject(“Sapi.SpVoice”)”.

Here is a self-contained program illustrating its use:

        INSTALL @lib$+"COMLIBA"
 
        ON ERROR PROC_comexit : PRINT 'REPORT$ : END
        ON CLOSE PROC_comexit : QUIT
        PROC_cominit
 
        tts% = FN_createobject("Sapi.SpVoice")
        IF tts%=0 ERROR 100, "SAPI5 is not available"
 
        voice$ = FN_getvaluestr(tts%, "Voice.GetDescription")
        PRINT voice$
 
        PROC_releaseobject(tts%)
        PROC_comexit
        END
This website uses cookies for visitor traffic analysis. By using the website, you agree with storing the cookies on your computer.More information
getting_20the_20current_20voice.txt · Last modified: 2018/04/15 12:51 by richardrussell