Esempio n. 1
0
        private void Init(string lang)
        {
            _callback     = TtsCallback;
            _buffer       = null;
            _bufferStream = null;

            if (lang != LanguageCode.None)
            {
                var langid = TextToSpeechStartLang(lang);

                if ((langid & TtsLangError) != 0)
                {
                    switch (langid)
                    {
                    case TtsNotSupported:
                        throw new FonixTalkException("This version of DECtalk does not support multiple languages.");

                    case TtsNotAvailable:
                        throw new FonixTalkException("The specified language was not found.");
                    }
                }

                if (!TextToSpeechSelectLang(IntPtr.Zero, langid))
                {
                    throw new FonixTalkException("The specified language failed to load.");
                }
            }

            Check(TextToSpeechStartupEx(out _handle, 0xFFFFFFFF, 0, _callback, ref _handle));

            Speak("[:phone on]"); // Enable singing by default
        }
Esempio n. 2
0
 static extern MMRESULT TextToSpeechStartupEx(
     out IntPtr handle,
     uint uiDeviceNumber,
     uint dwDeviceOptions,
     DtCallbackRoutine callback,
     ref IntPtr dwCallbackParameter);
Esempio n. 3
0
        private void Init(string lang)
        {
            _callback = TtsCallback;
            _buffer = null;
            _bufferStream = null;

            if (lang != LanguageCode.None)
            {
                var langid = TextToSpeechStartLang(lang);

                if ((langid & TtsLangError) != 0)
                {
                    switch (langid)
                    {
                        case TtsNotSupported:
                            throw new FonixTalkException("This version of DECtalk does not support multiple languages.");
                        case TtsNotAvailable:
                            throw new FonixTalkException("The specified language was not found.");
                    }
                }

                if (!TextToSpeechSelectLang(IntPtr.Zero, langid))
                {
                    throw new FonixTalkException("The specified language failed to load.");
                }
            }

            Check(TextToSpeechStartupEx(out _handle, 0xFFFFFFFF, 0, _callback, ref _handle));

            Speak("[:phone on]"); // Enable singing by default
        }
Esempio n. 4
0
 static extern MMRESULT TextToSpeechStartupEx(
     out IntPtr handle,
     uint uiDeviceNumber,
     uint dwDeviceOptions,
     DtCallbackRoutine callback,
     ref IntPtr dwCallbackParameter);