Wavファイルはwave.open(ファイル名)で読み込みます。
pyqtgraphに表示するためにはどのような方法が考えられますでしょうか。
Pyton
1# -*- coding: utf-8 -*- 2import sys 3import numpy as np 4from scipy import signal 5from scipy.io.wavfile import write 6from PySide2.QtWidgets import * 7from PySide2.QtCore import * 8import winsound as ws 9import wave 10import pyqtgraph as pg 11#--------------------------------------------------- 12# Window 13#--------------------------------------------------- 14class Gui(QDialog): 15 def __init__(self, parent=None): 16 super(Gui, self).__init__(parent) 17 self.design() 18 19 def design(self): 20 # button 21 self.button = QPushButton('Push') 22 # Graph 23 self.graph = pg.PlotWidget() 24 self.graph.setMinimumSize(500, 250) 25 self.graph.setMaximumSize(500, 250) 26 # layout 27 layout = QVBoxLayout(self) 28 layout.addWidget(self.graph) 29 layout.addWidget(self.button) 30 # Connect 31 self.button.clicked.connect(self.setWave) 32 33 def setWave(self): 34 pass 35 36if __name__ == '__main__': 37 app = QApplication(sys.argv) 38 g = Gui() 39 g.show() 40 sys.exit(app.exec_())
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2020/07/23 11:56
2020/07/23 12:03
2020/07/23 12:22
2020/07/23 12:34