TextToSpeechStartLang(3dtk)

Name

TextToSpeechStartLang - Loads a specified installed language into the DECtalk Multi-Language (ML) engine.

Syntax
    unsigned int TextToSpeechStartLang (char *lang)

Parameters

char *lang
    Specifies the language to load; passed as a null-terminated string containing the two-character language ID.

Description

This function checks whether a specified language is installed and, if so, loads the language into the DECtalk ML engine. TextToSpeechStartLang() must be called before a language can be selected and opened in a multi-language application.

Return Values

This function returns a value of type unsigned int. On success, the value is a handle to the loaded language. On failure, the value has the TTS_LANG_ERROR bit set.

If the TTS_LANG_ERROR bit is set, the return value is either TTS_NOT_SUPPORTED, indicating the application is not running DECtalk ML, or TTS_NOT_AVAILABLE, indicating the requested language is not installed.

NOTE: The TextToSpeechStartLang() and TextToSpeechSelectLang() functions do not return MMRESULT status values in the manner of the TextToSpeechSetLanguage() function they replace. See the example of TextToSpeechStartLang() error checking provided below.

Example
    BOOL start_us (void) {
        unsigned int handle;

        handle = TextToSpeechStartLang ("us");
        if (handle & TTS_LANG_ERROR) {
            if (handle == TTS_NOT_SUPPORTED)
                printf ("DECtalk ML was not found. \n");
            else if (handle == TTS_NOT_AVAILABLE)
                printf ("English is not currently installed. \n");
            else
                printf ("An unknown error has occurred. \n");
            return FALSE;
        }
        return TRUE;
    }

See Also

TextToSpeechCloseLang(3dtk), TextToSpeechEnumLangs(3dtk), TextToSpeechSelectLang(3dtk)