2010-11-18 25 views
1

Bir AIR 2 uygulamasından Festival text to speech çalıştırmaya çalışıyorum.Flex4'ten Festival TTS'yi çalıştırmak için öneriler Adobe AIR uygulaması

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

veya böyle Festivali başlatmak: Burada

notepad

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

Ben düğmesi tıklandığında çalıştırmak istediğiniz komutu başlangıç ​​için örnek bir kod burada

c:\FestivalTTS>festival.exe --pipe 

ve sonra Festival komut isteminde

yazın
(SayText "Hello world.") 

cevap

0

Dokümanları oku, kural koydular. NativeProcess 'standardInput ve standardOutput kullanarak işlemlerle iletişim kurabilirsiniz. Bakınız sample.

+0

nasıl olabilir NativeProcessStartupInfo I boru komutları c: \ FestivalTTS> echo "Merhaba dünya" | festival - tt – iceman

İlgili konular