From e1d4b545d6a591c8da008b7a09d69e2d92cc0ae3 Mon Sep 17 00:00:00 2001 From: Song367 <601337784@qq.com> Date: Wed, 30 Jul 2025 11:20:19 +0800 Subject: [PATCH] new voice --- src/config.js | 4 ++-- src/index.js | 15 +++++++++------ src/video_audio_sync.js | 4 ++-- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/config.js b/src/config.js index 9d4b477..53179c8 100644 --- a/src/config.js +++ b/src/config.js @@ -14,9 +14,9 @@ export const config = { // 音频配置 audio: { - model: 'speech-02-hd', + model: 'speech-01-turbo', voiceSetting: { - voice_id: 'yantu-qinggang-2', + voice_id: 'tianbing_xinggan_03', speed: 1, vol: 1, pitch: 0, diff --git a/src/index.js b/src/index.js index cfc12b1..2e08931 100644 --- a/src/index.js +++ b/src/index.js @@ -796,21 +796,24 @@ class WebRTCChat { async startCall() { try { + // 添加更详细的错误处理 + console.log('开始请求麦克风权限...'); this.localStream = await navigator.mediaDevices.getUserMedia({ video: false, audio: true }); + console.log('麦克风权限获取成功'); await this.createPeerConnection(); this.startVoiceRecording() // this.audioProcessor.startRecording() this.startButton.disabled = true; - this.stopButton.disabled = false; - - // 显示结束通话按钮 - this.stopButton.classList.add('show'); - - this.updateAudioStatus('已连接', 'connected'); + this.stopButton.disabled = false; + + // 显示结束通话按钮 + this.stopButton.classList.add('show'); + + this.updateAudioStatus('已连接', 'connected'); this.logMessage('音频通话已开始', 'success'); // 确保视频映射已加载 diff --git a/src/video_audio_sync.js b/src/video_audio_sync.js index dbed2e9..4e368fc 100644 --- a/src/video_audio_sync.js +++ b/src/video_audio_sync.js @@ -13,11 +13,11 @@ export async function playVideoWithAudio(videoPath, text) { apiKey: minimaxiConfig.apiKey, groupId: minimaxiConfig.groupId, body: { - model: 'speech-02-hd', + model: 'speech-01-turbo', text, output_format: 'hex', // 流式场景必须使用hex voice_setting: { - voice_id: 'yantu-qinggang', + voice_id: 'tianbing_xinggan_03', speed: 1 } },