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

Add support to fixed block size recording with pulseaudio #12

Closed mpariente closed 6 years ago

mpariente commented 6 years ago

To enable the mic to return a fixed number of frames at each call I introduce _record_chunk which will perform what record used to perform without reshaping the data at the output, record_chunk which will perform what record used to perform and record which will call _record_chunk and perform the buffering internally so that every call, the same number of frames is returned. I also implemented flush to empty the last _pending_frame.

mpariente commented 6 years ago

I agree with your comments and I'm working on them. Just one quick question, can we add a .gitignore to the repo? I'm recompiling soundcard at every change to make tests and it would be nice if we don't have to delete dist, build and .egg-info before every commit.

bastibe commented 6 years ago

Just one quick question, can we add a .gitignore to the repo?

Absolutely! Although your particular problem might be solved with pip install -e ., which will link the soundcard into your packages instead of copying, thus applying every change immediately.

mpariente commented 6 years ago

Btw : Sorry for the three commits, I made dumb mistakes on the code.

mpariente commented 6 years ago

It's a pleasure !

bastibe commented 6 years ago

Thank you very much for this contribution!

I'll try to implement the same change in the other backends, and then publish a new version on PyPi. (unless you want to try on another platform.)