当前位置:网站首页>HMS core machine learning service realizes simultaneous interpretation, supports Chinese-English translation and multiple voice broadcast
HMS core machine learning service realizes simultaneous interpretation, supports Chinese-English translation and multiple voice broadcast
2022-06-25 17:36:00 【Huawei mobile services】
When users have the need for cross language communication or audio content translation , Applications need to be able to automatically detect voice content and then output it to the language users need .
HMS Core Machine learning services Provide simultaneous interpretation Ability , Simultaneous interpretation realizes real-time translation of real-time input long speech into text and speech of different languages , And real-time output of the original voice text 、 The translated text and the voice broadcast of the translated text .
In the live class , Conference applications , Simultaneous interpretation is particularly important . such as , In conference applications , It can output the speech content of the speaker of the ongoing meeting to the target language in real time , It is convenient for people in different languages to understand the meeting content in real time , Improve meeting efficiency . In live broadcast applications , It can output the spoken content of the anchor to the language required by the user in real time , And then broadcast in real time , Improve the viewing experience of users .
HMS Core Machine learning services Simultaneous interpretation capability not only supports continuous 5 Hours of real-time long voice input is converted to text , It also supports the translation between Chinese and English and the broadcasting of various timbres , Meet the needs of different scenarios in different types of applications .
DEMO Example

Development steps
Before development , You need to complete the necessary development preparations , At the same time, please make sure that your project has been configured with HMS Core SDK Of Maven Warehouse address , And completed the service of SDK Integrate .
SDK The sample code is as follows :
dependencies{
// Introducing simultaneous interpretation services SDK
implementation 'com.huawei.hms:ml-computer-si-sdk:3.5.0.312'
}- Please refer to the instructions for using cloud authentication information , Set the authentication information of your application .
- Create a simultaneous interpreting recognizer , And set the configuration .
MLSimultaneousInterpretationConfig config = new
MLSimultaneousInterpretationConfig.Factory()
// Set source language , At present, it supports Chinese and English
.setSourceLanguage(MLSimultaneousInterpretationConstants.LAN_ZH_CN)
// Set the target language , At present, it supports Chinese and English
.setTargetLanguage(MLSimultaneousInterpretationConstants.LAN_EN_US)
// Set the identification type . Support original text + Translation text + Translation pronunciation
.setResultType(MLSimultaneousInterpretationConstants.RESULT_TYPE_TEXT_TRANSLATED_VOICE)
// Set the speaker , Supporting 、 British male and female voices
.setPerson(MLSimultaneousInterpretationConstants.EN_FEMALE_VOICE)
.create();
MLSimultaneousInterpretationRecognizer = MLSimultaneousInterpretationRecognizer.getInstance();- Create voice recognition result listener callback .
// Callback implementation MLSimultaneousInterpretationListener, Implement the methods in the interface .
protected class SIRecognitionListener implements MLSimultaneousInterpretationListener {
@Override
public void onStartListening() {
// The recorder began to receive sound .
}
@Override
public void onVoiceDataReceived(byte[] data) {
// Return to the user's original PCM Audio stream and audio energy , The interface does not run in the main thread , The returned result needs to be processed in the child thread .
}
@Override
public void onRecognizingResults(Bundle partialResults) {
// from SIRecognitionListener Received text for continuous speech recognition .
// RESULTS_RECOGNIZING: Original text ;RESULTS_TRANS_RECOGNIZING:tts Text ;RESULTS_SN: Original serial number ;RESULTS_TRANS_SN:tts Serial number
}
@Override
public void onResults(Bundle results) {
// from SIRecognitionListener Receive complete sentences
// RESULTS_RECOGNIZED: The original result ;RESULTS_TRANS_RECOGNIZED:tts result
}
@Override
public void onError(int error, String errorMessage) {
// Call the interface after identifying the error .
}
@Override
public void onState(int state, Bundle params) {
// Notify the application that the status has changed .
}
}- Bind the simultaneous interpreting identifier .
mlSimultaneousInterpretationRecognizer.setMLSimultaneousInterpretationListener(new SIRecognitionListener());- call startRecognizing Start speech recognition .
// Start identifying .
mlSimultaneousInterpretationRecognizer.startRecognizing(config);- When the identification is complete , End identifying and releasing resources .
if (mlSimultaneousInterpretationRecognizer!= null) {
mlSimultaneousInterpretationRecognizer.destroy();
}Learn more >>
visit Official website of Huawei developer Alliance
obtain Development guidance document
Huawei mobile service open source warehouse address :GitHub、Gitee
Pay attention to our , The first time to understand HMS Core Latest technical information ~
边栏推荐
- 杰理之定时器捕获(timer_cap.c)使用注意事项【篇】
- 华为云GaussDB(for Redis)揭秘第19期:GaussDB(for Redis)全面对比Codis
- Sword finger offer II 025 Adding two numbers in a linked list
- Will the 2022 cloud world be better
- 启牛涨乐财付通下载是可以开户吗?开户安全吗
- 数学建模——线性规划
- Old mobile phones turn waste into treasure and serve as servers
- WARNING: Unsupported upgrade request.
- 数学建模——整数规划
- 超全金屬PBR多通道貼圖素材網站整理
猜你喜欢
随机推荐
Learning Tai Chi maker mqtt (II) basic principles of mqtt
The role of the project manager in the project
jupyter的使用
How about qiniu's Zhangle TenPay? Is it safe
ACY100油烟浓度在线监控仪针对饮食业厨房油烟排放
[matlab] curve fitting
ES6知识点
数学建模——非线性规划
启牛的涨乐财付通如何?安全靠谱吗
[compilation principle] overview
十大证券公司哪个佣金最低 办理开户安全吗
【Matlab】数据统计分析
How Jerry used to output a clock source to the outside world [chapter]
golang sort slice int
配电室环境的分布式远程管理
启牛蜻蜓点金下载是可以开户吗?开户安全吗
cgi通过odbc连接数据库
golang sort slice int
Redis distributed lock collation
SDN system method | 10 The future of SDN

![[matlab] data interpolation](/img/b8/d7e1a5f7c6f56c8312a1fb5d517ac6.png)






