Prior to this PR, calling .read() on a ResampledReadableAudioFile would not release Python's GIL when doing its (potentially very expensive) resampling calculations. This PR releases the GIL as much as possible to allow multiple threads to resample audio simultaneously. (The GIL could be released even further by refactoring the ReadableAudioFile interface to avoid copies through the py::array_t type; but that's not quite in scope for this PR.)
Prior to this PR, calling
.read()
on aResampledReadableAudioFile
would not release Python's GIL when doing its (potentially very expensive) resampling calculations. This PR releases the GIL as much as possible to allow multiple threads to resample audio simultaneously. (The GIL could be released even further by refactoring theReadableAudioFile
interface to avoid copies through thepy::array_t
type; but that's not quite in scope for this PR.)