spatialaudio / python-sounddevice

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

Can I continue recording until the volume drops below a threshold? #527

Closed creeper-0910 closed 3 months ago

creeper-0910 commented 3 months ago

I want to use sounddevice to continue recording until the volume drops below a certain value and then save it as a file, but in most examples I specify the number of seconds and record. Is it possible to do this?

mgeier commented 3 months ago

Yes, this is certainly possible. You'll have to implement the signal processing, though.

creeper-0910 commented 3 months ago

Thank you! Do you have any samples or other reference for signal processing implementation...?

mgeier commented 3 months ago

No, that's out of scope for the sounddevice module. But you could try asking at https://dsp.stackexchange.com/, for example.

creeper-0910 commented 3 months ago

Understood, thank you for your courteous response!