Commit 1ed99576 authored by Tt's avatar Tt

增加log

parent b88eacad
......@@ -209,6 +209,16 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.microphone_area.angle = 0;
this.time_area.active = false;
}
log(str) {
const node = cc.find('middleLayer');
if (node) {
node.getComponent('middleLayer').log(str);
} else {
console.log(str);
}
}
//按钮触发,使用的方法
async onTouchRecord() {
if (this.recording) return;
......@@ -219,6 +229,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.showVoiceFlash();
this.microphoneAreaRecover();
this.log("startTestConvert")
cc.audioEngine.stopAllEffects();
courseware && courseware.startTestConvert(this.letter); //开始录音
......@@ -260,9 +271,11 @@ export default class SceneComponent extends MyCocosSceneComponent {
return this.recrodEnd(testData)
}
courseware && courseware.stopTestConvert((res) => {
this.log("stopTestConvert:" + res)
res = JSON.parse(res);
this.recrodEnd(res);
}, covert => {
this.log("convertUrl:" + covert.convertUrl)
this.recordAudio = covert.convertUrl;
// 变声返回结果,结构为 {convertUrl: ‘http://jliasldfjsdfi.mp3'}
});//结束录音
......
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