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. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
getting_20the_20current_20voice.txt · Last modified: 2024/01/05 00:22 by 127.0.0.1