tools/utilities/pythonlibs/audio/view_audio.py
def init_ui(self):
        """ setup the GUI for the app """
        self.master.title("Test")
        self.pack(fill=BOTH, expand=True)

        # Input section
        input_frame = LabelFrame(self, text="Input")
        input_frame.bind("-", self.on_minus_key)
        input_frame.bind("+", self.on_plus_key)
        input_frame.pack(fill=X)
        self.play_button = Button(input_frame, text="Play", command=self.on_play_button_click)
        self.play_button.pack(side=RIGHT, padx=4)
        self.rec_button = Button(input_frame, text="Rec", command=self.on_rec_button_click)
        self.rec_button.pack(side=RIGHT, padx=4)
        self.wav_filename_entry = Entry(input_frame, width=24)
        self.wav_filename_entry.pack(fill=X)
        self.wav_filename_entry.delete(0, END)
        if self.wav_filename:
            self.wav_filename_entry.insert(0, self.wav_filename)

        # Feature section
        features_frame = LabelFrame(self, text="Features")
        features_frame.pack(fill=X)

        features_control_frame = Frame(features_frame)
        features_control_frame.pack(fill=X)
        load_features_button = Button(features_control_frame, text="Load", command=self.on_load_featurizer_model)
        load_features_button.pack(side=RIGHT)
        self.features_entry = Entry(features_control_frame, width=8)
        self.features_entry.pack(fill=X)
        self.features_entry.delete(0, END)
        if self.featurizer_model:
            self.features_entry.insert(0, self.featurizer_model)

        viz_frame = Frame(features_frame)
        viz_frame.pack(fill=X)
        self.features_figure = Figure(figsize=(5, 4), dpi=100)
        self.subplot = self.features_figure.add_subplot(111)

        canvas = FigureCanvasTkAgg(self.features_figure, master=viz_frame)
        canvas.draw()
        canvas.show()
        canvas.get_tk_widget().pack(side=TOP, fill=BOTH, expand=True)

        # Classifier section
        classifier_frame = LabelFrame(self, text="Classifier")
        classifier_frame.pack(fill=X)
        load_classifier_button = Button(classifier_frame, text="Load", command=self.on_load_classifier)
        load_classifier_button.pack(side=RIGHT)
        self.classifier_entry = Entry(classifier_frame, width=8)
        self.classifier_entry.pack(fill=X)
        self.classifier_entry.delete(0, END)
        if self.classifier_model:
            self.classifier_entry.insert(0, self.classifier_model)

        # Output section
        output_frame = LabelFrame(self, text="Output")
        output_frame.pack(fill=BOTH, expand=True)

        self.output_text = Text(output_frame)
        self.output_text.pack(fill=BOTH, padx=4, expand=True)
 setup the GUI for the app 
setup the GUI for the app
setup the GUI for the app
def init_ui(self):
        self.master.title("Test")
        self.pack(fill=BOTH, expand=True)
        input_frame = LabelFrame(self, text="Input")
        input_frame.bind("-", self.on_minus_key)
        input_frame.bind("+", self.on_plus_key)
        input_frame.pack(fill=X)
        self.play_button = Button(input_frame, text="Play", command=self.on_play_button_click)
        self.play_button.pack(side=RIGHT, padx=4)
        self.rec_button = Button(input_frame, text="Rec", command=self.on_rec_button_click)
        self.rec_button.pack(side=RIGHT, padx=4)
        self.wav_filename_entry = Entry(input_frame, width=24)
        self.wav_filename_entry.pack(fill=X)
        self.wav_filename_entry.delete(0, END)
        if self.wav_filename:
            self.wav_filename_entry.insert(0, self.wav_filename)
        features_frame = LabelFrame(self, text="Features")
        features_frame.pack(fill=X)
        features_control_frame = Frame(features_frame)
        features_control_frame.pack(fill=X)
        load_features_button = Button(features_control_frame, text="Load", command=self.on_load_featurizer_model)
        load_features_button.pack(side=RIGHT)
        self.features_entry = Entry(features_control_frame, width=8)
        self.features_entry.pack(fill=X)
        self.features_entry.delete(0, END)
        if self.featurizer_model:
            self.features_entry.insert(0, self.featurizer_model)
        viz_frame = Frame(features_frame)
        viz_frame.pack(fill=X)
        self.features_figure = Figure(figsize=(5, 4), dpi=100)
        self.subplot = self.features_figure.add_subplot(111)
        canvas = FigureCanvasTkAgg(self.features_figure, master=viz_frame)
        canvas.draw()
        canvas.show()
        canvas.get_tk_widget().pack(side=TOP, fill=BOTH, expand=True)
        classifier_frame = LabelFrame(self, text="Classifier")
        classifier_frame.pack(fill=X)
        load_classifier_button = Button(classifier_frame, text="Load", command=self.on_load_classifier)
        load_classifier_button.pack(side=RIGHT)
        self.classifier_entry = Entry(classifier_frame, width=8)
        self.classifier_entry.pack(fill=X)
        self.classifier_entry.delete(0, END)
        if self.classifier_model:
            self.classifier_entry.insert(0, self.classifier_model)
        output_frame = LabelFrame(self, text="Output")
        output_frame.pack(fill=BOTH, expand=True)
        self.output_text = Text(output_frame)
        self.output_text.pack(fill=BOTH, padx=4, expand=True)
