Eclipse Voice Tools Project (VTP) 是 Eclipse 基金會主導的開源專案,旨在整合語音產業資源,建構一套基於標準、開放原始碼的語音應用開發工具集。VTP 建立在 Eclipse Web Tools Project (WTP) 之上,擴展其 Web 開發工具至語音識別領域,讓開發者能以相同工具流程開發視覺化與語音應用。
VTP 依賴 WTP,而 WTP 又依賴 Eclipse SDK,因此需依序安裝相容版本組合。以撰寫當時為例:
將所有套件解壓至同一目錄(如 c:\eclipse),確保 plugins/ 與 features/ 子目錄結構正確。啟動 Eclipse 並嘗試建立 Dynamic Web Project 驗證安裝成功。
Eclipse 內建 CVS 客戶端,取得原始碼步驟如下:
dev.eclipse.org/home/technologyanonymousHEAD > org.eclipse.vtp > editors > plugins在 Package Explorer 中選擇專案,右鍵 Run As > Eclipse Application 啟動第二個 Eclipse 實例。嘗試建立 VoiceXML File,若精靈正常啟動,代表原始碼環境就緒。
VoiceXML 編輯時常需引用外部資源(音檔、其他 VoiceXML 文件)。新增一個「驗證連結有效性」的右鍵選單功能,需完成兩步驟:
<extension point="org.eclipse.wst.sse.ui.extendedEditorActions">
<editorContribution
targetID="org.eclipse.vtp.editor.vxml.StructuredTextEditorVXML"
id="org.eclipse.vtp.editor.vxml.extendedActions">
<action
label="Validate linked item exists"
tooltip="Checks to make sure that the item referenced exists"
popupmenuPath="VOICETOOLS_GROUP_EDIT"
class="org.eclipse.vtp.editor.vxml.CheckReferencedURLAction"
id="org.eclipse.vtp.editor.vxml.actions.CheckReferencedURLAction">
</action>
</editorContribution>
</extension>
參考現有 EditReferencedFileAction 實作邏輯,核心在於 isVisible() 控制選單顯示時機,與 run() 執行驗證邏輯。需判斷屬性值為本地路徑或 URL (file:, http:, https:, ftp:),分別處理:
attrValueLoaded = ActionSupport.currentPosGetAttributeValue(textEditor, attrs[i]);
if (attrValueLoaded.toLowerCase().startsWith("file:")
|| attrValueLoaded.toLowerCase().startsWith("http:")
|| attrValueLoaded.toLowerCase().startsWith("https:")
|| attrValueLoaded.toLowerCase().startsWith("ftp:")) {
// 驗證 URL 可達性
} else {
// 驗證本地檔案存在
}
在 Package Explorer 全選專案,右鍵 Export > Deployable plugins and fragments,指定輸出目錄完成打包。
org.eclipse.vtp.editor.vxml),選擇 Team > Create Patch...patch 核取方塊送出VTP 提供龐大的語音開發程式碼基礎,開放原始碼模式鼓勵貢獻,同時允許企業依需求客製化。本文完整示範從環境建置、原始碼取得、功能擴充、打包部署至社群貢獻的完整流程,助您快速上手 Eclipse 語音工具開發。