回答編集履歴
1
pressed,released のコード例を追記
answer
CHANGED
@@ -4,7 +4,21 @@
|
|
4
4
|
|
5
5
|
シグナル `pressed`, `released` で開始・停止するようにします。
|
6
6
|
|
7
|
+
```python
|
8
|
+
def startSound(self):
|
9
|
+
print("Start")
|
7
10
|
|
11
|
+
def stopSound(self):
|
12
|
+
print("Stop")
|
13
|
+
|
14
|
+
def UI(self):
|
15
|
+
# 省略
|
16
|
+
|
17
|
+
button.pressed.connect(self.startSound)
|
18
|
+
button.released.connect(self.stopSound)
|
19
|
+
```
|
20
|
+
|
21
|
+
|
8
22
|
## 音声の再生について
|
9
23
|
|
10
24
|
winsound を import してるので、PlaySoundを想定しますが、注意点としては
|