添加音频测试页面

This commit is contained in:
kron
2025-11-06 10:52:08 +08:00
parent 6b30eedcc2
commit ae9ec4a7f7
4 changed files with 70 additions and 2 deletions

View File

@@ -1,4 +1,4 @@
const audioFils = {
export const audioFils = {
激光已校准:
"https://static.shelingxingqiu.com/attachment/2025-10-29/ddupaur1vdkyhzaqdc.mp3",
胜利: "https://static.shelingxingqiu.com/attachment/2025-09-17/dcuo9yjp0kt5msvmvd.mp3",
@@ -168,6 +168,10 @@ class AudioManager {
} catch (_) {}
clearTimeout(loadTimeout);
debugLog(`音频 ${key} 已加载完成`);
uni.$emit("audioLoaded", key);
const loadedAudioKeys = uni.getStorageSync("loadedAudioKeys") || {};
loadedAudioKeys[key] = true;
uni.setStorageSync("loadedAudioKeys", loadedAudioKeys);
this.retryCount.set(key, 0);
if (callback) callback();
});
@@ -243,9 +247,9 @@ class AudioManager {
const audio = this.audioMap.get(key);
if (audio) {
console.log("播放音频:", key);
// 显式授权播放并立即播放
this.allowPlayMap.set(key, true);
console.log(`开始播放音频 ${key}`);
audio.play();
this.currentPlayingKey = key;
} else {