-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
[fix] 将Minimax TTS默认输出格式改为wav以解决RIFF错误 #7797
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -65,7 +65,7 @@ def __init__( | |||||||||||||||||||||
| self.audio_setting: dict = { | ||||||||||||||||||||||
| "sample_rate": 32000, | ||||||||||||||||||||||
| "bitrate": 128000, | ||||||||||||||||||||||
| "format": "mp3", | ||||||||||||||||||||||
| "format": "wav", | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| self.concat_base_url: str = f"{self.api_base}?GroupId={self.group_id}" | ||||||||||||||||||||||
|
|
@@ -147,7 +147,7 @@ async def _audio_play(self, audio_stream: AsyncIterator[str]) -> bytes: | |||||||||||||||||||||
| async def get_audio(self, text: str) -> str: | ||||||||||||||||||||||
| temp_dir = get_astrbot_temp_path() | ||||||||||||||||||||||
| os.makedirs(temp_dir, exist_ok=True) | ||||||||||||||||||||||
| path = os.path.join(temp_dir, f"minimax_tts_api_{uuid.uuid4()}.mp3") | ||||||||||||||||||||||
| path = os.path.join(temp_dir, f"minimax_tts_api_{uuid.uuid4()}.wav") | ||||||||||||||||||||||
|
Comment on lines
148
to
+150
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion (bug_risk): Derive the file extension from The container format is currently defined both in
Suggested change
|
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| try: | ||||||||||||||||||||||
| # 直接将异步生成器传递给 _audio_play 方法 | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
由于输出格式已更改为
wav,建议从audio_setting中移除bitrate参数。根据 MiniMax T2A V2 API 文档,bitrate参数仅在格式为mp3时有效。在请求wav格式时发送此参数可能会被 API 忽略或视为冗余。移除它可以使配置更加清晰且符合 API 规范。