2010-11-18 1 views
1

AIR 2 응용 프로그램에서 Festival text to speech을 실행하려고합니다.Flex4에서 TTS를 실행하기위한 제안 Adobe AIR 응용 프로그램

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

또는이 같은 축제를 시작합니다 : 여기

메모장

<?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>festival.exe --pipe 

다음 Festival 명령 프롬프트에서 다음을 입력하십시오.

(SayText "Hello world.") 

답변

0

문서를 읽으면 규칙이 적용됩니다. NativeProcess 'standardInput 및 standardOutput을 사용하여 프로세스와 통신 할 수 있습니다. sample을 참조하십시오.

+0

어떻게 NativeProcessStartupInfo의 명령을 c : \ FestivalTTS로 파이프 할 수 있습니까> echo "Hello world"| 축제 – iceman