日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

语音项目记录写实2

發(fā)布時(shí)間:2024/4/15 编程问答 25 豆豆
生活随笔 收集整理的這篇文章主要介紹了 语音项目记录写实2 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

2019獨(dú)角獸企業(yè)重金招聘Python工程師標(biāo)準(zhǔn)>>>

經(jīng)過一天的查找,實(shí)驗(yàn),對(duì)比,最終決定使用sphinx-4作為此項(xiàng)目的核心組件,一切聲音數(shù)據(jù)都交由其處理,在sphinx-4的官網(wǎng)上看了一下sphinx-4主要構(gòu)成,用一張圖解釋:
接下來用一個(gè)helloworld來解釋一下各個(gè)組件的作用: package edu.cmu.sphinx.demo.helloworld;import edu.cmu.sphinx.frontend.util.Microphone; import edu.cmu.sphinx.recognizer.Recognizer; import edu.cmu.sphinx.result.Result; import edu.cmu.sphinx.util.props.ConfigurationManager;/*** A simple HelloWorld demo showing a simple speech application built using Sphinx-4. This application uses the Sphinx-4* endpointer, which automatically segments incoming audio into utterances and silences.*/ public class HelloWorld {public static void main(String[] args) {ConfigurationManager cm;if (args.length > 0) {cm = new ConfigurationManager(args[0]);} else {cm = new ConfigurationManager(HelloWorld.class.getResource("helloworld.config.xml"));}Recognizer recognizer = (Recognizer) cm.lookup("recognizer");recognizer.allocate();// start the microphone or exit if the programm if this is not possibleMicrophone microphone = (Microphone) cm.lookup("microphone");if (!microphone.startRecording()) {System.out.println("Cannot start microphone.");recognizer.deallocate();System.exit(1);}System.out.println("Say: (Good morning | Hello) ( Bhiksha | Evandro | Paul | Philip | Rita | Will )");// loop the recognition until the programm exits.while (true) {System.out.println("Start speaking. Press Ctrl-C to quit.\n");Result result = recognizer.recognize();if (result != null) {String resultText = result.getBestFinalResultNoFiller();System.out.println("You said: " + resultText + '\n');} else {System.out.println("I can't hear what you said.\n");}}} }


當(dāng)然sphinx-4自身還帶有很多有趣的sample有興趣的讀者可以去運(yùn)行一下,由于本人沒有麥,只能看在眼攙了。 接下來就要規(guī)劃以下my project了,明天繼續(xù),功能分析。


轉(zhuǎn)載于:https://my.oschina.net/pkm2012/blog/75740

總結(jié)

以上是生活随笔為你收集整理的语音项目记录写实2的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。