当前位置: 首页>>代码示例>>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;未经允许,请勿转载。