當前位置: 首頁>>代碼示例>>Python>>正文


Python Plot.plot_audio方法代碼示例

本文整理匯總了Python中plot.Plot.plot_audio方法的典型用法代碼示例。如果您正苦於以下問題:Python Plot.plot_audio方法的具體用法?Python Plot.plot_audio怎麽用?Python Plot.plot_audio使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在plot.Plot的用法示例。


在下文中一共展示了Plot.plot_audio方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: create_record

# 需要導入模塊: from plot import Plot [as 別名]
# 或者: from plot.Plot import plot_audio [as 別名]
    def create_record(self, root):
        self.frame_record = Frame(root)
        self.frame_record.pack(side=TOP, fill=BOTH, pady=(0,5))
        self.frame_record1 = Frame(self.frame_record)
        self.frame_record1.pack(side=TOP, fill=BOTH, pady=(0,10))
        self.frame_record2 = Frame(self.frame_record)                    #12 between 1 and 2
        self.frame_record2.pack(side=TOP, fill=BOTH, pady=(0,10))
        self.frame_record3 = Frame(self.frame_record)
        self.frame_record3.pack(side=BOTTOM, fill=NONE)

        l_caption = Label(self.frame_record1, text="Record sound:")
        l_caption.pack(side=LEFT)
        b_help = Button(self.frame_record1, text="info", width=3, height=1)
        b_help.pack(side=RIGHT)

        self.l_selected_file_name_var = StringVar()
        self.l_selected_file_name_var.set("[Selected file name:] none")

        l_selected_file_name = Label(self.frame_record2, textvariable = self.l_selected_file_name_var, width = 30, height = 1, anchor = 'w')
        l_selected_file_name.pack(side = LEFT)

        self.b_waveform = Button(self.frame_record2, text = "WaveForm", width = 8, height = 1, command = lambda : Plot.plot_audio(self.full_file_path, "raw", self.radioIntVar))
        self.b_waveform.pack(side = RIGHT)
        self.b_waveform['state'] = 'disabled'

        self.b_fft = Button(self.frame_record2, text = "FFT", width = 8, height = 1, command = lambda : Plot.plot_audio(self.full_file_path, "fft", self.radioIntVar))
        self.b_fft.pack(side = RIGHT, padx = 3)
        self.b_fft['state'] = 'disabled'

        self.b_spectrogram = Button(self.frame_record2, text = "Spectrogram", width = 10, height = 1, command = lambda : Plot.plot_audio(self.full_file_path, "spectrogram", self.radioIntVar))
        self.b_spectrogram.pack(side = RIGHT, padx = 3)
        self.b_spectrogram['state'] = 'disabled'

        self.radioIntVar = IntVar()
        R1 = Radiobutton(self.frame_record2, text="2D", variable=self.radioIntVar, value=1, command= lambda: self.handleRadioSel())
        R1.pack( side = RIGHT)
        self.radioIntVar.set(1)     # init 2D as default

        R2 = Radiobutton(self.frame_record2, text="3D", variable=self.radioIntVar, value=2, command= lambda: self.handleRadioSel())
        R2.pack( side = RIGHT)


        global b_start
        global l_time
        b_start = Button(self.frame_record3, text='Record', width=12, height=2, command=lambda: self.main_button_click())
        b_start.pack(pady=10, padx=15, side=LEFT)

        self.l_timer_var.set('00:00')
        l_time = Label(self.frame_record3, height=1, width=5, state='disabled', bg='white', textvariable=self.l_timer_var, foreground='black')
        l_time.pack(pady=10, padx=(10,0), side=LEFT)
        l_status = Label(self.frame_record3, text="...recording", foreground='red')
        l_status.pack(pady=10, padx=(5,10), side=LEFT)
        b_reset = Button(self.frame_record3, text='Reset', padx=2, command=self.reset_button_click())
        b_reset.pack(pady=10, padx=20, side=LEFT)
開發者ID:aleksandarbos,項目名稱:Sound-Recognition-Convo2D-Neural-Network,代碼行數:56,代碼來源:gui.py


注:本文中的plot.Plot.plot_audio方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。