spatialaudio / python-sounddevice

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

Why exiting script taks so long? #433

Open keith331 opened 1 year ago

keith331 commented 1 year ago

Hi everyone, Please bear with my stupid question. Why exiting script takes so long(30s) when I import sounddevice(0.4.5, python 3.9.7) on windows, This issue doesn't happen on mac. I thought that it was my laptop issue, but this issue exists when I try another brand new laptop. Any advice would be appreciated!

For example: go.py import sounddevice

Measure-Command {python go.py} Days : 0 Hours : 0 Minutes : 0 Seconds : 30 Milliseconds : 174 Ticks : 301744419 TotalDays : 0.000349241225694444 TotalHours : 0.00838178941666667 TotalMinutes : 0.502907365 TotalSeconds : 30.1744419 TotalMilliseconds : 30174.4419

mgeier commented 1 year ago

I have no idea. This sounds similar to #327, but that was not using Windows.

You could try different things that use PortAudio (e.g. Audacity, PyAudio) or you could try different versions of the PortAudio library. You could also try the pip vs. the conda installation, maybe there is a difference? And you could try those wheels for Windows: https://www.lfd.uci.edu/~gohlke/pythonlibs/#sounddevice

It might also be a problem with CFFI, you could try if the same thing happens with the soundfile module.