fix sound
This commit is contained in:
parent
8c0f88bb5a
commit
c8651f3af0
|
@ -499,7 +499,7 @@ export default {
|
|||
id: this.messageId++,
|
||||
type,
|
||||
text,
|
||||
audio: audio ? `data:audio/mp3;base64,${audio}` : null,
|
||||
audio: audio ? `data:audio/wav;base64,${audio}` : null,
|
||||
timestamp: new Date(),
|
||||
showTranslation: false,
|
||||
loadingTranslation: false,
|
||||
|
|
|
@ -500,7 +500,7 @@ export default {
|
|||
id: this.messageId++,
|
||||
type,
|
||||
text,
|
||||
audio: audio ? `data:audio/mp3;base64,${audio}` : null,
|
||||
audio: audio ? `data:audio/wav;base64,${audio}` : null,
|
||||
timestamp: new Date(),
|
||||
// Translation properties for AI messages
|
||||
showTranslation: false,
|
||||
|
|
|
@ -108,8 +108,9 @@ class TextToSpeechService:
|
|||
)
|
||||
|
||||
audio_config_params = {
|
||||
"audio_encoding": texttospeech.AudioEncoding.MP3, # MP3 for faster processing
|
||||
"audio_encoding": texttospeech.AudioEncoding.LINEAR16, # WAV for better browser compatibility
|
||||
"speaking_rate": config_set["speaking_rate"],
|
||||
"sample_rate_hertz": 24000, # Required for LINEAR16
|
||||
# Remove effects profile for faster generation
|
||||
}
|
||||
|
||||
|
@ -353,7 +354,7 @@ class BaseConversationFlowService:
|
|||
"type": "ai_response",
|
||||
"text": greeting,
|
||||
"audio": audio_base64,
|
||||
"audio_format": "mp3",
|
||||
"audio_format": "wav",
|
||||
"character": personality_name,
|
||||
"is_initial_greeting": True
|
||||
}
|
||||
|
@ -395,7 +396,7 @@ class BaseConversationFlowService:
|
|||
"type": "ai_response",
|
||||
"text": ai_response,
|
||||
"audio": audio_base64,
|
||||
"audio_format": "mp3",
|
||||
"audio_format": "wav",
|
||||
"character": personality_name,
|
||||
"goal_status": goal_status,
|
||||
"conversation_complete": goal_status.get("all_completed", False)
|
||||
|
@ -427,7 +428,7 @@ class BaseConversationFlowService:
|
|||
"type": "ai_response",
|
||||
"text": ai_response,
|
||||
"audio": audio_base64,
|
||||
"audio_format": "mp3",
|
||||
"audio_format": "wav",
|
||||
"character": personality_name,
|
||||
"goal_status": goal_status,
|
||||
"conversation_complete": goal_status.get("all_completed", False)
|
||||
|
|
Loading…
Reference in New Issue