Commit 5355dab9 authored by 范雪寒's avatar 范雪寒

fix:

parent c30f1a6c
...@@ -229,12 +229,12 @@ cc.Class({ ...@@ -229,12 +229,12 @@ cc.Class({
cc.assetManager.loadRemote(this.data.shortAudio_url, null, async (err, clip) => { cc.assetManager.loadRemote(this.data.shortAudio_url, null, async (err, clip) => {
this.audioID = cc.audioEngine.play(clip, false, 1); this.audioID = cc.audioEngine.play(clip, false, 1);
await asyncDelay(0.01); await this.asyncDelay(0.01);
this.audioDuration = cc.audioEngine.getDuration(this.audioID); this.audioDuration = cc.audioEngine.getDuration(this.audioID);
this.textDuration = this.audioDuration / this.layoutText.childrenCount; this.textDuration = this.audioDuration / this.layoutText.childrenCount;
this.textIndex = 0; this.textIndex = 0;
await asyncDelay(0.01); await this.asyncDelay(0.01);
if (this.textDuration <= 0) { if (this.textDuration <= 0) {
this.textDuration = 1 this.textDuration = 1
} }
...@@ -242,6 +242,7 @@ cc.Class({ ...@@ -242,6 +242,7 @@ cc.Class({
this.schedule(this.chengeTextColor, this.textDuration, this.layoutText.childrenCount, 0.01) this.schedule(this.chengeTextColor, this.textDuration, this.layoutText.childrenCount, 0.01)
}); });
}, },
stopAudio() { stopAudio() {
cc.audioEngine.stop(this.audioID); cc.audioEngine.stop(this.audioID);
this.unschedule(this.chengeTextColor); this.unschedule(this.chengeTextColor);
......
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