Commit b93a3dba authored by 李维's avatar 李维

测试语音评测

parent 1015ae99
......@@ -247,12 +247,7 @@ export default class NewClass extends cc.Component {
this.playRecordButton.active = false;
this.updatePlayAndReplayButtons("play", "init");
this.isRecording = true;
this.handlerSpeach = speechToTextRequest((e)=>{
this.setEditboxString(e.text);
this.recordUrl = e.audioUrl;
this.preLoadAudio(this.recordUrl);
this.handlerSpeach = null;
})
this.handlerSpeach = speechToTextRequest();
const recProgress = cc.find("progress", this.recordButton); //录音中进度条
if(this.intervalIDTranslate) {
......@@ -275,7 +270,12 @@ export default class NewClass extends cc.Component {
stopRealTimeTranslate() {
this.isRecording = false;
if(this.handlerSpeach) {
this.handlerSpeach():
this.handlerSpeach(()=>{
this.setEditboxString(e.text);
this.recordUrl = e.audioUrl;
this.preLoadAudio(this.recordUrl);
this.handlerSpeach = null;
});
}
// 结束录音 显示提交按钮
this.submitBtn.active = true;
......@@ -296,7 +296,6 @@ export default class NewClass extends cc.Component {
}
}
intervalIDPlayRecord = null;
currentPlayAudioId = null;
// 听回放
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment