mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-06-02 00:57:41 +08:00
- Add MiniMax-M2.7-highspeed constant to const.py and MODEL_LIST - Update MinimaxBot default model from MiniMax-M2.1 to MiniMax-M2.7 - Add MinimaxVoice TTS provider (voice/minimax/minimax_voice.py) - Supports speech-2.8-hd and speech-2.8-turbo models - SSE streaming with hex-decoded audio chunks - Reuses MINIMAX_API_KEY - Register MinimaxVoice in voice factory - Add unit tests (14 tests, all passing) - Update README with MiniMax-M2.7-highspeed and TTS configuration
62 lines
1.6 KiB
Python
62 lines
1.6 KiB
Python
"""
|
|
voice factory
|
|
"""
|
|
|
|
|
|
def create_voice(voice_type):
|
|
"""
|
|
create a voice instance
|
|
:param voice_type: voice type code
|
|
:return: voice instance
|
|
"""
|
|
if voice_type == "baidu":
|
|
from voice.baidu.baidu_voice import BaiduVoice
|
|
|
|
return BaiduVoice()
|
|
elif voice_type == "google":
|
|
from voice.google.google_voice import GoogleVoice
|
|
|
|
return GoogleVoice()
|
|
elif voice_type == "openai":
|
|
from voice.openai.openai_voice import OpenaiVoice
|
|
|
|
return OpenaiVoice()
|
|
elif voice_type == "pytts":
|
|
from voice.pytts.pytts_voice import PyttsVoice
|
|
|
|
return PyttsVoice()
|
|
elif voice_type == "azure":
|
|
from voice.azure.azure_voice import AzureVoice
|
|
|
|
return AzureVoice()
|
|
elif voice_type == "elevenlabs":
|
|
from voice.elevent.elevent_voice import ElevenLabsVoice
|
|
|
|
return ElevenLabsVoice()
|
|
|
|
elif voice_type == "linkai":
|
|
from voice.linkai.linkai_voice import LinkAIVoice
|
|
|
|
return LinkAIVoice()
|
|
elif voice_type == "ali":
|
|
from voice.ali.ali_voice import AliVoice
|
|
|
|
return AliVoice()
|
|
elif voice_type == "edge":
|
|
from voice.edge.edge_voice import EdgeVoice
|
|
|
|
return EdgeVoice()
|
|
elif voice_type == "xunfei":
|
|
from voice.xunfei.xunfei_voice import XunfeiVoice
|
|
|
|
return XunfeiVoice()
|
|
elif voice_type == "tencent":
|
|
from voice.tencent.tencent_voice import TencentVoice
|
|
|
|
return TencentVoice()
|
|
elif voice_type == "minimax":
|
|
from voice.minimax.minimax_voice import MinimaxVoice
|
|
|
|
return MinimaxVoice()
|
|
raise RuntimeError
|