Some flags in rubberband are not followed by a value, e.g. --no-lamination or --pitch-hq. The current implementation always expects rbargs as pairs of keyword and argument (in dict format), making it impossible to use flags that don't take values.
Steps/Code to Reproduce
import pyrubberband
# Generate a random signal and time-stretch it
sr = 22050
y = np.random.randn(5 * sr)
y_stretch = pyrubberband.time_stretch(y, sr, rate=1.5, rbargs={"-c": "6"}) # works
y_stretch = pyrubberband.time_stretch(y, sr, rate=1.5, rbargs={"--pitch-hq": ""}) # fails
y_stretch = pyrubberband.time_stretch(y, sr, rate=1.5, rbargs={"--pitch-hq": " "}) # fails
y_stretch = pyrubberband.time_stretch(y, sr, rate=1.5, rbargs={"--pitch-hq": None}) # fails
Expected Results
Should be possible to call no-value flags such as --pitch-hq. Included some examples above of syntax that could be supported with dicts (e.g. None). Alternative dict could be replaced with e.g. tuple that can have either 1 or 2 elements.
Description
Some flags in rubberband are not followed by a value, e.g.
--no-lamination
or--pitch-hq
. The current implementation always expects rbargs as pairs of keyword and argument (in dict format), making it impossible to use flags that don't take values.Steps/Code to Reproduce
Expected Results
Should be possible to call no-value flags such as
--pitch-hq
. Included some examples above of syntax that could be supported with dicts (e.g. None). Alternative dict could be replaced with e.g. tuple that can have either 1 or 2 elements.Actual Results
Versions
Darwin-18.2.0-x86_64-i386-64bit Python 3.5.6 |Anaconda, Inc.| (default, Aug 26 2018, 16:30:03) [GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] NumPy 1.18.2 SoundFile 0.9.0