Предложения по запуску Festival TTS из приложения Flex4 Adobe AIR - PullRequest
1 голос
/ 18 ноября 2010

Я пытаюсь запустить Праздничный текст в речь из приложения AIR 2.

Вот пример кода для запуска блокнота

<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" 
                       xmlns:s="library://ns.adobe.com/flex/spark" 
                       xmlns:mx="library://ns.adobe.com/flex/mx" width="1024" height="768">

    <fx:Script>
        <![CDATA[
            protected function button1_clickHandler(event:MouseEvent):void
            {
                var exe:File = new File("c:/Windows/notepad.exe");
                var nativeProcess:NativeProcess = new NativeProcess();
                var nativeProcessStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();
                nativeProcessStartupInfo.executable = exe;
                var args:Vector.<String> = new Vector.<String>(); 
                args.push("e:/temp/Hello.txt");
                nativeProcessStartupInfo.arguments = args;
                nativeProcess.start(nativeProcessStartupInfo);
            }
        ]]>
    </fx:Script>

    <fx:Declarations>
        <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <s:Button x="265" y="236" label="Hello Button" width="465" height="131" fontSize="30" click="button1_clickHandler(event)"/>
</s:WindowedApplication>

Команда, котораяЯ хочу запустить по нажатию кнопки здесь:

c:\FestivalTTS>echo "Hello world" | festival --tts

или запустить фестиваль, как это:

c:\FestivalTTS>festival.exe --pipe

, а затем введите следующее в командной строке фестиваля

(SayText "Hello world.")

1 Ответ

0 голосов
/ 18 ноября 2010

Читайте документы, они правят.Вы можете общаться с процессом, используя NativeProcess 'standardInput и standardOutput.См. образец .

...