diff --git a/hybrid/html/ai.html b/hybrid/html/ai.html index 0624b6b..5022169 100755 --- a/hybrid/html/ai.html +++ b/hybrid/html/ai.html @@ -159,6 +159,7 @@ const speakingTime = wordCount / wordsPerMinute; // 转换为秒数 const speakingTimeInSeconds = speakingTime * 60; + console.log(speakingTimeInSeconds, '说完需要多少秒') return speakingTimeInSeconds; } @@ -407,26 +408,18 @@ // 循环视频 replayVideoSegment(60, 120); - // 计算所需时间 - const speakingTime = calculateSpeakingTime(filterString(str.output.text, ['*', ' '])); - - // 开始倒计时 - var totalTime = speakingTime; - var countdown = setInterval(function() { - // 更新剩余时间 - totalTime --; - if (totalTime <= 0) { - // 停止倒计时 - startRec.style.display = 'block'; - endRec.style.display = 'none'; - statusTxt.value = ''; - voiceTxt.innerText = ''; - clearInterval(countdown); - voice.stop(); - replayVideoSegment(0, 60); - } - }, 1000); - hideModal() + // 监听播放技术 + myAudio.addEventListener('ended', function() { + console.log('音频播放已结束!'); + // 停止倒计时 + startRec.style.display = 'block'; + endRec.style.display = 'none'; + statusTxt.value = ''; + voiceTxt.innerText = ''; + voice.stop(); + replayVideoSegment(0, 60); + hideModal() + }); }).catch(e => { hideModal(); }); @@ -496,27 +489,18 @@ // 循环视频 replayVideoSegment(60, 120); - // 计算所需时间 - const speakingTime = calculateSpeakingTime(voiceTxt.innerText); - - // 开始倒计时 - var totalTime = speakingTime; - var countdown = setInterval(function() { - // 更新剩余时间 - totalTime --; - if (totalTime <= 0) { - // 停止倒计时 - startRec.style.display = 'block'; - endRec.style.display = 'none'; - statusTxt.value = ''; - voiceTxt.innerText = ''; - clearInterval(countdown); - voice.stop(); - replayVideoSegment(0, 60); - } - }, 1000); - - hideModal() + // 监听播放技术 + myAudio.addEventListener('ended', function() { + console.log('音频播放已结束!'); + // 停止倒计时 + startRec.style.display = 'block'; + endRec.style.display = 'none'; + statusTxt.value = ''; + voiceTxt.innerText = ''; + voice.stop(); + replayVideoSegment(0, 60); + hideModal() + }); }).catch(e => { hideModal(); }); @@ -660,26 +644,18 @@ // 循环视频 replayVideoSegment(60, 120); - // 计算所需时间 - const speakingTime = calculateSpeakingTime(content.data.choices[0].text); - - // 开始倒计时 - var totalTime = speakingTime; - var countdown = setInterval(function() { - // 更新剩余时间 - totalTime --; - if (totalTime <= 0) { - // 停止倒计时 - startRec.style.display = 'block'; - endRec.style.display = 'none'; - statusTxt.value = ''; - voiceTxt.innerText = ''; - clearInterval(countdown); - replayVideoSegment(0, 60); - } - }, 1000); - - hideModal() + // 监听播放技术 + myAudio.addEventListener('ended', function() { + console.log('音频播放已结束!'); + // 停止倒计时 + startRec.style.display = 'block'; + endRec.style.display = 'none'; + statusTxt.value = ''; + voiceTxt.innerText = ''; + voice.stop(); + replayVideoSegment(0, 60); + hideModal() + }); }).catch(e => { hideModal(); }); diff --git a/unpackage/cache/wgt/__UNI__24DA8DD/hybrid/html/ai.html b/unpackage/cache/wgt/__UNI__24DA8DD/hybrid/html/ai.html index 0624b6b..5022169 100644 --- a/unpackage/cache/wgt/__UNI__24DA8DD/hybrid/html/ai.html +++ b/unpackage/cache/wgt/__UNI__24DA8DD/hybrid/html/ai.html @@ -159,6 +159,7 @@ const speakingTime = wordCount / wordsPerMinute; // 转换为秒数 const speakingTimeInSeconds = speakingTime * 60; + console.log(speakingTimeInSeconds, '说完需要多少秒') return speakingTimeInSeconds; } @@ -407,26 +408,18 @@ // 循环视频 replayVideoSegment(60, 120); - // 计算所需时间 - const speakingTime = calculateSpeakingTime(filterString(str.output.text, ['*', ' '])); - - // 开始倒计时 - var totalTime = speakingTime; - var countdown = setInterval(function() { - // 更新剩余时间 - totalTime --; - if (totalTime <= 0) { - // 停止倒计时 - startRec.style.display = 'block'; - endRec.style.display = 'none'; - statusTxt.value = ''; - voiceTxt.innerText = ''; - clearInterval(countdown); - voice.stop(); - replayVideoSegment(0, 60); - } - }, 1000); - hideModal() + // 监听播放技术 + myAudio.addEventListener('ended', function() { + console.log('音频播放已结束!'); + // 停止倒计时 + startRec.style.display = 'block'; + endRec.style.display = 'none'; + statusTxt.value = ''; + voiceTxt.innerText = ''; + voice.stop(); + replayVideoSegment(0, 60); + hideModal() + }); }).catch(e => { hideModal(); }); @@ -496,27 +489,18 @@ // 循环视频 replayVideoSegment(60, 120); - // 计算所需时间 - const speakingTime = calculateSpeakingTime(voiceTxt.innerText); - - // 开始倒计时 - var totalTime = speakingTime; - var countdown = setInterval(function() { - // 更新剩余时间 - totalTime --; - if (totalTime <= 0) { - // 停止倒计时 - startRec.style.display = 'block'; - endRec.style.display = 'none'; - statusTxt.value = ''; - voiceTxt.innerText = ''; - clearInterval(countdown); - voice.stop(); - replayVideoSegment(0, 60); - } - }, 1000); - - hideModal() + // 监听播放技术 + myAudio.addEventListener('ended', function() { + console.log('音频播放已结束!'); + // 停止倒计时 + startRec.style.display = 'block'; + endRec.style.display = 'none'; + statusTxt.value = ''; + voiceTxt.innerText = ''; + voice.stop(); + replayVideoSegment(0, 60); + hideModal() + }); }).catch(e => { hideModal(); }); @@ -660,26 +644,18 @@ // 循环视频 replayVideoSegment(60, 120); - // 计算所需时间 - const speakingTime = calculateSpeakingTime(content.data.choices[0].text); - - // 开始倒计时 - var totalTime = speakingTime; - var countdown = setInterval(function() { - // 更新剩余时间 - totalTime --; - if (totalTime <= 0) { - // 停止倒计时 - startRec.style.display = 'block'; - endRec.style.display = 'none'; - statusTxt.value = ''; - voiceTxt.innerText = ''; - clearInterval(countdown); - replayVideoSegment(0, 60); - } - }, 1000); - - hideModal() + // 监听播放技术 + myAudio.addEventListener('ended', function() { + console.log('音频播放已结束!'); + // 停止倒计时 + startRec.style.display = 'block'; + endRec.style.display = 'none'; + statusTxt.value = ''; + voiceTxt.innerText = ''; + voice.stop(); + replayVideoSegment(0, 60); + hideModal() + }); }).catch(e => { hideModal(); }); diff --git a/unpackage/dist/build/app-plus/hybrid/html/ai.html b/unpackage/dist/build/app-plus/hybrid/html/ai.html index 0624b6b..5022169 100644 --- a/unpackage/dist/build/app-plus/hybrid/html/ai.html +++ b/unpackage/dist/build/app-plus/hybrid/html/ai.html @@ -159,6 +159,7 @@ const speakingTime = wordCount / wordsPerMinute; // 转换为秒数 const speakingTimeInSeconds = speakingTime * 60; + console.log(speakingTimeInSeconds, '说完需要多少秒') return speakingTimeInSeconds; } @@ -407,26 +408,18 @@ // 循环视频 replayVideoSegment(60, 120); - // 计算所需时间 - const speakingTime = calculateSpeakingTime(filterString(str.output.text, ['*', ' '])); - - // 开始倒计时 - var totalTime = speakingTime; - var countdown = setInterval(function() { - // 更新剩余时间 - totalTime --; - if (totalTime <= 0) { - // 停止倒计时 - startRec.style.display = 'block'; - endRec.style.display = 'none'; - statusTxt.value = ''; - voiceTxt.innerText = ''; - clearInterval(countdown); - voice.stop(); - replayVideoSegment(0, 60); - } - }, 1000); - hideModal() + // 监听播放技术 + myAudio.addEventListener('ended', function() { + console.log('音频播放已结束!'); + // 停止倒计时 + startRec.style.display = 'block'; + endRec.style.display = 'none'; + statusTxt.value = ''; + voiceTxt.innerText = ''; + voice.stop(); + replayVideoSegment(0, 60); + hideModal() + }); }).catch(e => { hideModal(); }); @@ -496,27 +489,18 @@ // 循环视频 replayVideoSegment(60, 120); - // 计算所需时间 - const speakingTime = calculateSpeakingTime(voiceTxt.innerText); - - // 开始倒计时 - var totalTime = speakingTime; - var countdown = setInterval(function() { - // 更新剩余时间 - totalTime --; - if (totalTime <= 0) { - // 停止倒计时 - startRec.style.display = 'block'; - endRec.style.display = 'none'; - statusTxt.value = ''; - voiceTxt.innerText = ''; - clearInterval(countdown); - voice.stop(); - replayVideoSegment(0, 60); - } - }, 1000); - - hideModal() + // 监听播放技术 + myAudio.addEventListener('ended', function() { + console.log('音频播放已结束!'); + // 停止倒计时 + startRec.style.display = 'block'; + endRec.style.display = 'none'; + statusTxt.value = ''; + voiceTxt.innerText = ''; + voice.stop(); + replayVideoSegment(0, 60); + hideModal() + }); }).catch(e => { hideModal(); }); @@ -660,26 +644,18 @@ // 循环视频 replayVideoSegment(60, 120); - // 计算所需时间 - const speakingTime = calculateSpeakingTime(content.data.choices[0].text); - - // 开始倒计时 - var totalTime = speakingTime; - var countdown = setInterval(function() { - // 更新剩余时间 - totalTime --; - if (totalTime <= 0) { - // 停止倒计时 - startRec.style.display = 'block'; - endRec.style.display = 'none'; - statusTxt.value = ''; - voiceTxt.innerText = ''; - clearInterval(countdown); - replayVideoSegment(0, 60); - } - }, 1000); - - hideModal() + // 监听播放技术 + myAudio.addEventListener('ended', function() { + console.log('音频播放已结束!'); + // 停止倒计时 + startRec.style.display = 'block'; + endRec.style.display = 'none'; + statusTxt.value = ''; + voiceTxt.innerText = ''; + voice.stop(); + replayVideoSegment(0, 60); + hideModal() + }); }).catch(e => { hideModal(); }); diff --git a/unpackage/dist/dev/app-plus/hybrid/html/ai.html b/unpackage/dist/dev/app-plus/hybrid/html/ai.html index 0624b6b..5022169 100644 --- a/unpackage/dist/dev/app-plus/hybrid/html/ai.html +++ b/unpackage/dist/dev/app-plus/hybrid/html/ai.html @@ -159,6 +159,7 @@ const speakingTime = wordCount / wordsPerMinute; // 转换为秒数 const speakingTimeInSeconds = speakingTime * 60; + console.log(speakingTimeInSeconds, '说完需要多少秒') return speakingTimeInSeconds; } @@ -407,26 +408,18 @@ // 循环视频 replayVideoSegment(60, 120); - // 计算所需时间 - const speakingTime = calculateSpeakingTime(filterString(str.output.text, ['*', ' '])); - - // 开始倒计时 - var totalTime = speakingTime; - var countdown = setInterval(function() { - // 更新剩余时间 - totalTime --; - if (totalTime <= 0) { - // 停止倒计时 - startRec.style.display = 'block'; - endRec.style.display = 'none'; - statusTxt.value = ''; - voiceTxt.innerText = ''; - clearInterval(countdown); - voice.stop(); - replayVideoSegment(0, 60); - } - }, 1000); - hideModal() + // 监听播放技术 + myAudio.addEventListener('ended', function() { + console.log('音频播放已结束!'); + // 停止倒计时 + startRec.style.display = 'block'; + endRec.style.display = 'none'; + statusTxt.value = ''; + voiceTxt.innerText = ''; + voice.stop(); + replayVideoSegment(0, 60); + hideModal() + }); }).catch(e => { hideModal(); }); @@ -496,27 +489,18 @@ // 循环视频 replayVideoSegment(60, 120); - // 计算所需时间 - const speakingTime = calculateSpeakingTime(voiceTxt.innerText); - - // 开始倒计时 - var totalTime = speakingTime; - var countdown = setInterval(function() { - // 更新剩余时间 - totalTime --; - if (totalTime <= 0) { - // 停止倒计时 - startRec.style.display = 'block'; - endRec.style.display = 'none'; - statusTxt.value = ''; - voiceTxt.innerText = ''; - clearInterval(countdown); - voice.stop(); - replayVideoSegment(0, 60); - } - }, 1000); - - hideModal() + // 监听播放技术 + myAudio.addEventListener('ended', function() { + console.log('音频播放已结束!'); + // 停止倒计时 + startRec.style.display = 'block'; + endRec.style.display = 'none'; + statusTxt.value = ''; + voiceTxt.innerText = ''; + voice.stop(); + replayVideoSegment(0, 60); + hideModal() + }); }).catch(e => { hideModal(); }); @@ -660,26 +644,18 @@ // 循环视频 replayVideoSegment(60, 120); - // 计算所需时间 - const speakingTime = calculateSpeakingTime(content.data.choices[0].text); - - // 开始倒计时 - var totalTime = speakingTime; - var countdown = setInterval(function() { - // 更新剩余时间 - totalTime --; - if (totalTime <= 0) { - // 停止倒计时 - startRec.style.display = 'block'; - endRec.style.display = 'none'; - statusTxt.value = ''; - voiceTxt.innerText = ''; - clearInterval(countdown); - replayVideoSegment(0, 60); - } - }, 1000); - - hideModal() + // 监听播放技术 + myAudio.addEventListener('ended', function() { + console.log('音频播放已结束!'); + // 停止倒计时 + startRec.style.display = 'block'; + endRec.style.display = 'none'; + statusTxt.value = ''; + voiceTxt.innerText = ''; + voice.stop(); + replayVideoSegment(0, 60); + hideModal() + }); }).catch(e => { hideModal(); }); diff --git a/unpackage/release/.DS_Store b/unpackage/release/.DS_Store index df91411..84517b9 100644 Binary files a/unpackage/release/.DS_Store and b/unpackage/release/.DS_Store differ diff --git a/unpackage/release/apk/__UNI__24DA8DD__20241011113032.apk b/unpackage/release/apk/__UNI__24DA8DD__20241011113032.apk deleted file mode 100644 index cf9f0df..0000000 Binary files a/unpackage/release/apk/__UNI__24DA8DD__20241011113032.apk and /dev/null differ