DeepSpeech/native_client/python/model.i
Reuben Morais 90f6aaa760
Enable SWIG threads support in model.i
Without this, `model.stt` will hold the GIL and block Python code in other threads.
2018-01-10 21:38:31 -02:00

18 lines
452 B
OpenEdge ABL

%module(threads="1") model
%{
#define SWIG_FILE_WITH_INIT
#include "deepspeech.h"
%}
%include "numpy.i"
%init %{
import_array();
%}
%apply (short* IN_ARRAY1, int DIM1) {(const short* aBuffer, unsigned int aBufferSize)};
%apply (float** ARGOUTVIEWM_ARRAY2, int* DIM1, int* DIM2) {(float** aMfcc, int* aNFrames, int* aFrameLen)};
%apply (float* IN_ARRAY2, int DIM1, int DIM2) {(float* aMfcc, int aNFrames, int aFrameLen)};
%include "../deepspeech.h"