update: 语音优化

This commit is contained in:
2026-08-20 16:56:34 +08:00
parent bb224c9f29
commit 6363dda204
5 changed files with 128 additions and 25 deletions
@@ -1,6 +1,6 @@
<script setup>
import { ref, watch, onMounted, onBeforeUnmount, computed } from "vue";
import audioManager from "@/audioManager";
import audioManager, { getTrainingStartAudioKey } from "@/audioManager";
import { MESSAGETYPESV2 } from "@/constants";
import {
getDirectionText,
@@ -207,7 +207,10 @@ async function onReceiveMessage(msg) {
if (Array.isArray(msg)) return;
if (msg.type === MESSAGETYPESV2.BattleStart) {
halfTime.value = false;
audioManager.play("比赛开始");
// 已实现的个人训练由页面播放专属提示,避免重复播报。
if (!getTrainingStartAudioKey(props.trainingType)) {
audioManager.play("比赛开始");
}
} else if (msg.type === MESSAGETYPESV2.BattleEnd) {
audioManager.play("练习结束", false);
} else if (msg.type === MESSAGETYPESV2.ShootResult) {