Closed mpariente closed 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.
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.
I started by suppressing completely the while loop in _record_chunk
, but it turned out more practical and more efficient to turn it into a while 1
so we don't have to check if a chunk was returned of not in record
record
now returns whatever pulseaudio is returning if numframes=None
, which I set as the default. Should None
be default? I think it's not a bad idea
record_chunk
doesn't exist anymore
Btw : Sorry for the three commits, I made dumb mistakes on the code.
It's a pleasure !
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.)
To enable the mic to return a fixed number of frames at each call I introduce
_record_chunk
which will perform whatrecord
used to perform without reshaping the data at the output,record_chunk
which will perform whatrecord
used to perform andrecord
which will call_record_chunk
and perform the buffering internally so that every call, the same number of frames is returned. I also implementedflush
to empty the last_pending_frame
.