remove Parameters

INPUT_SPEAKER_SAMPLING_RATE/INPUT_SPEAKER_BUFFER_SIZE
This commit is contained in:
misyaguziya
2023-06-20 10:46:09 +09:00
parent 3e246b7aa6
commit ab1c9f5254
2 changed files with 2 additions and 54 deletions

View File

@@ -41,9 +41,7 @@ class App(customtkinter.CTk):
self.INPUT_MIC_THRESHOLD = 300 self.INPUT_MIC_THRESHOLD = 300
self.CHOICE_SPEAKER_DEVICE = None self.CHOICE_SPEAKER_DEVICE = None
self.INPUT_SPEAKER_VOICE_LANGUAGE = "en-US" self.INPUT_SPEAKER_VOICE_LANGUAGE = "en-US"
self.INPUT_SPEAKER_SAMPLING_RATE = 16000
self.INPUT_SPEAKER_INTERVAL = 4 self.INPUT_SPEAKER_INTERVAL = 4
self.INPUT_SPEAKER_BUFFER_SIZE = 4096
## Parameter ## Parameter
self.OSC_IP_ADDRESS = "127.0.0.1" self.OSC_IP_ADDRESS = "127.0.0.1"
@@ -105,12 +103,8 @@ class App(customtkinter.CTk):
self.CHOICE_SPEAKER_DEVICE = config["CHOICE_SPEAKER_DEVICE"] self.CHOICE_SPEAKER_DEVICE = config["CHOICE_SPEAKER_DEVICE"]
if "INPUT_SPEAKER_VOICE_LANGUAGE" in config.keys(): if "INPUT_SPEAKER_VOICE_LANGUAGE" in config.keys():
self.INPUT_SPEAKER_VOICE_LANGUAGE = config["INPUT_SPEAKER_VOICE_LANGUAGE"] self.INPUT_SPEAKER_VOICE_LANGUAGE = config["INPUT_SPEAKER_VOICE_LANGUAGE"]
if "INPUT_SPEAKER_SAMPLING_RATE" in config.keys():
self.INPUT_SPEAKER_SAMPLING_RATE = config["INPUT_SPEAKER_SAMPLING_RATE"]
if "INPUT_SPEAKER_INTERVAL" in config.keys(): if "INPUT_SPEAKER_INTERVAL" in config.keys():
self.INPUT_SPEAKER_INTERVAL = config["INPUT_SPEAKER_INTERVAL"] self.INPUT_SPEAKER_INTERVAL = config["INPUT_SPEAKER_INTERVAL"]
if "INPUT_SPEAKER_BUFFER_SIZE" in config.keys():
self.INPUT_SPEAKER_BUFFER_SIZE = config["INPUT_SPEAKER_BUFFER_SIZE"]
# Parameter # Parameter
if "OSC_IP_ADDRESS" in config.keys(): if "OSC_IP_ADDRESS" in config.keys():
@@ -143,9 +137,7 @@ class App(customtkinter.CTk):
"INPUT_MIC_THRESHOLD": self.INPUT_MIC_THRESHOLD, "INPUT_MIC_THRESHOLD": self.INPUT_MIC_THRESHOLD,
"CHOICE_SPEAKER_DEVICE": self.CHOICE_SPEAKER_DEVICE, "CHOICE_SPEAKER_DEVICE": self.CHOICE_SPEAKER_DEVICE,
"INPUT_SPEAKER_VOICE_LANGUAGE": self.INPUT_SPEAKER_VOICE_LANGUAGE, "INPUT_SPEAKER_VOICE_LANGUAGE": self.INPUT_SPEAKER_VOICE_LANGUAGE,
"INPUT_SPEAKER_SAMPLING_RATE": self.INPUT_SPEAKER_SAMPLING_RATE,
"INPUT_SPEAKER_INTERVAL": self.INPUT_SPEAKER_INTERVAL, "INPUT_SPEAKER_INTERVAL": self.INPUT_SPEAKER_INTERVAL,
"INPUT_SPEAKER_BUFFER_SIZE": self.INPUT_SPEAKER_BUFFER_SIZE,
"OSC_IP_ADDRESS": self.OSC_IP_ADDRESS, "OSC_IP_ADDRESS": self.OSC_IP_ADDRESS,
"OSC_PORT": self.OSC_PORT, "OSC_PORT": self.OSC_PORT,
"AUTH_KEYS": self.AUTH_KEYS, "AUTH_KEYS": self.AUTH_KEYS,

