spatialaudio / python-sounddevice

:sound: Play and Record Sound with Python :snake:
https://python-sounddevice.readthedocs.io/
MIT License
980 stars 145 forks source link

how can we end playback early? #440

Closed SoulProficiency closed 1 year ago

SoulProficiency commented 1 year ago

just like the command of 'stop' or "terminate"?

HaHeho commented 1 year ago

Utilizing KeyboardInterrupt should work? E.g. https://github.com/spatialaudio/python-sounddevice/blob/841e0a1b2ea2367476248e5f0fc6878154949417/examples/rec_unlimited.py#L82

SoulProficiency commented 1 year ago

i found it's not work with a pyqt5 GUI.i try to use a thread and it's work!