2012-11-25 48 views
1

我想在Ubuntu上使用Julius。幾個小時後,我終於開始工作了。在Julius語音識別上觸發腳本或外部程序

基本上,我需要它做的唯一事情就是當它識別某個單詞(例如「computer」)時觸發一個腳本。這是主要問題。什麼是最好的方式來做到這一點?

而且好像我不能設法在 「安靜」 模式下運行朱利葉斯·

$ julius -quiet -input mic -C julian.jconf 2>/dev/null 

還輸出了太多的信息:

    .......... 
      reject short input = off 

----------------------- System Information end ----------------------- 

    ************************************************************* 
    * NOTICE: The first input may not be recognized, since  * 
    *   no initial CMN parameter is available on startup. * 
    * for MFCC01* 
    ************************************************************* 

Stat: capture audio at 16000Hz

Stat: adin_alsa: latency set to 32 msec (chunk = 512 bytes)

Error: adin_alsa: unable to get pcm info from card control

Warning: adin_alsa: skip output of detailed audio device info

STAT: AD-in thread created

Warning: strip: sample 0-27 has zero value, stripped

pass1_best: DOWarning: strip: sample 192-444 has zero value, stripped

pass1_best: DO PLAY

sentence1: DO PLAY

pass1_best:

sentence1: DO PLAY

pass1_best:Warning: strip: sample 406-436 has zero value, stripped

.... 

等上。

有什麼建議嗎?

+1

我處於相同的情況。你找到了路嗎? – user1573607

+0

是。是否通過php:julius -input mic -C /var/www/julius-grammar/julian.jconf -quiet | php /var/www/index.php主要julius –

回答

0

通常,我們將從腳本中調用Julius,將Julius的輸出讀入一個變量,在該變量中我們可以隱藏所有內容並僅提取使用子字符串和切片所需的內容。通過這種方式,您可以使用適合您的目的的任何應用程序(例如PHP,Julia,Python等)構建被稱爲「對話管理器」的對象,並根據Julius認爲它從switchif .. then .. else結構中聽到的內容採取措施。

一個簡單的方法是使用一個無限循環,它只能在諸如「COMPUTER QUIT」或類似的命令上退出。

如果您收到很多nostrip警告,julius選項-nostrip會很有幫助。

一旦你有了一定的經驗與julius真的是有幫助的在服務器模式下運行julius,它可以讓你有效地控制julius更不必(文檔[多條鏈路提供https://github.com/julius-speech/julius]與樣本應用程序一起中所述)在識別事件之間重新加載。此外julius將以XML格式發送響應,以便您可以可靠地使用對話管理器內的測試XML讀取器讀取輸出。