This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
this code is not mine! i shamelessly copied it from http://stackoverflow.com/questions/19790188/expanding-english-language-contractions-in-python | |
all credits go to alko and arturomp @ stack overflow. | |
basically, it's a big find/replace. | |
""" | |
import re | |
cList = { | |
"ain't": "am not", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from ctypes import byref, c_float, c_void_p, CDLL | |
class RNNoise(object): | |
def __init__(self): | |
self._native = CDLL('./librnnoise.so') | |
self._native.rnnoise_process_frame.restype = c_float | |
self._native.rnnoise_process_frame.argtypes = ( | |
c_void_p, c_void_p, c_void_p) | |
self._native.rnnoise_create.restype = c_void_p |