@@ -50,6 +50,27 @@ def __init__(self, parent=None):
5050 # 初始化Edge TTS Worker
5151 self .edge_tts_worker = None
5252
53+ # 语音功能开关
54+ self .voice_enable_switch = SwitchButton ()
55+ self .voice_enable_switch .setOffText (
56+ get_content_switchbutton_name_async (
57+ "basic_voice_settings" , "voice_enable" , "disable"
58+ )
59+ )
60+ self .voice_enable_switch .setOnText (
61+ get_content_switchbutton_name_async (
62+ "basic_voice_settings" , "voice_enable" , "enable"
63+ )
64+ )
65+ self .voice_enable_switch .setChecked (
66+ readme_settings_async ("basic_voice_settings" , "voice_enable" , default = True )
67+ )
68+ self .voice_enable_switch .checkedChanged .connect (
69+ lambda state : update_settings (
70+ "basic_voice_settings" , "voice_enable" , state
71+ )
72+ )
73+
5374 # 语音引擎设置
5475 self .voice_engine = ComboBox ()
5576 self .voice_engine .addItems (
@@ -83,6 +104,12 @@ def __init__(self, parent=None):
83104 self .update_edge_tts_voices ()
84105
85106 # 添加设置项到分组
107+ self .addGroup (
108+ get_theme_icon ("ic_fluent_speaker_off_20_filled" ),
109+ get_content_name_async ("basic_voice_settings" , "voice_enable" ),
110+ get_content_description_async ("basic_voice_settings" , "voice_enable" ),
111+ self .voice_enable_switch ,
112+ )
86113 self .addGroup (
87114 get_theme_icon ("ic_fluent_speaker_2_20_filled" ),
88115 get_content_name_async ("basic_voice_settings" , "voice_engine" ),
0 commit comments