【问题标题】:Suggestions for running Festival TTS from Flex4 Adobe AIR application从 Flex4 Adob​​e AIR 应用程序运行 Festival TTS 的建议
【发布时间】:2010-11-18 10:33:50
【问题描述】:

我正在尝试从 AIR 2 应用程序运行 Festival text to speech

这是一个启动记事本的示例代码

<?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

然后在 Festival 命令提示符中键入以下内容

(SayText "Hello world.")

【问题讨论】:

    标签: apache-flex air flex4 mxml festival


    【解决方案1】:

    阅读文档,他们统治。您可以使用NativeProcess'standardInput 和standardOutput 与进程通信。见sample

    【讨论】:

    • 如何将 NativeProcessStartupInfo 中的命令传递为 c:\FestivalTTS>echo "Hello world" |节日--tts
    猜你喜欢
    • 1970-01-01
    • 2012-02-04
    • 1970-01-01
    • 2010-10-17
    • 2010-10-26
    • 2013-06-07
    • 2011-01-14
    • 2011-02-12
    • 1970-01-01
    相关资源
    最近更新 更多