当前位置:网站首页>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 ~
边栏推荐
- mvdr波束 matlab,mvdr波束形成matlab[通俗易懂]
- Jericho's method of obtaining reset source and wakeup IO port [chapter]
- 【Matlab】数据插值
- HMS Core机器学习服务实现同声传译,支持中英文互译和多种音色语音播报
- SDN system method | 10 The future of SDN
- cgi通过odbc连接数据库
- How high does UART baud rate require for clock accuracy?
- 服务器四通道内存性能提升,四通道内存性能怎么样
- 相同wifi下,笔记本连接台式机上的虚拟机
- Golang sort slice int
猜你喜欢

Assembly language (5) register (memory access)

Mathematical modeling - nonlinear programming

Design and arrangement of DDIA data intensive application system
![Jericho's method of obtaining reset source and wakeup IO port [chapter]](/img/93/30d5075a3da1ace7438ae06c1b1775.png)
Jericho's method of obtaining reset source and wakeup IO port [chapter]

Distinguishing seven kinds of facial expressions by deep separable convolution neural network
![[black apple] Lenovo Savior y70002019pg0](/img/9c/7a94aa911dd0c6b94ba192bc2687e6.png)
[black apple] Lenovo Savior y70002019pg0

Mathematical modeling - linear programming

WPF development essays Collection - ECG curve drawing

宝藏又小众的国画3d材质贴图素材网站分享

【Matlab】数值微积分与方程求解
随机推荐
STM32 hardware error hardfault_ Handler processing method
Automatic submission for the next education day
华为云GaussDB(for Redis)揭秘第19期:GaussDB(for Redis)全面对比Codis
Why are there few embedded system designers in the soft test?
Precautions for using Jerry's timer [chapter]
Is Guotai Junan Securities reliable? Is it legal? Is it safe to open a stock account?
Best practices for data relocation: using CDM to relocate offline Mysql to DWS
求满足条件的最长子串长度
Jerry's ADC_ get_ Incorrect voltage value obtained by voltage function [chapter]
为什么在变频器场合需要安科瑞的电力有源滤波器?
How high does UART baud rate require for clock accuracy?
Kotlin
Sword finger offer II 035 Minimum time difference
How do components communicate
golang sort slice int
mysql mysql-8.0.19-winx64 安装与navicat连接
Huawei cloud gaussdb (for redis) unveiling issue 19: gaussdb (for redis) comprehensive comparison with CODIS
TLV解码
汇编语言(6)使用JCC指令构造分支与循环
【编译原理】概述