View File

@@ -297,22 +297,6 @@ class ToplevelWindowConfig(customtkinter.CTkToplevel):
) )
self.optionmenu_input_speaker_voice_language.grid(row=5, column=1, columnspan=1 ,padx=5, pady=5, sticky="nsew") self.optionmenu_input_speaker_voice_language.grid(row=5, column=1, columnspan=1 ,padx=5, pady=5, sticky="nsew")
## entry input speaker sampling rate
self.label_input_speaker_sampling_rate = customtkinter.CTkLabel(
self.tabview_config.tab("Transcription"),
text="Input Speaker SamplingRate:",
fg_color="transparent",
font=customtkinter.CTkFont(family=self.parent.FONT_FAMILY)
)
self.label_input_speaker_sampling_rate.grid(row=6, column=0, columnspan=1, padx=5, pady=5, sticky="nsw")
self.entry_input_speaker_sampling_rate = customtkinter.CTkEntry(
self.tabview_config.tab("Transcription"),
textvariable=customtkinter.StringVar(value=self.parent.INPUT_SPEAKER_SAMPLING_RATE),
font=customtkinter.CTkFont(family=self.parent.FONT_FAMILY)
)
self.entry_input_speaker_sampling_rate.grid(row=6, column=1, columnspan=1 ,padx=5, pady=5, sticky="nsew")
self.entry_input_speaker_sampling_rate.bind("<Any-KeyRelease>", self.entry_input_speaker_sampling_rate_callback)
## entry input speaker interval ## entry input speaker interval
self.label_input_speaker_interval = customtkinter.CTkLabel( self.label_input_speaker_interval = customtkinter.CTkLabel(
self.tabview_config.tab("Transcription"), self.tabview_config.tab("Transcription"),
@@ -320,31 +304,15 @@ class ToplevelWindowConfig(customtkinter.CTkToplevel):
fg_color="transparent", fg_color="transparent",
font=customtkinter.CTkFont(family=self.parent.FONT_FAMILY) font=customtkinter.CTkFont(family=self.parent.FONT_FAMILY)
) )
self.label_input_speaker_interval.grid(row=7, column=0, columnspan=1, padx=5, pady=5, sticky="nsw") self.label_input_speaker_interval.grid(row=6, column=0, columnspan=1, padx=5, pady=5, sticky="nsw")
self.entry_input_speaker_interval = customtkinter.CTkEntry( self.entry_input_speaker_interval = customtkinter.CTkEntry(
self.tabview_config.tab("Transcription"), self.tabview_config.tab("Transcription"),
textvariable=customtkinter.StringVar(value=self.parent.INPUT_SPEAKER_INTERVAL), textvariable=customtkinter.StringVar(value=self.parent.INPUT_SPEAKER_INTERVAL),
font=customtkinter.CTkFont(family=self.parent.FONT_FAMILY) font=customtkinter.CTkFont(family=self.parent.FONT_FAMILY)
) )
self.entry_input_speaker_interval.grid(row=7, column=1, columnspan=1 ,padx=5, pady=5, sticky="nsew") self.entry_input_speaker_interval.grid(row=6, column=1, columnspan=1 ,padx=5, pady=5, sticky="nsew")
self.entry_input_speaker_interval.bind("<Any-KeyRelease>", self.entry_input_speaker_interval_callback) self.entry_input_speaker_interval.bind("<Any-KeyRelease>", self.entry_input_speaker_interval_callback)
## entry input speaker buffer size
self.label_input_speaker_buffer_size = customtkinter.CTkLabel(
self.tabview_config.tab("Transcription"),
text="Input Speaker BufferSize:",
fg_color="transparent",
font=customtkinter.CTkFont(family=self.parent.FONT_FAMILY)
)
self.label_input_speaker_buffer_size.grid(row=8, column=0, columnspan=1, padx=5, pady=5, sticky="nsw")
self.entry_input_speaker_buffer_size = customtkinter.CTkEntry(
self.tabview_config.tab("Transcription"),
textvariable=customtkinter.StringVar(value=self.parent.INPUT_SPEAKER_BUFFER_SIZE),
font=customtkinter.CTkFont(family=self.parent.FONT_FAMILY)
)
self.entry_input_speaker_buffer_size.grid(row=8, column=1, columnspan=1 ,padx=5, pady=5, sticky="nsew")
self.entry_input_speaker_buffer_size.bind("<Any-KeyRelease>", self.entry_input_speaker_buffer_size_callback)
# tab Parameter # tab Parameter
## entry ip address ## entry ip address
self.label_ip_address = customtkinter.CTkLabel( self.label_ip_address = customtkinter.CTkLabel(
@@ -463,12 +431,8 @@ class ToplevelWindowConfig(customtkinter.CTkToplevel):
self.optionmenu_input_speaker_device.configure(font=customtkinter.CTkFont(family=choice)) self.optionmenu_input_speaker_device.configure(font=customtkinter.CTkFont(family=choice))
self.label_input_speaker_voice_language.configure(font=customtkinter.CTkFont(family=choice)) self.label_input_speaker_voice_language.configure(font=customtkinter.CTkFont(family=choice))
self.optionmenu_input_speaker_voice_language.configure(font=customtkinter.CTkFont(family=choice)) self.optionmenu_input_speaker_voice_language.configure(font=customtkinter.CTkFont(family=choice))
self.label_input_speaker_sampling_rate.configure(font=customtkinter.CTkFont(family=choice))
self.entry_input_speaker_sampling_rate.configure(font=customtkinter.CTkFont(family=choice))
self.label_input_speaker_interval.configure(font=customtkinter.CTkFont(family=choice)) self.label_input_speaker_interval.configure(font=customtkinter.CTkFont(family=choice))
self.entry_input_speaker_interval.configure(font=customtkinter.CTkFont(family=choice)) self.entry_input_speaker_interval.configure(font=customtkinter.CTkFont(family=choice))
self.label_input_speaker_buffer_size.configure(font=customtkinter.CTkFont(family=choice))
self.entry_input_speaker_buffer_size.configure(font=customtkinter.CTkFont(family=choice))
# tab Parameter # tab Parameter
self.label_ip_address.configure(font=customtkinter.CTkFont(family=choice)) self.label_ip_address.configure(font=customtkinter.CTkFont(family=choice))
@@ -571,18 +535,10 @@ class ToplevelWindowConfig(customtkinter.CTkToplevel):
self.parent.INPUT_SPEAKER_VOICE_LANGUAGE = choice self.parent.INPUT_SPEAKER_VOICE_LANGUAGE = choice
utils.save_json(self.parent.PATH_CONFIG, "INPUT_SPEAKER_VOICE_LANGUAGE", self.parent.INPUT_SPEAKER_VOICE_LANGUAGE) utils.save_json(self.parent.PATH_CONFIG, "INPUT_SPEAKER_VOICE_LANGUAGE", self.parent.INPUT_SPEAKER_VOICE_LANGUAGE)
def entry_input_speaker_sampling_rate_callback(self, event):
self.parent.INPUT_SPEAKER_SAMPLING_RATE = int(self.entry_input_speaker_sampling_rate.get())
utils.save_json(self.parent.PATH_CONFIG, "INPUT_SPEAKER_SAMPLING_RATE", self.parent.INPUT_SPEAKER_SAMPLING_RATE)
def entry_input_speaker_interval_callback(self, event): def entry_input_speaker_interval_callback(self, event):
self.parent.INPUT_SPEAKER_INTERVAL = int(self.entry_input_speaker_interval.get()) self.parent.INPUT_SPEAKER_INTERVAL = int(self.entry_input_speaker_interval.get())
utils.save_json(self.parent.PATH_CONFIG, "INPUT_SPEAKER_INTERVAL", self.parent.INPUT_SPEAKER_INTERVAL) utils.save_json(self.parent.PATH_CONFIG, "INPUT_SPEAKER_INTERVAL", self.parent.INPUT_SPEAKER_INTERVAL)
def entry_input_speaker_buffer_size_callback(self, event):
self.parent.INPUT_SPEAKER_BUFFER_SIZE = int(self.entry_input_speaker_buffer_size.get())
utils.save_json(self.parent.PATH_CONFIG, "INPUT_SPEAKER_BUFFER_SIZE", self.parent.INPUT_SPEAKER_BUFFER_SIZE)
def entry_ip_address_callback(self, event): def entry_ip_address_callback(self, event):
self.parent.OSC_IP_ADDRESS = self.entry_ip_address.get() self.parent.OSC_IP_ADDRESS = self.entry_ip_address.get()
utils.save_json(self.parent.PATH_CONFIG, "OSC_IP_ADDRESS", self.parent.OSC_IP_ADDRESS) utils.save_json(self.parent.PATH_CONFIG, "OSC_IP_ADDRESS", self.parent.OSC_IP_ADDRESS)