def init_ui ( self ) : self . master . title ( "Test" ) self . pack ( fill = BOTH , expand = True ) input_frame = LabelFrame ( self , text = "Input" ) input_frame . bind ( "-" , self . on_minus_key ) input_frame . bind ( "+" , self . on_plus_key ) input_frame . pack ( fill = X ) self . play_button = Button ( input_frame , text = "Play" , command = self . on_play_button_click ) self . play_button . pack ( side = RIGHT , padx = 4 ) self . rec_button = Button ( input_frame , text = "Rec" , command = self . on_rec_button_click ) self . rec_button . pack ( side = RIGHT , padx = 4 ) self . wav_filename_entry = Entry ( input_frame , width = 24 ) self . wav_filename_entry . pack ( fill = X ) self . wav_filename_entry . delete ( 0 , END ) if self . wav_filename : self . wav_filename_entry . insert ( 0 , self . wav_filename ) features_frame = LabelFrame ( self , text = "Features" ) features_frame . pack ( fill = X ) features_control_frame = Frame ( features_frame ) features_control_frame . pack ( fill = X ) load_features_button = Button ( features_control_frame , text = "Load" , command = self . on_load_featurizer_model ) load_features_button . pack ( side = RIGHT ) self . features_entry = Entry ( features_control_frame , width = 8 ) self . features_entry . pack ( fill = X ) self . features_entry . delete ( 0 , END ) if self . featurizer_model : self . features_entry . insert ( 0 , self . featurizer_model ) viz_frame = Frame ( features_frame ) viz_frame . pack ( fill = X ) self . features_figure = Figure ( figsize = ( 5 , 4 ) , dpi = 100 ) self . subplot = self . features_figure . add_subplot ( 111 ) canvas = FigureCanvasTkAgg ( self . features_figure , master = viz_frame ) canvas . draw ( ) canvas . show ( ) canvas . get_tk_widget ( ) . pack ( side = TOP , fill = BOTH , expand = True ) classifier_frame = LabelFrame ( self , text = "Classifier" ) classifier_frame . pack ( fill = X ) load_classifier_button = Button ( classifier_frame , text = "Load" , command = self . on_load_classifier ) load_classifier_button . pack ( side = RIGHT ) self . classifier_entry = Entry ( classifier_frame , width = 8 ) self . classifier_entry . pack ( fill = X ) self . classifier_entry . delete ( 0 , END ) if self . classifier_model : self . classifier_entry . insert ( 0 , self . classifier_model ) output_frame = LabelFrame ( self , text = "Output" ) output_frame . pack ( fill = BOTH , expand = True ) self . output_text = Text ( output_frame ) self . output_text . pack ( fill = BOTH , padx = 4 , expand = True )
setup the GUI for the app
setup the GUI for the app
""" setup the GUI for the app """ # Input section # Feature section # Classifier section # Output section
self