def get_effects(): soxeff_h_funcs = _sox.sox_get_effect_fns() i = 0 sehf = soxeff_h_funcs[0] while sehf != _ffi.NULL: seh = sehf() if seh.name != _ffi.NULL and seh.usage != _ffi.NULL: yield _ffi.string(seh.name), _ffi.string(seh.usage) i += 1 sehf = soxeff_h_funcs[i]
def __init__(self, inpf, outf): self._inpf = inpf._file self._outf = outf._file self._effects = [] self._cbdata = _ffi.NULL self._sec = _sox.sox_create_effects_chain(_ffi.addressof(self._inpf.encoding), _ffi.addressof(self._outf.encoding)) self.add_effect('input', [_ffi.string(self._inpf.filename)])
def __init__(self, file, msg=''): errmsg = "[Error Code %d] %s (%s)" % (file.sox_errno, msg, _ffi.string(file.sox_errstr)) super(SoXFileException, self).__init__(errmsg)
def flow(self): self._cbdata = _ffi.new_handle(self) self.add_effect('output', [_ffi.string(self._outf.filename)]) _sox.sox_flow_effects(self._sec, _sox._flow_effects_c_callback, self._cbdata)
def filetype(self): return _ffi.string(self._file.filetype) @property
from array import array from _sox import ffi as _ffi, lib as _sox NULL = _ffi.NULL __soxversion__ = _ffi.string(_sox.sox_version()) effects = ('allpass', 'band', 'bandpass', 'bandreject', 'bass', 'bend', 'biquad', 'chorus', 'channels', 'compand', 'contrast', 'dcshift', 'delay', 'dither', 'downsample', 'echo', 'echos', 'equalizer', 'fade', 'fir', 'firfit', 'flanger', 'gain',