예제 #1
0
파일: Window.py 프로젝트: KOlexandr/Audio
    def fft_analyzer_record(self, time):
        if time.get() == 0:
            time.set(self.default_audio_time)

        wav = self.record_test_audio(time)
        if not wav is None:
            result_str = FFTVoiceAnalyzer.analyze(wav, self.processor)
            messagebox.showinfo("Result", result_str)
            if show_plots:
                plot = Plotter("DRA")
                plot.add_sub_plot_data("Digitized Recorded Audio", wav.get_one_channel_data(), x_label="Samples",
                                       y_label="Amplitude")
                plot.sub_plot_all_horizontal(show=False, save=True)
예제 #2
0
파일: Window.py 프로젝트: KOlexandr/Audio
 def fft_analyzer_select(self, path=path_to_test):
     askopenfile = filedialog.askopenfile(filetypes=[("Wave audio files", "*.wav *.wave")], defaultextension=".wav",
                                          initialdir=path)
     if not askopenfile is None:
         wav = WavFile(askopenfile.name)
         result_str = FFTVoiceAnalyzer.analyze(wav, self.processor)
         messagebox.showinfo("Result", result_str)
         if show_plots:
             plot = Plotter("DRA")
             plot.add_sub_plot_data("Digitized Recorded Audio", wav.get_one_channel_data(), x_label="Samples",
                                    y_label="Amplitude")
             plot.sub_plot_all_horizontal(show=False, save=True)
     else:
         messagebox.showwarning("Warning", "You should select one file. Please, try again")