Update Uptated-Prototype/PiperTTS-GUI-Test.py

This commit is contained in:
2025-12-13 13:44:21 -08:00
parent f15c7aa81d
commit cb54d3b8d9

View File

@@ -228,6 +228,16 @@ def PiperTTS_GUI_Set_Prefrences():
print(e, type(e))
print("An exception occurred - when Setting prefrences.")
#
def Select_Voice_For_Language(Mylanguages):
mylist2 = []
for voice_id, info in data.items():
if info["language"]["name_native"] == Mylanguages:
mylist2.append(f"{info["name"]}")
mylist2 = list(dict.fromkeys(mylist2))
print(mylist2)
'''
#
@@ -321,7 +331,9 @@ GUI_Combobox_1_Label = Label(Prefrences_Frame, text="Language?")
GUI_Combobox_1 = ttk.Combobox(Prefrences_Frame, textvariable = mylist_String)
#
GUI_Combobox_1["values"] = mylist
GUI_Combobox_1.bind("<<ComboboxSelected>>", lambda event: print(mylist_String.get().split(" ", 1)[0]))
#GUI_Combobox_1.bind("<<ComboboxSelected>>", lambda event: print(mylist_String.get().split(" ", 1)[0]))
GUI_Combobox_1.bind("<<ComboboxSelected>>", lambda event: Select_Voice_For_Language(mylist_String.get().split(" ", 1)[0]))
#
GUI_Combobox_2_Label = Label(Prefrences_Frame, text="Voice?")
GUI_Combobox_2 = ttk.Combobox(Prefrences_Frame)