From 326adaf3f6a7be1d8b335d63f4d65a88a780ea0d Mon Sep 17 00:00:00 2001 From: Mihai Ghete Date: Fri, 6 Jan 2023 00:47:58 +0100 Subject: [PATCH] update rnnoise_create signature rnnoise_create requires a parameter since 231b9c02 (2019-05-29). the parameter denotes the model to use; NULL can be used as default. if this parameter is not added, mysterious segfaults occur: https://github.com/xiph/rnnoise/issues/69#issuecomment-498477189 --- rnnoise.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rnnoise.py b/rnnoise.py index 376d7f5..40edac6 100644 --- a/rnnoise.py +++ b/rnnoise.py @@ -9,12 +9,13 @@ lib = ctypes.cdll.LoadLibrary(lib_path) lib.rnnoise_process_frame.argtypes = [ctypes.c_void_p,ctypes.POINTER(ctypes.c_float),ctypes.POINTER(ctypes.c_float)] lib.rnnoise_process_frame.restype = ctypes.c_float +lib.rnnoise_create.argtypes = [ctypes.c_void_p] lib.rnnoise_create.restype = ctypes.c_void_p lib.rnnoise_destroy.argtypes = [ctypes.c_void_p] class RNNoise(object): def __init__(self): - self.obj = lib.rnnoise_create() + self.obj = lib.rnnoise_create(None) def process_frame(self,inbuf): outbuf = numpy.ndarray((480,), 'h', inbuf).astype(ctypes.c_float) outbuf_ptr = outbuf.ctypes.data_as(ctypes.POINTER(ctypes.c_float))