bastibe / SoundCard

A Pure-Python Real-Time Audio Library
https://soundcard.readthedocs.io
BSD 3-Clause "New" or "Revised" License
689 stars 70 forks source link

Partial incompatibility with Python 3.7 #50

Closed DrMarc closed 5 years ago

DrMarc commented 5 years ago

Playing a sound hangs once in a while for several seconds after playback under Python 3.7, but not under 3.5. or 3.6, at least on MacOS.

import soundcard soundcard.default_speaker().play(data, samplerate)

bastibe commented 5 years ago

Do you have any idea why this happens? I don't have a Mac available right now, but I know a few things used to work on macOS and don't any more. I suspect that it is an issue that cropped up with Mojave. Could this issue be related to Mojave as well, instead of Python 3.7?

(Because you re-installed a newer version or something like that?)

DrMarc commented 5 years ago

It could be, but it does work on Py 3.5 under Mojave (at least I have never observed the behaviour). I'm stumped by the irregular occurrence of the issue and unsure how to narrow down the problem. If you have any suggestions, I'll try them.

bastibe commented 5 years ago

That's strange. SoundCard is a pure-python module that really doesn't do anything interesting on a language level. Could you check if any of your dependencies had a major version change or something like that?

It doesn't make sense to me that SoundCard's behavior should change between Python versions.

That said, you could try the techniques in the newly added section on Latency and see if that improves things.