 4cfad5ae0f
			
		
	
	
		4cfad5ae0f
		
	
	
	
	
		
			
			- 全新ui - 全面优化websocket逻辑,提高数字人和ui连接的稳定性及资源开销 - 全面优化唤醒逻辑,提供稳定的普通唤醒模式和前置词唤醒模式 - 优化拾音质量,支持多声道麦克风拾音 - 优化自动播放服务器的对接机制,提供稳定和兼容旧版ue工程的对接模式 - 数字人接口输出机器人表情,以适应新fay ui及单片机的数字人表情输出 - 使用更高级的音频时长计算方式,可以更精准控制音频播放完成后的逻辑 - 修复点击关闭按钮会导致程序退出的bug - 修复没有麦克风的设备开启麦克风会出错的问题 - 为服务器主机地址提供配置项,以方便服务器部署
		
			
				
	
	
		
			96 lines
		
	
	
		
			2.4 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			96 lines
		
	
	
		
			2.4 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
| from enum import Enum
 | |
| 
 | |
| 
 | |
| class EnumVoice(Enum):
 | |
|     XIAO_XIAO_NEW = {
 | |
|         "name": "晓晓(azure)",
 | |
|         "voiceName": "zh-CN-XiaoxiaoMultilingualNeural",
 | |
|         "styleList": {
 | |
|             "angry": "angry",
 | |
|             "lyrical": "lyrical",
 | |
|             "calm": "gentle",
 | |
|             "assistant": "affectionate",
 | |
|             "cheerful": "cheerful"
 | |
|         }
 | |
|     }
 | |
|     XIAO_XIAO = {
 | |
|         "name": "晓晓",
 | |
|         "voiceName": "zh-CN-XiaoxiaoNeural",
 | |
|         "styleList": {
 | |
|             "angry": "angry",
 | |
|             "lyrical": "lyrical",
 | |
|             "calm": "gentle",
 | |
|             "assistant": "affectionate",
 | |
|             "cheerful": "cheerful"
 | |
|         }
 | |
|     }
 | |
|     YUN_XI = {
 | |
|         "name": "云溪",
 | |
|         "voiceName": "zh-CN-YunxiNeural",
 | |
|         "styleList": {
 | |
|             "angry": "angry",
 | |
|             "lyrical": "disgruntled",
 | |
|             "calm": "calm",
 | |
|             "assistant": "assistant",
 | |
|             "cheerful": "cheerful"
 | |
|         }
 | |
|     }
 | |
|     YUN_JIAN = {
 | |
|         "name": "云健",
 | |
|         "voiceName": "zh-CN-YunjianNeural",
 | |
|         "styleList": {
 | |
|             "angry": "angry",
 | |
|             "lyrical": "disgruntled",
 | |
|             "calm": "calm",
 | |
|             "assistant": "assistant",
 | |
|             "cheerful": "cheerful"
 | |
|         }
 | |
|     }
 | |
|     XIAO_YI = {
 | |
|         "name": "晓伊",
 | |
|         "voiceName": "zh-CN-XiaoyiNeural",
 | |
|         "styleList": {
 | |
|             "angry": "angry",
 | |
|             "lyrical": "lyrical",
 | |
|             "calm": "gentle",
 | |
|             "assistant": "affectionate",
 | |
|             "cheerful": "cheerful"
 | |
|         }
 | |
|     }
 | |
|     YUN_YANG = {
 | |
|         "name": "云阳",
 | |
|         "voiceName": "zh-CN-YunyangNeural",
 | |
|         "styleList": {
 | |
|             "angry": "angry",
 | |
|             "lyrical": "lyrical",
 | |
|             "calm": "gentle",
 | |
|             "assistant": "affectionate",
 | |
|             "cheerful": "cheerful"
 | |
|         }
 | |
|     }
 | |
|     YUN_XIA = {
 | |
|         "name": "云夏",
 | |
|         "voiceName": "zh-CN-YunxiaNeural",
 | |
|         "styleList": {
 | |
|             "angry": "angry",
 | |
|             "lyrical": "lyrical",
 | |
|             "calm": "gentle",
 | |
|             "assistant": "affectionate",
 | |
|             "cheerful": "cheerful"
 | |
|         }
 | |
|     }
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| def get_voice_list():
 | |
|     return [EnumVoice.XIAO_XIAO_NEW, EnumVoice.YUN_XI, EnumVoice.XIAO_XIAO, EnumVoice.YUN_JIAN, EnumVoice.XIAO_YI, EnumVoice.YUN_YANG, EnumVoice.YUN_XIA]
 | |
| 
 | |
| 
 | |
| def get_voice_of(name):
 | |
|     for voice in get_voice_list():
 | |
|         voice_data = voice.value 
 | |
|         if voice_data["name"] == name:
 | |
|             return voice
 | |
|     return None
 |