flat: 对接一体机语音播放

This commit is contained in:
Apcallover
2025-12-20 14:51:03 +08:00
parent 99cb6b4710
commit 02fef1700b
5 changed files with 247 additions and 4 deletions

21
hook/useTTS.js Normal file
View File

@@ -0,0 +1,21 @@
import {
useTTSPlayer as useWebTTS
} from '@/hook/useTTSPlayer-web.js'
import {
useTTSPlayer as useHardwareTTS
} from '@/hook/useTTSPlayer-all-in-one.js'
import {
isY9MachineType
} from '../common/globalFunction';
/**
* 智能 TTS 适配器 Hook
* 自动判断环境并返回对应的播放器实现
*/
export function useTTSPlayer() {
if (isY9MachineType()) {
return useHardwareTTS()
} else {
return useWebTTS()
}
}