Tongue Twister-蹇€熼泦鎴愬崕涓哄疄鏃惰闊宠瘑鍒湇鍔$帺杞粫鍙d护
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Tongue Twister-蹇€熼泦鎴愬崕涓哄疄鏃惰闊宠瘑鍒湇鍔$帺杞粫鍙d护相关的知识,希望对你有一定的参考价值。
鏍囩锛?a href='http://www.mamicode.com/so/1/%e8%bd%bb%e6%9d%be' title='杞绘澗'>杞绘澗
lang 娣卞害 repo zh-cn 濡備綍 end pos 璇煶璇嗗埆鏈嶅姟 鍓嶈█
瀹炰笉鐩哥瀿锛屽皬缂栦綔涓轰簡涓€涓箹鍗椾汉锛屾椂甯歌璇存櫘閫氳瘽涓嶅鏍囧噯锛屼笉浠匩/L涓嶅垎锛屾湁鏃跺€欒繕鍒嗕笉鍑烘潵鍗疯垖闊筹紝缁忓父闂圭瑧璇濓紝瀵艰嚧灏忕紪鍗佸垎鑻︽伡銆?鏈夋椂鐪嬬潃鐢佃閲岀殑涓绘寔浜烘祦鍒╃殑鍙f挱锛屽拰瀹屽叏鏍囧噯鐨勭粫鍙d护閮界尽鎱曚笉宸诧紝甯稿父骞绘兂鐫€鑷繁鏈変竴澶╀篃鑳借涓€鍙f祦鍒╃殑缁曞彛浠ゃ€傛伆宸э紝灏忕紪鏄ㄦ棩涓婄綉鐨勬椂鍊欒鎺ㄩ€佷簡闆嗘垚浜嗗崕涓篐MS ML Kit瀹炴椂璇煶鏈嶅姟鐨勫皬娓告垙-Tongue Twister锛?杩欐娓告垙绌剁珶鏄浣曠帺杞粫鍙d护鐨勶紝鎺ヤ笅鏉ュ氨鍜屽皬缂栦竴璧蜂竴鎺㈢┒绔熷惂锛?/p>
搴旂敤鍦烘櫙
Tongue Twister 灏辨槸涓€娆鹃泦鎴愪簡鍗庝负HMS ML Kit瀹炴椂璇煶璇嗗埆鏈嶅姟鐨勭粫鍙d护灏忔父鎴忥紝娓告垙涓竴鍏辨湁5涓叧鍗★紝姣忎竴涓叧鍗″氨鏄竴娈电粫鍙d护锛岄€氳繃绉樿瘈灏辨槸鍑€熷己澶х殑瀹炴椂璇煶璇嗗埆锛屽疄鏃惰闊宠瘑鍒湇鍔¤鐩栨棩甯哥敓娲诲強宸ヤ綔涓殑浼楀棰嗗煙锛屽苟涓旀繁搴︿紭鍖栦簡璐墿鎼滅储銆佸奖瑙嗘悳绱€侀煶涔愭悳绱互鍙婂鑸瓑鍦烘櫙涓殑璇嗗埆鑳藉姏锛岃瘑鍒噯纭巼楂橈紝鍙交鏉炬娴嬮棷鍏宠€呯殑鍙戦煶锛屽鑻ュ彂闊虫竻鏅版爣鍑嗗嵆鍙繃鍏筹紝
鑻憋細https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides-V5/sdk-data-security-0000001050040129-V5#EN-US_TOPIC_0000001050750251__section2688102310166
MLAsrRecognizer = MLAsrRecognizer.(context);
- 鍒涘缓璇煶璇嗗埆缁撴灉鐩戝惉鍣ㄥ洖璋冦€?/li>
SpeechRecognitionListener MLAsrListener {
@Override
onStartListening() {
}
@Override
onStartingOfSpeech() {
}
@Override
onVoiceDataReceived([] data, energy, Bundle bundle) {
}
@Override
onRecognizingResults(Bundle partialResults) {
}
@Override
onResults(Bundle results) {
}
}
@Override
onError(error, String errorMessage) {
}
@Override
onState(state, Bundle params) {
}
}
- 灏嗘柊寤虹殑缁撴灉鐩戝惉鍣ㄥ洖璋冧笌璇煶璇嗗埆鍣ㄧ粦瀹?/li>
.setAsrListener(SpeechRecognitionListener());
- 閰嶇疆璇嗗埆鍙傛暟锛岃皟鐢ㄥ惎鍔ㄨ闊宠瘑鍒?/li>
Intent = Intent(MLAsrConstants.);
.putExtra(MLAsrConstants., language)
.putExtra(MLAsrConstants., MLAsrConstants.);
mSpeechRecognizer.startRecognizing(mSpeechRecognizerIntent);
- 璇嗗埆瀹屾垚鍚庯紝閲婃斁璧勬簮
(!= ) {
.destroy();
= ;
}
maven鍦板潃
buildscript {
repositories {
maven { url }
}
}
allprojects {
repositories {
maven { url }
}
}
寮曞叆SDK
dependencies {implementation implementation implementation }
娓呭崟鏂囦欢
<...
< />
...
</>
鏉冮檺
</>
鍔ㄦ€佹潈闄愮敵璇?
requestCameraPermission() {
String[] permissions = String[]{Manifest.permission.};
(!ActivityCompat.(,
Manifest.permission.)) { ActivityCompat.(,
permissions,
TongueTwisterActivity.);
;
}
}
鎬荤粨
闄や簡鍦ㄦ父鎴忓綋涓殑搴旂敤锛屽疄鏃惰闊宠瘑鍒湇鍔″湪浣跨敤璐墿绫籄pp鎼滅储鍟嗗搧鏃讹紝鍙互灏嗚闊虫弿杩扮殑鍟嗗搧鍚嶇О鎴栫壒寰佽瘑鍒负鏂囧瓧浠庤€屾悳绱㈠埌鐩爣鍟嗗搧銆傚悓鏍凤紝鍦ㄤ娇鐢ㄩ煶涔愮被App鏃讹紝鍙互灏嗚闊宠緭鍏ョ殑姝屽悕鎴栨瓕鎵嬭瘑鍒负鏂囧瓧杩涜€屾悳绱㈡瓕鏇层€傚彟澶栵紝鍙告満鍦ㄩ┚椹惰繃绋嬩腑涓嶆柟渚胯緭鍏ユ枃瀛楁椂锛屽彲浠ュ皢杈撳叆鐨勮闊宠浆鎹负鏂囧瓧缁ц€屾悳绱㈢洰鐨勫湴锛岃琛岃溅鏇村姞瀹夊叏銆?/p>
GitHub Demo Code
娆蹭簡瑙f洿澶氳鎯咃紝璇峰弬闃咃細
鍗庝负寮€鍙戣€呰仈鐩熷畼缃戯細
https://developer.huawei.com/consumer/cn/hms/huawei-mlkit
鑾峰彇寮€鍙戞寚瀵兼枃妗o細
https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides/service-introduction-0000001050040017
鍙備笌寮€鍙戣€呰璁鸿鍒癛eddit绀惧尯锛?a href="https://www.reddit.com/r/HuaweiDevelopers/" rel="nofollow">https://www.reddit.com/r/HuaweiDevelopers/
涓嬭浇demo鍜岀ず渚嬩唬鐮佽鍒癎ithub锛?a href="https://github.com/HMS-Core" rel="nofollow">https://github.com/HMS-Core
瑙e喅闆嗘垚闂璇峰埌Stack Overflow锛?br/>https://stackoverflow.com/questions/tagged/huawei-mobile-services?tab=Newest
以上是关于Tongue Twister-蹇€熼泦鎴愬崕涓哄疄鏃惰闊宠瘑鍒湇鍔$帺杞粫鍙d护的主要内容,如果未能解决你的问题,请参考以下文章
铻嶄簯鍗虫椂閫氳SDK闆嗘垚 -- FCM鎺ㄩ€侀泦鎴愭寚鍗?Android骞冲彴)
Android | 瓒呯畝鍗曢泦鎴怘MS ML Kit瀹炵幇鏈€澶ц劯寰瑧鎶撴媿