Commit aeaec715 authored by yu's avatar yu

1

parent 87c12ad1
...@@ -99,6 +99,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -99,6 +99,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.tryData = []; this.tryData = [];
// 所有全局变量 默认都是null // 所有全局变量 默认都是null
this._cantouch = true; this._cantouch = true;
this.isPlayBgAudio = true;
} }
private layout_start: cc.Node; private layout_start: cc.Node;
private audioId: any; private audioId: any;
...@@ -583,6 +584,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -583,6 +584,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
} }
//按钮触发,使用的方法 //按钮触发,使用的方法
async onTouchRecord() { async onTouchRecord() {
this.stopBgAudio();
this.playLocalAudio("record") this.playLocalAudio("record")
let ske = pg.view.find(this.layout_speak, 'speak_ske'); let ske = pg.view.find(this.layout_speak, 'speak_ske');
let btn_start = pg.view.find(this.layout_speak, 'btn_start'); let btn_start = pg.view.find(this.layout_speak, 'btn_start');
...@@ -615,121 +617,73 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -615,121 +617,73 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.countDown = 999999; this.countDown = 999999;
let testData = { let testData = {
"dtLastResponse": "2021-09-17 13:36:26:109", "audioUrl": "https://staging-teach.cdn.ireadabc.com/a8ea7bb153a46941e6f28b7d0dda49f4.mp3",
"refText": "I haven't found anything out about him yet.",
"recordId": "6144295213f0a2200000ed93",
"eof": 1, "eof": 1,
"file": "/storage/emulated/0/Android/data/com.example.oxford/cache/shengtong/gradeVoice.mp3",
"result": { "result": {
"pronunciation": 25, "duration": "2.630",
"resource_version": "3.1.0", "fluency": 84,
"fluency": 60,
"rhythm": 90,
"kernel_version": "5.2.4",
"overall": 25,//75
"integrity": 100, "integrity": 100,
"duration": "6.779", "kernel_version": "3.7.1",
"rear_tone": "fall", "overall": 80,
"speed": 96, "pronunciation": 88,
"words": [ "resource_version": "2.3.11",
"rhythm": 46,
"sentences": [
{ {
"phonemes": [ "beginIndex": 0,
"details": [
{ {
"phoneme": "w", "charType": 0,
"pronunciation": 55, "end": 0,
"span": { "overall": 69,
"end": 95, "prominence": 0,
"start": 88 "start": 0,
} "word": "day"
}, },
{ {
"phoneme": "ɛ", "charType": 0,
"pronunciation": 100, "end": 0,
"span": { "overall": 100,
"end": 107, "prominence": 0,
"start": 95 "start": 0,
} "word": "day"
}, },
{ {
"phoneme": "r", "charType": 0,
"pronunciation": 99, "end": 0,
"span": { "overall": 100,
"end": 123, "prominence": 0,
"start": 107 "start": 0,
} "word": "up"
}
],
"phonics": [
{
"overall": 85,
"phoneme": [
"w",
"ɛ",
"r"
],
"spell": "Where"
}
],
"scores": {
"overall": 80,
"pronunciation": 92
},
"span": {
"end": 123,
"start": 88
},
"word": "Where"
}, {
"phonemes": [
{
"phoneme": "w",
"pronunciation": 55,
"span": {
"end": 95,
"start": 88
}
}, },
{ {
"phoneme": "ɛ", "charType": 0,
"pronunciation": 100, "end": 0,
"span": { "overall": 100,
"end": 107, "prominence": 0,
"start": 95 "start": 0,
} "word": "day"
}, },
{ {
"phoneme": "r", "charType": 0,
"pronunciation": 99, "end": 0,
"span": { "overall": 100,
"end": 123, "prominence": 0,
"start": 107 "start": 0,
} "word": "up"
}
],
"phonics": [
{
"overall": 85,
"phoneme": [
"w",
"ɛ",
"r"
],
"spell": "Where"
} }
], ],
"scores": { "end": 0,
"overall": 10, "endIndex": 0,
"pronunciation": 92 "overall": 88,
}, "sentence": "day day up day up",
"span": { "start": 0
"end": 123,
"start": 88
},
"word": "Where"
} }
] ],
"speed": 170
}, },
"tokenId": "6144295408558b08dd000001", "tokenId": "632be7a73327935c2b000005"
"applicationId": "154838659000009e"
} }
if (!courseware) return this.recrodEnd(testData) if (!courseware) return this.recrodEnd(testData)
// await pg.time.delay(5); // await pg.time.delay(5);
...@@ -756,6 +710,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -756,6 +710,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.playCard(null); this.playCard(null);
this.updateLayoutSpeak(true); this.updateLayoutSpeak(true);
this.updateTips(null); this.updateTips(null);
this.playBgAudio();
return pg.event.emit("game_time_over"); return pg.event.emit("game_time_over");
} else { } else {
//提示失败 //提示失败
...@@ -768,6 +723,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -768,6 +723,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.playCard(null); this.playCard(null);
this.updateLayoutSpeak(true); this.updateLayoutSpeak(true);
this.updateTips(null); this.updateTips(null);
this.playBgAudio();
this.touching = false; this.touching = false;
Game.getIns().state = GAME_STATE.OVER Game.getIns().state = GAME_STATE.OVER
return pg.event.emit("game_time_over"); return pg.event.emit("game_time_over");
......
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