Commit f1eb499d authored by 李帅's avatar 李帅

+1

parent d74fbaab
/*
* @Author: ls
* @Date: 2022-05-15 18:22:18
* @LastEditTime: 2022-05-23 12:39:28
* @LastEditTime: 2022-05-23 15:25:56
* @LastEditors: ls
* @Description:
* @FilePath: \ls_gramophone\assets\ls_gramophone\scene\ls_gramophone.ts
......@@ -156,6 +156,11 @@ export default class SceneComponent extends MyCocosSceneComponent {
cc.audioEngine.stopAll();
element.getComponent(Item).playRecord();
//
if (this._records[index] != null) {
this.playAudioByUrl(this._records[index], () => {
element.getComponent(Item).stopRecord();
}); // 播放音效
}
});
myrecord_play.on('click', () => {
cc.audioEngine.stopAll();
......@@ -187,7 +192,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this._recording = true;
if (window['courseware']) {
window['courseware'].startRecord(1);
window['courseware'].startRecord(0);
}
});
record_stop.on('click', () => {
......@@ -226,7 +231,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
if (res && JSON.parse(res).audioUrl) {
if (idx !== -1) {
this._records[idx] = JSON.parse(res).audioUrl;
onHomeworkFinish(res);
}
}
......@@ -236,6 +240,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.content.children[idx].getComponent(Item).recorded();
}
// 模拟测试
// this._records[idx] = 'http://staging-teach.cdn.ireadabc.com/92ddbc65e9af775f7a8450a5bef1a732.mp3';
this.resetRecord();
}
});
......
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