spatialaudio / python-sounddevice

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

Echo appears when blocksize is around 0.7 sesonds #463

Open sergorl opened 1 year ago

sergorl commented 1 year ago

I use this example of "Input to Output Pass-Through": wire.py

But when blocksize is *84096 (around 0.7 seconds with samplerate = 44.1 kHz**) I hear echo for every sound.

Is it expected behaviour or is it bug? How can I fix it?

P.S.: my requirement is blocksize should be not less than *84096**

sergorl commented 1 year ago

By the way, when blocksize is less than 4096 there is no echo.

HaHeho commented 1 year ago

With echo do you mean that the input signal is played twice (once delayed) via the output?

Or is the input only played twice and you perceive it as an echo? The latter can be considered as part of a known psychoacoustic effect commonly called "echo threshold". Above a certain delay, around a few tens of miliseconds according to literature, two partially coherent sound events transition from being perceived as a single event to being perceived as a distinct echo.

mgeier commented 1 year ago

Any news on this @sergorl?

It might also be helpful to switch from loudspeakers to headphones (or vice versa) and to hear if the perceived echo is the same. But be careful to avoid acoustic feedback when using loudspeakers.