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

This commit is contained in:
2025-12-13 15:43:09 -08:00
parent 993cd3b4c3
commit 9b8cbb82cd

View File

@@ -46,6 +46,7 @@ mylist = list(dict.fromkeys(mylist))
mylist_code = list(dict.fromkeys(mylist_code)) mylist_code = list(dict.fromkeys(mylist_code))
mylist_String = StringVar(value = "Languages") mylist_String = StringVar(value = "Languages")
mylist_String_Two = StringVar(value = "Voices")
# Attempts to create a Input Frame # Attempts to create a Input Frame
try: try:
@@ -235,12 +236,13 @@ def PiperTTS_GUI_Set_Prefrences():
# #
def Select_Voice_For_Language(Mylanguages): def Select_Voice_For_Language(Mylanguages):
x = mylist.index(Mylanguages) x = mylist.index(Mylanguages)
mylist2 = [] mylist2 = ["Voices"]
for voice_id, info in data.items(): for voice_id, info in data.items():
if info["language"]["code"] == mylist_code[x]: if info["language"]["code"] == mylist_code[x]:
mylist2.append(f"{info["name"]}") mylist2.append(f"{info["name"]}")
mylist2 = list(dict.fromkeys(mylist2)) mylist2 = list(dict.fromkeys(mylist2))
GUI_Combobox_2["values"] = mylist2
print(mylist2) print(mylist2)
@@ -336,12 +338,13 @@ GUI_Combobox_1_Label = Label(Prefrences_Frame, text="Language?")
GUI_Combobox_1 = ttk.Combobox(Prefrences_Frame, textvariable = mylist_String) GUI_Combobox_1 = ttk.Combobox(Prefrences_Frame, textvariable = mylist_String)
# #
GUI_Combobox_1["values"] = mylist 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())) GUI_Combobox_1.bind("<<ComboboxSelected>>", lambda event: Select_Voice_For_Language(mylist_String.get()))
# #
GUI_Combobox_2_Label = Label(Prefrences_Frame, text="Voice?") GUI_Combobox_2_Label = Label(Prefrences_Frame, text="Voice?")
GUI_Combobox_2 = ttk.Combobox(Prefrences_Frame) GUI_Combobox_2 = ttk.Combobox(Prefrences_Frame, textvariable = mylist_String_Two)
GUI_Spinbox_1_Label = Label(Prefrences_Frame, text="volume?") GUI_Spinbox_1_Label = Label(Prefrences_Frame, text="volume?")
GUI_Spinbox_1 = ttk.Spinbox(Prefrences_Frame, from_ = 1, to = 100) GUI_Spinbox_1 = ttk.Spinbox(Prefrences_Frame, from_ = 1, to = 100)
GUI_Spinbox_2_Label = Label(Prefrences_Frame, text="length_scale?") GUI_Spinbox_2_Label = Label(Prefrences_Frame, text="length_scale?")