/* Generated by Cython 0.14.1 on Sun Apr 10 10:58:33 2011 */

#define PY_SSIZE_T_CLEAN
#include "Python.h"
#ifndef Py_PYTHON_H
    #error Python headers needed to compile C extensions, please install development version of Python.
#else

#include <stddef.h> /* For offsetof */
#ifndef offsetof
#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif

#if !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#endif

#ifndef DL_IMPORT
  #define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif

#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif

#if PY_VERSION_HEX < 0x02040000
  #define METH_COEXIST 0
  #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type)
  #define PyDict_Contains(d,o)   PySequence_Contains(d,o)
#endif

#if PY_VERSION_HEX < 0x02050000
  typedef int Py_ssize_t;
  #define PY_SSIZE_T_MAX INT_MAX
  #define PY_SSIZE_T_MIN INT_MIN
  #define PY_FORMAT_SIZE_T ""
  #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
  #define PyInt_AsSsize_t(o)   PyInt_AsLong(o)
  #define PyNumber_Index(o)    PyNumber_Int(o)
  #define PyIndex_Check(o)     PyNumber_Check(o)
  #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
#endif

#if PY_VERSION_HEX < 0x02060000
  #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
  #define Py_TYPE(ob)   (((PyObject*)(ob))->ob_type)
  #define Py_SIZE(ob)   (((PyVarObject*)(ob))->ob_size)
  #define PyVarObject_HEAD_INIT(type, size) \
          PyObject_HEAD_INIT(type) size,
  #define PyType_Modified(t)

  typedef struct {
     void *buf;
     PyObject *obj;
     Py_ssize_t len;
     Py_ssize_t itemsize;
     int readonly;
     int ndim;
     char *format;
     Py_ssize_t *shape;
     Py_ssize_t *strides;
     Py_ssize_t *suboffsets;
     void *internal;
  } Py_buffer;

  #define PyBUF_SIMPLE 0
  #define PyBUF_WRITABLE 0x0001
  #define PyBUF_FORMAT 0x0004
  #define PyBUF_ND 0x0008
  #define PyBUF_STRIDES (0x0010 | PyBUF_ND)
  #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
  #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
  #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
  #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)

#endif

#if PY_MAJOR_VERSION < 3
  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
#endif

#if PY_MAJOR_VERSION >= 3
  #define Py_TPFLAGS_CHECKTYPES 0
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif

#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif

#if PY_MAJOR_VERSION >= 3
  #define PyBaseString_Type            PyUnicode_Type
  #define PyStringObject               PyUnicodeObject
  #define PyString_Type                PyUnicode_Type
  #define PyString_Check               PyUnicode_Check
  #define PyString_CheckExact          PyUnicode_CheckExact
#endif

#if PY_VERSION_HEX < 0x02060000
  #define PyBytesObject                PyStringObject
  #define PyBytes_Type                 PyString_Type
  #define PyBytes_Check                PyString_Check
  #define PyBytes_CheckExact           PyString_CheckExact
  #define PyBytes_FromString           PyString_FromString
  #define PyBytes_FromStringAndSize    PyString_FromStringAndSize
  #define PyBytes_FromFormat           PyString_FromFormat
  #define PyBytes_DecodeEscape         PyString_DecodeEscape
  #define PyBytes_AsString             PyString_AsString
  #define PyBytes_AsStringAndSize      PyString_AsStringAndSize
  #define PyBytes_Size                 PyString_Size
  #define PyBytes_AS_STRING            PyString_AS_STRING
  #define PyBytes_GET_SIZE             PyString_GET_SIZE
  #define PyBytes_Repr                 PyString_Repr
  #define PyBytes_Concat               PyString_Concat
  #define PyBytes_ConcatAndDel         PyString_ConcatAndDel
#endif

#if PY_VERSION_HEX < 0x02060000
  #define PySet_Check(obj)             PyObject_TypeCheck(obj, &PySet_Type)
  #define PyFrozenSet_Check(obj)       PyObject_TypeCheck(obj, &PyFrozenSet_Type)
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
#endif

#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)

#if PY_MAJOR_VERSION >= 3
  #define PyIntObject                  PyLongObject
  #define PyInt_Type                   PyLong_Type
  #define PyInt_Check(op)              PyLong_Check(op)
  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
  #define PyInt_FromString             PyLong_FromString
  #define PyInt_FromUnicode            PyLong_FromUnicode
  #define PyInt_FromLong               PyLong_FromLong
  #define PyInt_FromSize_t             PyLong_FromSize_t
  #define PyInt_FromSsize_t            PyLong_FromSsize_t
  #define PyInt_AsLong                 PyLong_AsLong
  #define PyInt_AS_LONG                PyLong_AS_LONG
  #define PyInt_AsSsize_t              PyLong_AsSsize_t
  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
#endif

#if PY_MAJOR_VERSION >= 3
  #define PyBoolObject                 PyLongObject
#endif


#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
#else
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
#endif

#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300)
  #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b)
  #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value)
  #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b)
#else
  #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \
        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \
        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \
            (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0)))
  #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \
        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \
            (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1)))
  #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \
        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \
            (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1)))
#endif

#if PY_MAJOR_VERSION >= 3
  #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
#endif

#if PY_VERSION_HEX < 0x02050000
  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),((char *)(n)))
  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),((char *)(n)))
#else
  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),(n))
  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),(n))
#endif

#if PY_VERSION_HEX < 0x02050000
  #define __Pyx_NAMESTR(n) ((char *)(n))
  #define __Pyx_DOCSTR(n)  ((char *)(n))
#else
  #define __Pyx_NAMESTR(n) (n)
  #define __Pyx_DOCSTR(n)  (n)
#endif

#ifdef __cplusplus
#define __PYX_EXTERN_C extern "C"
#else
#define __PYX_EXTERN_C extern
#endif

#if defined(WIN32) || defined(MS_WINDOWS)
#define _USE_MATH_DEFINES
#endif
#include <math.h>
#define __PYX_HAVE_API__pysox__sox
#include "stdint.h"
#include "stdio.h"
#include "stdlib.h"
#include "strings.h"
#include "sox.h"

#ifdef PYREX_WITHOUT_ASSERTIONS
#define CYTHON_WITHOUT_ASSERTIONS
#endif


/* inline attribute */
#ifndef CYTHON_INLINE
  #if defined(__GNUC__)
    #define CYTHON_INLINE __inline__
  #elif defined(_MSC_VER)
    #define CYTHON_INLINE __inline
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_INLINE inline
  #else
    #define CYTHON_INLINE
  #endif
#endif

/* unused attribute */
#ifndef CYTHON_UNUSED
# if defined(__GNUC__)
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#     define CYTHON_UNUSED __attribute__ ((__unused__))
#   else
#     define CYTHON_UNUSED
#   endif
# elif defined(__ICC) || defined(__INTEL_COMPILER)
#   define CYTHON_UNUSED __attribute__ ((__unused__))
# else
#   define CYTHON_UNUSED
# endif
#endif

typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/


/* Type Conversion Predeclarations */

#define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s)
#define __Pyx_PyBytes_AsUString(s)   ((unsigned char*) PyBytes_AsString(s))

#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);

static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);

#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))


#ifdef __GNUC__
/* Test for GCC > 2.95 */
#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))
#define likely(x)   __builtin_expect(!!(x), 1)
#define unlikely(x) __builtin_expect(!!(x), 0)
#else /* __GNUC__ > 2 ... */
#define likely(x)   (x)
#define unlikely(x) (x)
#endif /* __GNUC__ > 2 ... */
#else /* __GNUC__ */
#define likely(x)   (x)
#define unlikely(x) (x)
#endif /* __GNUC__ */
    
static PyObject *__pyx_m;
static PyObject *__pyx_b;
static PyObject *__pyx_empty_tuple;
static PyObject *__pyx_empty_bytes;
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm= __FILE__;
static const char *__pyx_filename;


static const char *__pyx_f[] = {
  "sox.pyx",
  "bool.pxd",
  "complex.pxd",
};

typedef double __pyx_t_5pysox_4csox_sox_rate_t;

typedef int32_t __pyx_t_5pysox_4csox_sox_sample_t;

/* Type declarations */

/* "pysox/sox.pxd":15
 * cimport pysox.csox as csox
 * 
 * ctypedef struct pysoxtransportheader_t:             # <<<<<<<<<<<<<<
 *     char magic[4]
 *     csox.sox_signalinfo_t signalinfo
 */

typedef struct {
  char magic[4];
  sox_signalinfo_t signalinfo;
} __pyx_t_5pysox_3sox_pysoxtransportheader_t;

/* "pysox/sox.pxd":52
 *     cdef int sox_read(self, csox.sox_sample_t * obuf, size_t rlen)
 *     cdef int sox_read_wide(self, csox.sox_sample_t * obuf, size_t max)
 *     cpdef int open_read(self, path, CSignalInfo signalInfo=?, CEncodingInfo encodingInfo=?, fileType=?) except ?0             # <<<<<<<<<<<<<<
 *     cpdef open_write(self, path, CSignalInfo signalInfo, CEncodingInfo encodingInfo=?, fileType=?)
 *     cdef csox.sox_signalinfo_t * cget_signal(self)
 */

struct __pyx_opt_args_5pysox_3sox_10CSoxStream_open_read {
  int __pyx_n;
  struct __pyx_obj_5pysox_3sox_CSignalInfo *signalInfo;
  struct __pyx_obj_5pysox_3sox_CEncodingInfo *encodingInfo;
  PyObject *fileType;
};

/* "pysox/sox.pxd":53
 *     cdef int sox_read_wide(self, csox.sox_sample_t * obuf, size_t max)
 *     cpdef int open_read(self, path, CSignalInfo signalInfo=?, CEncodingInfo encodingInfo=?, fileType=?) except ?0
 *     cpdef open_write(self, path, CSignalInfo signalInfo, CEncodingInfo encodingInfo=?, fileType=?)             # <<<<<<<<<<<<<<
 *     cdef csox.sox_signalinfo_t * cget_signal(self)
 *     cdef csox.sox_encodinginfo_t * cget_encoding(self)
 */

struct __pyx_opt_args_5pysox_3sox_10CSoxStream_open_write {
  int __pyx_n;
  struct __pyx_obj_5pysox_3sox_CEncodingInfo *encodingInfo;
  PyObject *fileType;
};

/* "pysox/sox.pyx":503
 *         return 0
 * 
 *     cpdef int open_read(self, path, CSignalInfo signalInfo=None, CEncodingInfo encodingInfo=None, fileType=None) except ?0:             # <<<<<<<<<<<<<<
 *         print(self,'open_read')
 *         return 0
 */

struct __pyx_opt_args_5pysox_3sox_16CPysoxPipeStream_open_read {
  int __pyx_n;
  struct __pyx_obj_5pysox_3sox_CSignalInfo *signalInfo;
  struct __pyx_obj_5pysox_3sox_CEncodingInfo *encodingInfo;
  PyObject *fileType;
};

/* "pysox/sox.pyx":507
 *         return 0
 * 
 *     cpdef open_write(self, path, CSignalInfo signalInfo, CEncodingInfo encodingInfo=None, fileType=None):             # <<<<<<<<<<<<<<
 *         return 0
 * 
 */

struct __pyx_opt_args_5pysox_3sox_16CPysoxPipeStream_open_write {
  int __pyx_n;
  struct __pyx_obj_5pysox_3sox_CEncodingInfo *encodingInfo;
  PyObject *fileType;
};

/* "pysox/sox.pyx":922
 *         return 0
 * 
 *     cpdef int flow_effects(self, optimize_trim=True) except -1:             # <<<<<<<<<<<<<<
 *         """Flow samples through the effects processing chain until EOF is reached.
 * 
 */

struct __pyx_opt_args_5pysox_3sox_13CEffectsChain_flow_effects {
  int __pyx_n;
  PyObject *optimize_trim;
};

/* "pysox/sox.pxd":33
 *     cdef create(self, name, arguments)
 * 
 * cdef class CSignalInfo:             # <<<<<<<<<<<<<<
 *     cdef csox.sox_signalinfo_t * signal
 *     cdef csox.sox_signalinfo_t s_signal
 */

struct __pyx_obj_5pysox_3sox_CSignalInfo {
  PyObject_HEAD
  struct __pyx_vtabstruct_5pysox_3sox_CSignalInfo *__pyx_vtab;
  sox_signalinfo_t *signal;
  sox_signalinfo_t s_signal;
};

/* "pysox/sox.pxd":45
 *     cdef csox.sox_encodinginfo_t * cget_encoding(self)
 * 
 * cdef class CSoxStream:             # <<<<<<<<<<<<<<
 *     cdef csox.sox_format_t * ft
 * 
 */

struct __pyx_obj_5pysox_3sox_CSoxStream {
  PyObject_HEAD
  struct __pyx_vtabstruct_5pysox_3sox_CSoxStream *__pyx_vtab;
  sox_format_t *ft;
};

/* "pysox/sox.pyx":540
 * #
 * ################################################################################################
 * cdef class CNullFile(CSoxStream):             # <<<<<<<<<<<<<<
 *     """nullstream = CNullFile()
 * 
 */

struct __pyx_obj_5pysox_3sox_CNullFile {
  struct __pyx_obj_5pysox_3sox_CSoxStream __pyx_base;
};

/* "pysox/sox.pyx":1113
 *     # Buffer interface
 *     #
 *     def __getbuffer__(SoxSampleBuffer self, Py_buffer* buffer, int flags):             # <<<<<<<<<<<<<<
 * #        print("getbuffer")
 *         cdef int value
 */

struct __pyx_obj_5pysox_3sox___pyx_scope_struct____getbuffer__ {
  PyObject_HEAD
  PyObject *__pyx_v_received_flags;
};

/* "pysox/sox.pxd":24
 * cdef char * toCharP(uobj)
 * 
 * cdef class CEffect:             # <<<<<<<<<<<<<<
 *     cdef int argc
 *     cdef char ** argv
 */

struct __pyx_obj_5pysox_3sox_CEffect {
  PyObject_HEAD
  struct __pyx_vtabstruct_5pysox_3sox_CEffect *__pyx_vtab;
  int argc;
  char **argv;
  sox_effect_t *effect;
  PyObject *name;
};

/* "pysox/sox.pyx":720
 * #
 * ################################################################################################
 * cdef class CEffectsChain:             # <<<<<<<<<<<<<<
 *     """The effectschain is the primary instrument of processing audio data.
 *     CEffectsChain is basically a wrapper around sox_effects_chain_t and provides
 */

struct __pyx_obj_5pysox_3sox_CEffectsChain {
  PyObject_HEAD
  struct __pyx_vtabstruct_5pysox_3sox_CEffectsChain *__pyx_vtab;
  sox_effects_chain_t *chain;
  struct __pyx_obj_5pysox_3sox_CSoxStream *instream;
  struct __pyx_obj_5pysox_3sox_CSoxStream *outstream;
  struct __pyx_obj_5pysox_3sox_CEncodingInfo *inencoding;
  struct __pyx_obj_5pysox_3sox_CEncodingInfo *outencoding;
  struct __pyx_obj_5pysox_3sox_CSignalInfo *insignal;
  struct __pyx_obj_5pysox_3sox_CSignalInfo *outsignal;
  PyObject *haveInputEffect;
  PyObject *haveOutputEffect;
  PyObject *effects;
};

/* "pysox/sox.pxd":57
 *     cdef csox.sox_encodinginfo_t * cget_encoding(self)
 * 
 * cdef class CPysoxPipeStream(CSoxStream):             # <<<<<<<<<<<<<<
 *     cdef object channel
 *     cdef object initialdata
 */

struct __pyx_obj_5pysox_3sox_CPysoxPipeStream {
  struct __pyx_obj_5pysox_3sox_CSoxStream __pyx_base;
  PyObject *channel;
  PyObject *initialdata;
};

/* "pysox/sox.pxd":39
 *     cdef csox.sox_signalinfo_t * cget_signal(self)
 * 
 * cdef class CEncodingInfo:             # <<<<<<<<<<<<<<
 *     cdef csox.sox_encodinginfo_t * encoding
 *     cdef csox.sox_encodinginfo_t  s_encoding
 */

struct __pyx_obj_5pysox_3sox_CEncodingInfo {
  PyObject_HEAD
  struct __pyx_vtabstruct_5pysox_3sox_CEncodingInfo *__pyx_vtab;
  sox_encodinginfo_t *encoding;
  sox_encodinginfo_t s_encoding;
};

/* "pysox/sox.pxd":62
 *     cdef int receive_header(self)
 * 
 * cdef class SoxSampleBuffer:             # <<<<<<<<<<<<<<
 *     cdef object format, offset
 *     cdef csox.sox_sample_t * buffer
 */

struct __pyx_obj_5pysox_3sox_SoxSampleBuffer {
  PyObject_HEAD
  struct __pyx_vtabstruct_5pysox_3sox_SoxSampleBuffer *__pyx_vtab;
  PyObject *format;
  PyObject *offset;
  __pyx_t_5pysox_4csox_sox_sample_t *buffer;
  int len;
  int datalen;
  int itemsize;
  int ndim;
  Py_ssize_t *strides;
  Py_ssize_t *shape;
  Py_ssize_t *suboffsets;
  PyObject *recieved_flags;
  PyObject *release_ok;
  int must_dealloc_buffer;
  int read_only;
  int viewcount;
};

/* "pysox/sox.pyx":1301
 *         #return [x for x in self]
 * 
 * cdef class SoxBufferIterator:             # <<<<<<<<<<<<<<
 *     cdef SoxSampleBuffer b
 *     cdef int i
 */

struct __pyx_obj_5pysox_3sox_SoxBufferIterator {
  PyObject_HEAD
  struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *b;
  int i;
  int len;
};

/* "pysox/sox.pyx":1322
 * #
 * ################################################################################################
 * cdef class __CSox:             # <<<<<<<<<<<<<<
 *     def __cinit__(self):
 *         cdef int result
 */

struct __pyx_obj_5pysox_3sox___CSox {
  PyObject_HEAD
};


/* "pysox/sox.pyx":992
 *     ('WRITABLE', cpython.buffer.PyBUF_WRITABLE)
 * )
 * cdef class SoxSampleBuffer:             # <<<<<<<<<<<<<<
 *     """Python representation of a sox buffer memory area
 * 
 */

struct __pyx_vtabstruct_5pysox_3sox_SoxSampleBuffer {
  void (*set_buffer)(struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *, __pyx_t_5pysox_4csox_sox_sample_t *, size_t);
  int (*__create_buffer)(struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *, PyObject *);
  void (*__do_dealloc_if)(struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *);
  int (*write)(struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *, __pyx_t_5pysox_4csox_sox_sample_t *, PyObject *);
  PyObject *(*get_default_format)(struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *);
  Py_ssize_t *(*list_to_sizebuf)(struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *, PyObject *);
};
static struct __pyx_vtabstruct_5pysox_3sox_SoxSampleBuffer *__pyx_vtabptr_5pysox_3sox_SoxSampleBuffer;


/* "pysox/sox.pyx":198
 * #
 * ################################################################################################
 * cdef class CSignalInfo:             # <<<<<<<<<<<<<<
 *     """Representation of struct sox_signalinfo_t"""
 * #    cdef csox.sox_signalinfo_t * signal
 */

struct __pyx_vtabstruct_5pysox_3sox_CSignalInfo {
  PyObject *(*cset_signal)(struct __pyx_obj_5pysox_3sox_CSignalInfo *, sox_signalinfo_t *);
  sox_signalinfo_t *(*cget_signal)(struct __pyx_obj_5pysox_3sox_CSignalInfo *);
};
static struct __pyx_vtabstruct_5pysox_3sox_CSignalInfo *__pyx_vtabptr_5pysox_3sox_CSignalInfo;


/* "pysox/sox.pyx":575
 * #
 * ################################################################################################
 * cdef class CEffect:             # <<<<<<<<<<<<<<
 *     """CEffect("trim", [ b'2', b'4'])
 * 
 */

struct __pyx_vtabstruct_5pysox_3sox_CEffect {
  PyObject *(*get_name)(struct __pyx_obj_5pysox_3sox_CEffect *, int __pyx_skip_dispatch);
  sox_effect_t *(*get_effect)(struct __pyx_obj_5pysox_3sox_CEffect *);
  PyObject *(*create)(struct __pyx_obj_5pysox_3sox_CEffect *, PyObject *, PyObject *);
};
static struct __pyx_vtabstruct_5pysox_3sox_CEffect *__pyx_vtabptr_5pysox_3sox_CEffect;


/* "pysox/sox.pyx":272
 * #
 * ################################################################################################
 * cdef class CSoxStream:             # <<<<<<<<<<<<<<
 *     """
 *     Representation of struct sox_format_t
 */

struct __pyx_vtabstruct_5pysox_3sox_CSoxStream {
  sox_format_t *(*get_ft)(struct __pyx_obj_5pysox_3sox_CSoxStream *);
  char *(*asCharP)(struct __pyx_obj_5pysox_3sox_CSoxStream *);
  int (*sox_read)(struct __pyx_obj_5pysox_3sox_CSoxStream *, __pyx_t_5pysox_4csox_sox_sample_t *, size_t);
  int (*sox_read_wide)(struct __pyx_obj_5pysox_3sox_CSoxStream *, __pyx_t_5pysox_4csox_sox_sample_t *, size_t);
  int (*open_read)(struct __pyx_obj_5pysox_3sox_CSoxStream *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_5pysox_3sox_10CSoxStream_open_read *__pyx_optional_args);
  PyObject *(*open_write)(struct __pyx_obj_5pysox_3sox_CSoxStream *, PyObject *, struct __pyx_obj_5pysox_3sox_CSignalInfo *, int __pyx_skip_dispatch, struct __pyx_opt_args_5pysox_3sox_10CSoxStream_open_write *__pyx_optional_args);
  sox_signalinfo_t *(*cget_signal)(struct __pyx_obj_5pysox_3sox_CSoxStream *);
  sox_encodinginfo_t *(*cget_encoding)(struct __pyx_obj_5pysox_3sox_CSoxStream *);
};
static struct __pyx_vtabstruct_5pysox_3sox_CSoxStream *__pyx_vtabptr_5pysox_3sox_CSoxStream;


/* "pysox/sox.pyx":451
 * #
 * ################################################################################################
 * cdef class CPysoxPipeStream(CSoxStream):             # <<<<<<<<<<<<<<
 *     """Input stream analog to CSoxStream, but reading from a python:processes Pipe
 * 
 */

struct __pyx_vtabstruct_5pysox_3sox_CPysoxPipeStream {
  struct __pyx_vtabstruct_5pysox_3sox_CSoxStream __pyx_base;
  int (*receive_header)(struct __pyx_obj_5pysox_3sox_CPysoxPipeStream *);
};
static struct __pyx_vtabstruct_5pysox_3sox_CPysoxPipeStream *__pyx_vtabptr_5pysox_3sox_CPysoxPipeStream;


/* "pysox/sox.pyx":72
 * #
 * ################################################################################################
 * cdef class CEncodingInfo:             # <<<<<<<<<<<<<<
 *     """Representation of struct sox_encodinginfo_t"""
 * #    cdef csox.sox_encodinginfo_t * encoding
 */

struct __pyx_vtabstruct_5pysox_3sox_CEncodingInfo {
  PyObject *(*cset_encoding)(struct __pyx_obj_5pysox_3sox_CEncodingInfo *, sox_encodinginfo_t *);
  sox_encodinginfo_t *(*cget_encoding)(struct __pyx_obj_5pysox_3sox_CEncodingInfo *);
};
static struct __pyx_vtabstruct_5pysox_3sox_CEncodingInfo *__pyx_vtabptr_5pysox_3sox_CEncodingInfo;


/* "pysox/sox.pyx":540
 * #
 * ################################################################################################
 * cdef class CNullFile(CSoxStream):             # <<<<<<<<<<<<<<
 *     """nullstream = CNullFile()
 * 
 */

struct __pyx_vtabstruct_5pysox_3sox_CNullFile {
  struct __pyx_vtabstruct_5pysox_3sox_CSoxStream __pyx_base;
};
static struct __pyx_vtabstruct_5pysox_3sox_CNullFile *__pyx_vtabptr_5pysox_3sox_CNullFile;


/* "pysox/sox.pyx":720
 * #
 * ################################################################################################
 * cdef class CEffectsChain:             # <<<<<<<<<<<<<<
 *     """The effectschain is the primary instrument of processing audio data.
 *     CEffectsChain is basically a wrapper around sox_effects_chain_t and provides
 */

struct __pyx_vtabstruct_5pysox_3sox_CEffectsChain {
  PyObject *(*__do_dealloc)(struct __pyx_obj_5pysox_3sox_CEffectsChain *);
  PyObject *(*set_chain)(struct __pyx_obj_5pysox_3sox_CEffectsChain *, sox_effects_chain_t *);
  sox_effects_chain_t *(*get_chain)(struct __pyx_obj_5pysox_3sox_CEffectsChain *);
  PyObject *(*__create_effects_chain)(struct __pyx_obj_5pysox_3sox_CEffectsChain *, struct __pyx_obj_5pysox_3sox_CEncodingInfo *, struct __pyx_obj_5pysox_3sox_CEncodingInfo *);
  PyObject *(*__setInput)(struct __pyx_obj_5pysox_3sox_CEffectsChain *, struct __pyx_obj_5pysox_3sox_CSoxStream *);
  PyObject *(*__setOutput)(struct __pyx_obj_5pysox_3sox_CEffectsChain *, struct __pyx_obj_5pysox_3sox_CSoxStream *);
  PyObject *(*__calculate_signals)(struct __pyx_obj_5pysox_3sox_CEffectsChain *);
  void (*fixup_out_signal_length)(struct __pyx_obj_5pysox_3sox_CEffectsChain *);
  int (*__init_effects)(struct __pyx_obj_5pysox_3sox_CEffectsChain *);
  int (*__init_effect)(struct __pyx_obj_5pysox_3sox_CEffectsChain *, struct __pyx_obj_5pysox_3sox_CEffect *);
  int (*flow_effects)(struct __pyx_obj_5pysox_3sox_CEffectsChain *, int __pyx_skip_dispatch, struct __pyx_opt_args_5pysox_3sox_13CEffectsChain_flow_effects *__pyx_optional_args);
  int (*__optimize_trim)(struct __pyx_obj_5pysox_3sox_CEffectsChain *);
};
static struct __pyx_vtabstruct_5pysox_3sox_CEffectsChain *__pyx_vtabptr_5pysox_3sox_CEffectsChain;

#ifndef CYTHON_REFNANNY
  #define CYTHON_REFNANNY 0
#endif

#if CYTHON_REFNANNY
  typedef struct {
    void (*INCREF)(void*, PyObject*, int);
    void (*DECREF)(void*, PyObject*, int);
    void (*GOTREF)(void*, PyObject*, int);
    void (*GIVEREF)(void*, PyObject*, int);
    void* (*SetupContext)(const char*, int, const char*);
    void (*FinishContext)(void**);
  } __Pyx_RefNannyAPIStruct;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
  static __Pyx_RefNannyAPIStruct * __Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule((char *)modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
  end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
  }
  #define __Pyx_RefNannySetupContext(name)           void *__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
  #define __Pyx_RefNannyFinishContext()           __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
  #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r);} } while(0)
#else
  #define __Pyx_RefNannySetupContext(name)
  #define __Pyx_RefNannyFinishContext()
  #define __Pyx_INCREF(r) Py_INCREF(r)
  #define __Pyx_DECREF(r) Py_DECREF(r)
  #define __Pyx_GOTREF(r)
  #define __Pyx_GIVEREF(r)
  #define __Pyx_XDECREF(r) Py_XDECREF(r)
#endif /* CYTHON_REFNANNY */
#define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);} } while(0)
#define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r);} } while(0)

static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/

#include <string.h>

static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/

static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict,
    const char* function_name, int kw_allowed); /*proto*/


static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (!j) return NULL;
    r = PyObject_GetItem(o, j);
    Py_DECREF(j);
    return r;
}


#define __Pyx_GetItemInt_List(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
                                                    __Pyx_GetItemInt_List_Fast(o, i) : \
                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))

static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i) {
    if (likely(o != Py_None)) {
        if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
            PyObject *r = PyList_GET_ITEM(o, i);
            Py_INCREF(r);
            return r;
        }
        else if ((-PyList_GET_SIZE(o) <= i) & (i < 0)) {
            PyObject *r = PyList_GET_ITEM(o, PyList_GET_SIZE(o) + i);
            Py_INCREF(r);
            return r;
        }
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
                                                    __Pyx_GetItemInt_Tuple_Fast(o, i) : \
                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))

static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i) {
    if (likely(o != Py_None)) {
        if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, i);
            Py_INCREF(r);
            return r;
        }
        else if ((-PyTuple_GET_SIZE(o) <= i) & (i < 0)) {
            PyObject *r = PyTuple_GET_ITEM(o, PyTuple_GET_SIZE(o) + i);
            Py_INCREF(r);
            return r;
        }
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}


#define __Pyx_GetItemInt(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
                                                    __Pyx_GetItemInt_Fast(o, i) : \
                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))

static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i) {
    PyObject *r;
    if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) {
        r = PyList_GET_ITEM(o, i);
        Py_INCREF(r);
    }
    else if (PyTuple_CheckExact(o) && ((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
        r = PyTuple_GET_ITEM(o, i);
        Py_INCREF(r);
    }
    else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_item && (likely(i >= 0))) {
        r = PySequence_GetItem(o, i);
    }
    else {
        r = __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
    }
    return r;
}

static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/

static CYTHON_INLINE long __Pyx_NegateNonNeg(long b) { return unlikely(b < 0) ? b : !b; }
static CYTHON_INLINE PyObject* __Pyx_PyBoolOrNull_FromLong(long b) {
    return unlikely(b < 0) ? NULL : __Pyx_PyBool_FromLong(b);
}

static CYTHON_INLINE void __Pyx_RaiseNoneIndexingError(void);

#if PY_MAJOR_VERSION >= 3
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
    PyObject *value;
    if (unlikely(d == Py_None)) {
        __Pyx_RaiseNoneIndexingError();
        return NULL;
    }
    value = PyDict_GetItemWithError(d, key);
    if (unlikely(!value)) {
        if (!PyErr_Occurred())
            PyErr_SetObject(PyExc_KeyError, key);
        return NULL;
    }
    Py_INCREF(value);
    return value;
}
#else
    #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
#endif

static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name, PyObject* kw_name); /*proto*/

static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],     PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,     const char* function_name); /*proto*/

static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
    const char *name, int exact); /*proto*/

static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/

static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/

static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/

static CYTHON_INLINE PyObject* __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
    if (likely(PyList_CheckExact(L))) {
        if (PyList_Append(L, x) < 0) return NULL;
        Py_INCREF(Py_None);
        return Py_None; /* this is just to have an accurate signature */
    }
    else {
        PyObject *r, *m;
        m = __Pyx_GetAttrString(L, "append");
        if (!m) return NULL;
        r = PyObject_CallFunctionObjArgs(m, x, NULL);
        Py_DECREF(m);
        return r;
    }
}

static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);

static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);

static PyObject *__Pyx_UnpackItem(PyObject *, Py_ssize_t index); /*proto*/
static int __Pyx_EndUnpack(PyObject *, Py_ssize_t expected); /*proto*/

static CYTHON_INLINE int __Pyx_div_int(int, int); /* proto */

#define UNARY_NEG_WOULD_OVERFLOW(x)		(((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))

static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t); /* proto */

static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/

static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/

static PyObject *__Pyx_FindPy2Metaclass(PyObject *bases); /*proto*/

static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name,
                                   PyObject *modname); /*proto*/

static int __Pyx_Print(PyObject*, PyObject *, int); /*proto*/
#if PY_MAJOR_VERSION >= 3
static PyObject* __pyx_print = 0;
static PyObject* __pyx_print_kwargs = 0;
#endif

static int __Pyx_PrintOne(PyObject* stream, PyObject *o); /*proto*/

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_uint64_t(uint64_t);

static CYTHON_INLINE int32_t __Pyx_PyInt_from_py_int32_t(PyObject *);

#define __pyx_binding_PyCFunctionType_USED 1

typedef struct {
    PyCFunctionObject func;
} __pyx_binding_PyCFunctionType_object;

static PyTypeObject __pyx_binding_PyCFunctionType_type;
static PyTypeObject *__pyx_binding_PyCFunctionType = NULL;

static PyObject *__pyx_binding_PyCFunctionType_NewEx(PyMethodDef *ml, PyObject *self, PyObject *module); /* proto */
#define __pyx_binding_PyCFunctionType_New(ml, self) __pyx_binding_PyCFunctionType_NewEx(ml, self, NULL)

static int __pyx_binding_PyCFunctionType_init(void); /* proto */

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_int32_t(int32_t);

static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);

static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);

static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);

static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);

static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);

static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);

static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);

static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);

static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);

static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *);

static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);

static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);

static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);

static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);

static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);

static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);

static void __Pyx_WriteUnraisable(const char *name); /*proto*/

static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); /*proto*/

static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/

static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, long size, int strict);  /*proto*/

static PyObject *__Pyx_ImportModule(const char *name); /*proto*/

static void __Pyx_AddTraceback(const char *funcname); /*proto*/

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
/* Module declarations from libc.stdint */

/* Module declarations from pysox.csox */

/* Module declarations from libc */

/* Module declarations from libc.stdlib */

/* Module declarations from cpython.buffer */

/* Module declarations from cpython.version */

/* Module declarations from cpython.ref */

/* Module declarations from cpython.exc */

/* Module declarations from cpython.module */

/* Module declarations from cpython.mem */

/* Module declarations from cpython.tuple */

/* Module declarations from cpython.list */

/* Module declarations from libc.stdio */

/* Module declarations from cpython.object */

/* Module declarations from cpython.sequence */

/* Module declarations from cpython.mapping */

/* Module declarations from cpython.iterator */

/* Module declarations from cpython.type */

/* Module declarations from cpython.number */

/* Module declarations from cpython.int */

/* Module declarations from __builtin__ */

/* Module declarations from cpython.bool */

static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0;
/* Module declarations from cpython.long */

/* Module declarations from cpython.float */

/* Module declarations from __builtin__ */

/* Module declarations from cpython.complex */

static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0;
/* Module declarations from cpython.string */

/* Module declarations from cpython.unicode */

/* Module declarations from cpython.dict */

/* Module declarations from cpython.instance */

/* Module declarations from cpython.function */

/* Module declarations from cpython.method */

/* Module declarations from cpython.weakref */

/* Module declarations from cpython.getargs */

/* Module declarations from cpython.pythread */

/* Module declarations from cpython.cobject */

/* Module declarations from cpython.oldbuffer */

/* Module declarations from cpython.set */

/* Module declarations from cpython.bytes */

/* Module declarations from cpython.pycapsule */

/* Module declarations from cpython */

/* Module declarations from pysox.sox */

static PyTypeObject *__pyx_ptype_5pysox_3sox_CEffect = 0;
static PyTypeObject *__pyx_ptype_5pysox_3sox_CSignalInfo = 0;
static PyTypeObject *__pyx_ptype_5pysox_3sox_CEncodingInfo = 0;
static PyTypeObject *__pyx_ptype_5pysox_3sox_CSoxStream = 0;
static PyTypeObject *__pyx_ptype_5pysox_3sox_CPysoxPipeStream = 0;
static PyTypeObject *__pyx_ptype_5pysox_3sox_SoxSampleBuffer = 0;
static PyTypeObject *__pyx_ptype_5pysox_3sox_CNullFile = 0;
static PyTypeObject *__pyx_ptype_5pysox_3sox_CEffectsChain = 0;
static PyTypeObject *__pyx_ptype_5pysox_3sox_SoxBufferIterator = 0;
static PyTypeObject *__pyx_ptype_5pysox_3sox___CSox = 0;
static PyTypeObject *__pyx_ptype_5pysox_3sox___pyx_scope_struct____getbuffer__ = 0;
static char *__pyx_f_5pysox_3sox_toCharP(PyObject *); /*proto*/
static PyObject *__pyx_f_5pysox_3sox_char2u(char *); /*proto*/
#define __Pyx_MODULE_NAME "pysox.sox"
static int __pyx_module_is_main_pysox__sox = 0;

/* Implementation of pysox.sox */
static PyObject *__pyx_builtin_Exception;
static PyObject *__pyx_builtin_IOError;
static PyObject *__pyx_builtin_TypeError;
static PyObject *__pyx_builtin_RuntimeError;
static PyObject *__pyx_builtin_EOFError;
static PyObject *__pyx_builtin_bytearray;
static PyObject *__pyx_builtin_enumerate;
static PyObject *__pyx_builtin_IndexError;
static PyObject *__pyx_builtin_BufferError;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_StopIteration;
static PyObject *__pyx_builtin_ImportError;
static char __pyx_k_1[] = "utf-8";
static char __pyx_k_3[] = "CencodingInfo(%s,%s,\"%s\",\"%s\",%s)";
static char __pyx_k_4[] = "CSignalInfo(%s,%s,%s,%s)";
static char __pyx_k_5[] = "";
static char __pyx_k_6[] = "CSoxStream()";
static char __pyx_k_7[] = "CSoxStream(%s, %s)";
static char __pyx_k_8[] = "No such file";
static char __pyx_k_10[] = "signalInfo must be a CSignalInfo instance";
static char __pyx_k_13[] = "CPysoxPipeStream()";
static char __pyx_k_14[] = "CPysoxPipeStream(%s)";
static char __pyx_k_15[] = "CPysoxPipeStream::sox_read not implemented";
static char __pyx_k_17[] = "CPySoxPipeStream EOF";
static char __pyx_k_18[] = "IEffr data is None, channel is finished";
static char __pyx_k_19[] = "CPysoxPipeStream::start_read";
static char __pyx_k_20[] = "got header";
static char __pyx_k_21[] = "Got excessive data while reading header";
static char __pyx_k_24[] = "CEffect(%s)";
static char __pyx_k_25[] = "Ceffects_chain()";
static char __pyx_k_26[] = "neither instream nor an inputeffect are configured";
static char __pyx_k_28[] = "neither outstream nor an outputeffect are configured";
static char __pyx_k_30[] = "__create_effects_chain";
static char __pyx_k_31[] = "neither instream nor insignal are configured";
static char __pyx_k_33[] = "neither outstream nor outsignal are configured";
static char __pyx_k_36[] = "chain not valid";
static char __pyx_k_38[] = "fixup_out_signal_length";
static char __pyx_k_39[] = "need bytes, bytearray, memoryview or list of integers";
static char __pyx_k_41[] = "@i";
static char __pyx_k_42[] = "pysox.sox";
static char __pyx_k_43[] = "got more than i can chew";
static char __pyx_k_46[] = "Slices are not supported";
static char __pyx_k_48[] = "Cannot reallocate while being referenced";
static char __pyx_k_50[] = "only accepting list type";
static char __pyx_k_52[] = "Too much data, check get_buffer_size()";
static char __pyx_k_56[] = "sox_init not successful";
static char __pyx_k_58[] = "Exception which is raised by the pysox system when some configuration is not acceptable\n    ";
static char __pyx_k__b[] = "b";
static char __pyx_k__i[] = "i";
static char __pyx_k__r[] = "r";
static char __pyx_k__u[] = "u";
static char __pyx_k__w[] = "w";
static char __pyx_k__ND[] = "ND";
static char __pyx_k__ft[] = "ft";
static char __pyx_k__GSM[] = "GSM";
static char __pyx_k__MP3[] = "MP3";
static char __pyx_k__PY3[] = "PY3";
static char __pyx_k__buf[] = "buf";
static char __pyx_k__len[] = "len";
static char __pyx_k__obj[] = "obj";
static char __pyx_k__sys[] = "sys";
static char __pyx_k__ALAW[] = "ALAW";
static char __pyx_k__CVSD[] = "CVSD";
static char __pyx_k__DPCM[] = "DPCM";
static char __pyx_k__DWVW[] = "DWVW";
static char __pyx_k__FLAC[] = "FLAC";
static char __pyx_k__G721[] = "G721";
static char __pyx_k__G723[] = "G723";
static char __pyx_k__HCOM[] = "HCOM";
static char __pyx_k__ULAW[] = "ULAW";
static char __pyx_k__argc[] = "argc";
static char __pyx_k__argv[] = "argv";
static char __pyx_k__data[] = "data";
static char __pyx_k__desc[] = "desc";
static char __pyx_k__mode[] = "mode";
static char __pyx_k__name[] = "name";
static char __pyx_k__ndim[] = "ndim";
static char __pyx_k__null[] = "null";
static char __pyx_k__path[] = "path";
static char __pyx_k__rate[] = "rate";
static char __pyx_k__seek[] = "seek";
static char __pyx_k__trim[] = "trim";
static char __pyx_k__DWVWN[] = "DWVWN";
static char __pyx_k__FLOAT[] = "FLOAT";
static char __pyx_k__LPC10[] = "LPC10";
static char __pyx_k__SIGN2[] = "SIGN2";
static char __pyx_k__chain[] = "chain";
static char __pyx_k__close[] = "close";
static char __pyx_k__flags[] = "flags";
static char __pyx_k__flush[] = "flush";
static char __pyx_k__input[] = "input";
static char __pyx_k__range[] = "range";
static char __pyx_k__shape[] = "shape";
static char __pyx_k__types[] = "types";
static char __pyx_k__write[] = "write";
static char __pyx_k__AMR_NB[] = "AMR_NB";
static char __pyx_k__AMR_WB[] = "AMR_WB";
static char __pyx_k__FORMAT[] = "FORMAT";
static char __pyx_k__VORBIS[] = "VORBIS";
static char __pyx_k__buffer[] = "buffer";
static char __pyx_k__create[] = "create";
static char __pyx_k__effect[] = "effect";
static char __pyx_k__encode[] = "encode";
static char __pyx_k__format[] = "format";
static char __pyx_k__get_ft[] = "get_ft";
static char __pyx_k__insert[] = "insert";
static char __pyx_k__length[] = "length";
static char __pyx_k__offset[] = "offset";
static char __pyx_k__output[] = "output";
static char __pyx_k__signal[] = "signal";
static char __pyx_k__stdout[] = "stdout";
static char __pyx_k__IOError[] = "IOError";
static char __pyx_k__STRIDES[] = "STRIDES";
static char __pyx_k__UNKNOWN[] = "UNKNOWN";
static char __pyx_k__WAVPACK[] = "WAVPACK";
static char __pyx_k__XXXXXXX[] = "XXXXXXX";
static char __pyx_k__asCharP[] = "asCharP";
static char __pyx_k__channel[] = "channel";
static char __pyx_k__datalen[] = "datalen";
static char __pyx_k__effects[] = "effects";
static char __pyx_k__handler[] = "handler";
static char __pyx_k__istream[] = "istream";
static char __pyx_k__ostream[] = "ostream";
static char __pyx_k__strides[] = "strides";
static char __pyx_k__CL_ADPCM[] = "CL_ADPCM";
static char __pyx_k__EOFError[] = "EOFError";
static char __pyx_k__INDIRECT[] = "INDIRECT";
static char __pyx_k__MS_ADPCM[] = "MS_ADPCM";
static char __pyx_k__UNSIGNED[] = "UNSIGNED";
static char __pyx_k__WAVPACKF[] = "WAVPACKF";
static char __pyx_k__WRITABLE[] = "WRITABLE";
static char __pyx_k____init__[] = "__init__";
static char __pyx_k____main__[] = "__main__";
static char __pyx_k____test__[] = "__test__";
static char __pyx_k__channels[] = "channels";
static char __pyx_k__encoding[] = "encoding";
static char __pyx_k__fileType[] = "fileType";
static char __pyx_k__filename[] = "filename";
static char __pyx_k__filetype[] = "filetype";
static char __pyx_k__flagname[] = "flagname";
static char __pyx_k__fromlist[] = "fromlist";
static char __pyx_k__get_name[] = "get_name";
static char __pyx_k__insignal[] = "insignal";
static char __pyx_k__instream[] = "instream";
static char __pyx_k__internal[] = "internal";
static char __pyx_k__itemsize[] = "itemsize";
static char __pyx_k__readonly[] = "readonly";
static char __pyx_k__s_signal[] = "s_signal";
static char __pyx_k__seekable[] = "seekable";
static char __pyx_k__sox_read[] = "sox_read";
static char __pyx_k__Exception[] = "Exception";
static char __pyx_k__IMA_ADPCM[] = "IMA_ADPCM";
static char __pyx_k__OKI_ADPCM[] = "OKI_ADPCM";
static char __pyx_k__TypeError[] = "TypeError";
static char __pyx_k__bytearray[] = "bytearray";
static char __pyx_k__enumerate[] = "enumerate";
static char __pyx_k__frombytes[] = "frombytes";
static char __pyx_k__in_signal[] = "in_signal";
static char __pyx_k__open_read[] = "open_read";
static char __pyx_k__outsignal[] = "outsignal";
static char __pyx_k__outstream[] = "outstream";
static char __pyx_k__precision[] = "precision";
static char __pyx_k__print_exc[] = "print_exc";
static char __pyx_k__read_only[] = "read_only";
static char __pyx_k__traceback[] = "traceback";
static char __pyx_k__viewcount[] = "viewcount";
static char __pyx_k__CL_ADPCM16[] = "CL_ADPCM16";
static char __pyx_k__FLOAT_TEXT[] = "FLOAT_TEXT";
static char __pyx_k__IndexError[] = "IndexError";
static char __pyx_k__PysoxError[] = "PysoxError";
static char __pyx_k__ZZZZZZZZZZ[] = "ZZZZZZZZZZ";
static char __pyx_k____setInput[] = "__setInput";
static char __pyx_k__get_effect[] = "get_effect";
static char __pyx_k__get_signal[] = "get_signal";
static char __pyx_k__inencoding[] = "inencoding";
static char __pyx_k__open_write[] = "open_write";
static char __pyx_k__out_signal[] = "out_signal";
static char __pyx_k__recv_bytes[] = "recv_bytes";
static char __pyx_k__release_ok[] = "release_ok";
static char __pyx_k__s_encoding[] = "s_encoding";
static char __pyx_k__set_buffer[] = "set_buffer";
static char __pyx_k__signalInfo[] = "signalInfo";
static char __pyx_k__suboffsets[] = "suboffsets";
static char __pyx_k__BufferError[] = "BufferError";
static char __pyx_k__ImportError[] = "ImportError";
static char __pyx_k____setOutput[] = "__setOutput";
static char __pyx_k__cget_signal[] = "cget_signal";
static char __pyx_k__compression[] = "compression";
static char __pyx_k__cset_signal[] = "cset_signal";
static char __pyx_k__description[] = "description";
static char __pyx_k__in_encoding[] = "in_encoding";
static char __pyx_k__initialdata[] = "initialdata";
static char __pyx_k__outencoding[] = "outencoding";
static char __pyx_k__C_CONTIGUOUS[] = "C_CONTIGUOUS";
static char __pyx_k__F_CONTIGUOUS[] = "F_CONTIGUOUS";
static char __pyx_k__RuntimeError[] = "RuntimeError";
static char __pyx_k__SOX_EFF_CHAN[] = "SOX_EFF_CHAN";
static char __pyx_k__SOX_EFF_GAIN[] = "SOX_EFF_GAIN";
static char __pyx_k__SOX_EFF_NULL[] = "SOX_EFF_NULL";
static char __pyx_k__SOX_EFF_PREC[] = "SOX_EFF_PREC";
static char __pyx_k__SOX_EFF_RATE[] = "SOX_EFF_RATE";
static char __pyx_k____do_dealloc[] = "__do_dealloc";
static char __pyx_k__encodingInfo[] = "encodingInfo";
static char __pyx_k__flow_effects[] = "flow_effects";
static char __pyx_k__get_encoding[] = "get_encoding";
static char __pyx_k__out_encoding[] = "out_encoding";
static char __pyx_k__SOX_EFF_ALPHA[] = "SOX_EFF_ALPHA";
static char __pyx_k__SOX_EFF_MCHAN[] = "SOX_EFF_MCHAN";
static char __pyx_k__StopIteration[] = "StopIteration";
static char __pyx_k____init_effect[] = "__init_effect";
static char __pyx_k__cget_encoding[] = "cget_encoding";
static char __pyx_k__cset_encoding[] = "cset_encoding";
static char __pyx_k__get_in_signal[] = "get_in_signal";
static char __pyx_k__optimize_trim[] = "optimize_trim";
static char __pyx_k__sox_read_wide[] = "sox_read_wide";
static char __pyx_k__SOX_EFF_LENGTH[] = "SOX_EFF_LENGTH";
static char __pyx_k__SOX_EFF_MODIFY[] = "SOX_EFF_MODIFY";
static char __pyx_k____init_effects[] = "__init_effects";
static char __pyx_k__get_out_signal[] = "get_out_signal";
static char __pyx_k__receive_header[] = "receive_header";
static char __pyx_k__recieved_flags[] = "recieved_flags";
static char __pyx_k__unicode_escape[] = "unicode_escape";
static char __pyx_k____create_buffer[] = "__create_buffer";
static char __pyx_k____do_dealloc_if[] = "__do_dealloc_if";
static char __pyx_k____optimize_trim[] = "__optimize_trim";
static char __pyx_k__available_flags[] = "available_flags";
static char __pyx_k__bits_per_sample[] = "bits_per_sample";
static char __pyx_k__get_in_encoding[] = "get_in_encoding";
static char __pyx_k__haveInputEffect[] = "haveInputEffect";
static char __pyx_k__list_to_sizebuf[] = "list_to_sizebuf";
static char __pyx_k__SOX_EFF_INTERNAL[] = "SOX_EFF_INTERNAL";
static char __pyx_k__get_out_encoding[] = "get_out_encoding";
static char __pyx_k__haveOutputEffect[] = "haveOutputEffect";
static char __pyx_k____sox_initializer[] = "__sox_initializer";
static char __pyx_k__SOX_EFF_DEPRECATED[] = "SOX_EFF_DEPRECATED";
static char __pyx_k__get_default_format[] = "get_default_format";
static char __pyx_k____calculate_signals[] = "__calculate_signals";
static char __pyx_k__must_dealloc_buffer[] = "must_dealloc_buffer";
static PyObject *__pyx_kp_s_1;
static PyObject *__pyx_kp_s_10;
static PyObject *__pyx_kp_u_13;
static PyObject *__pyx_kp_u_14;
static PyObject *__pyx_kp_s_15;
static PyObject *__pyx_kp_s_17;
static PyObject *__pyx_kp_s_18;
static PyObject *__pyx_kp_s_19;
static PyObject *__pyx_kp_s_20;
static PyObject *__pyx_kp_s_21;
static PyObject *__pyx_kp_u_24;
static PyObject *__pyx_kp_u_25;
static PyObject *__pyx_kp_s_26;
static PyObject *__pyx_kp_s_28;
static PyObject *__pyx_kp_u_3;
static PyObject *__pyx_n_s_30;
static PyObject *__pyx_kp_s_31;
static PyObject *__pyx_kp_s_33;
static PyObject *__pyx_kp_s_36;
static PyObject *__pyx_n_s_38;
static PyObject *__pyx_kp_s_39;
static PyObject *__pyx_kp_u_4;
static PyObject *__pyx_kp_b_41;
static PyObject *__pyx_n_s_42;
static PyObject *__pyx_kp_s_43;
static PyObject *__pyx_kp_s_46;
static PyObject *__pyx_kp_s_48;
static PyObject *__pyx_kp_b_5;
static PyObject *__pyx_kp_s_5;
static PyObject *__pyx_kp_u_5;
static PyObject *__pyx_kp_s_50;
static PyObject *__pyx_kp_s_52;
static PyObject *__pyx_kp_s_56;
static PyObject *__pyx_kp_s_58;
static PyObject *__pyx_kp_u_6;
static PyObject *__pyx_kp_u_7;
static PyObject *__pyx_kp_s_8;
static PyObject *__pyx_n_s__ALAW;
static PyObject *__pyx_n_s__AMR_NB;
static PyObject *__pyx_n_s__AMR_WB;
static PyObject *__pyx_n_s__BufferError;
static PyObject *__pyx_n_s__CL_ADPCM;
static PyObject *__pyx_n_s__CL_ADPCM16;
static PyObject *__pyx_n_s__CVSD;
static PyObject *__pyx_n_s__C_CONTIGUOUS;
static PyObject *__pyx_n_s__DPCM;
static PyObject *__pyx_n_s__DWVW;
static PyObject *__pyx_n_s__DWVWN;
static PyObject *__pyx_n_s__EOFError;
static PyObject *__pyx_n_s__Exception;
static PyObject *__pyx_n_s__FLAC;
static PyObject *__pyx_n_s__FLOAT;
static PyObject *__pyx_n_s__FLOAT_TEXT;
static PyObject *__pyx_n_s__FORMAT;
static PyObject *__pyx_n_s__F_CONTIGUOUS;
static PyObject *__pyx_n_s__G721;
static PyObject *__pyx_n_s__G723;
static PyObject *__pyx_n_s__GSM;
static PyObject *__pyx_n_s__HCOM;
static PyObject *__pyx_n_s__IMA_ADPCM;
static PyObject *__pyx_n_s__INDIRECT;
static PyObject *__pyx_n_s__IOError;
static PyObject *__pyx_n_s__ImportError;
static PyObject *__pyx_n_s__IndexError;
static PyObject *__pyx_n_s__LPC10;
static PyObject *__pyx_n_s__MP3;
static PyObject *__pyx_n_s__MS_ADPCM;
static PyObject *__pyx_n_s__ND;
static PyObject *__pyx_n_s__OKI_ADPCM;
static PyObject *__pyx_n_s__PY3;
static PyObject *__pyx_n_s__PysoxError;
static PyObject *__pyx_n_s__RuntimeError;
static PyObject *__pyx_n_s__SIGN2;
static PyObject *__pyx_n_s__SOX_EFF_ALPHA;
static PyObject *__pyx_n_s__SOX_EFF_CHAN;
static PyObject *__pyx_n_s__SOX_EFF_DEPRECATED;
static PyObject *__pyx_n_s__SOX_EFF_GAIN;
static PyObject *__pyx_n_s__SOX_EFF_INTERNAL;
static PyObject *__pyx_n_s__SOX_EFF_LENGTH;
static PyObject *__pyx_n_s__SOX_EFF_MCHAN;
static PyObject *__pyx_n_s__SOX_EFF_MODIFY;
static PyObject *__pyx_n_s__SOX_EFF_NULL;
static PyObject *__pyx_n_s__SOX_EFF_PREC;
static PyObject *__pyx_n_s__SOX_EFF_RATE;
static PyObject *__pyx_n_s__STRIDES;
static PyObject *__pyx_n_s__StopIteration;
static PyObject *__pyx_n_s__TypeError;
static PyObject *__pyx_n_s__ULAW;
static PyObject *__pyx_n_s__UNKNOWN;
static PyObject *__pyx_n_s__UNSIGNED;
static PyObject *__pyx_n_s__VORBIS;
static PyObject *__pyx_n_s__WAVPACK;
static PyObject *__pyx_n_s__WAVPACKF;
static PyObject *__pyx_n_s__WRITABLE;
static PyObject *__pyx_n_s__XXXXXXX;
static PyObject *__pyx_n_s__ZZZZZZZZZZ;
static PyObject *__pyx_n_s____calculate_signals;
static PyObject *__pyx_n_s____create_buffer;
static PyObject *__pyx_n_s____do_dealloc;
static PyObject *__pyx_n_s____do_dealloc_if;
static PyObject *__pyx_n_s____init__;
static PyObject *__pyx_n_s____init_effect;
static PyObject *__pyx_n_s____init_effects;
static PyObject *__pyx_n_s____main__;
static PyObject *__pyx_n_s____optimize_trim;
static PyObject *__pyx_n_s____setInput;
static PyObject *__pyx_n_s____setOutput;
static PyObject *__pyx_n_s____sox_initializer;
static PyObject *__pyx_n_s____test__;
static PyObject *__pyx_n_s__argc;
static PyObject *__pyx_n_s__argv;
static PyObject *__pyx_n_s__asCharP;
static PyObject *__pyx_n_s__available_flags;
static PyObject *__pyx_n_s__b;
static PyObject *__pyx_n_s__bits_per_sample;
static PyObject *__pyx_n_s__buf;
static PyObject *__pyx_n_s__buffer;
static PyObject *__pyx_n_s__bytearray;
static PyObject *__pyx_n_s__cget_encoding;
static PyObject *__pyx_n_s__cget_signal;
static PyObject *__pyx_n_s__chain;
static PyObject *__pyx_n_s__channel;
static PyObject *__pyx_n_s__channels;
static PyObject *__pyx_n_s__close;
static PyObject *__pyx_n_s__compression;
static PyObject *__pyx_n_s__create;
static PyObject *__pyx_n_s__cset_encoding;
static PyObject *__pyx_n_s__cset_signal;
static PyObject *__pyx_n_s__data;
static PyObject *__pyx_n_s__datalen;
static PyObject *__pyx_n_s__desc;
static PyObject *__pyx_n_s__description;
static PyObject *__pyx_n_s__effect;
static PyObject *__pyx_n_s__effects;
static PyObject *__pyx_n_s__encode;
static PyObject *__pyx_n_s__encoding;
static PyObject *__pyx_n_s__encodingInfo;
static PyObject *__pyx_n_s__enumerate;
static PyObject *__pyx_n_s__fileType;
static PyObject *__pyx_n_s__filename;
static PyObject *__pyx_n_s__filetype;
static PyObject *__pyx_n_s__flagname;
static PyObject *__pyx_n_s__flags;
static PyObject *__pyx_n_s__flow_effects;
static PyObject *__pyx_n_s__flush;
static PyObject *__pyx_n_s__format;
static PyObject *__pyx_n_s__frombytes;
static PyObject *__pyx_n_s__fromlist;
static PyObject *__pyx_n_s__ft;
static PyObject *__pyx_n_s__get_default_format;
static PyObject *__pyx_n_s__get_effect;
static PyObject *__pyx_n_s__get_encoding;
static PyObject *__pyx_n_s__get_ft;
static PyObject *__pyx_n_s__get_in_encoding;
static PyObject *__pyx_n_s__get_in_signal;
static PyObject *__pyx_n_s__get_name;
static PyObject *__pyx_n_s__get_out_encoding;
static PyObject *__pyx_n_s__get_out_signal;
static PyObject *__pyx_n_s__get_signal;
static PyObject *__pyx_n_s__handler;
static PyObject *__pyx_n_s__haveInputEffect;
static PyObject *__pyx_n_s__haveOutputEffect;
static PyObject *__pyx_n_s__i;
static PyObject *__pyx_n_s__in_encoding;
static PyObject *__pyx_n_s__in_signal;
static PyObject *__pyx_n_s__inencoding;
static PyObject *__pyx_n_s__initialdata;
static PyObject *__pyx_n_s__input;
static PyObject *__pyx_n_s__insert;
static PyObject *__pyx_n_s__insignal;
static PyObject *__pyx_n_s__instream;
static PyObject *__pyx_n_s__internal;
static PyObject *__pyx_n_s__istream;
static PyObject *__pyx_n_s__itemsize;
static PyObject *__pyx_n_s__len;
static PyObject *__pyx_n_s__length;
static PyObject *__pyx_n_s__list_to_sizebuf;
static PyObject *__pyx_n_s__mode;
static PyObject *__pyx_n_s__must_dealloc_buffer;
static PyObject *__pyx_n_s__name;
static PyObject *__pyx_n_s__ndim;
static PyObject *__pyx_n_u__null;
static PyObject *__pyx_n_s__obj;
static PyObject *__pyx_n_s__offset;
static PyObject *__pyx_n_s__open_read;
static PyObject *__pyx_n_s__open_write;
static PyObject *__pyx_n_s__optimize_trim;
static PyObject *__pyx_n_s__ostream;
static PyObject *__pyx_n_s__out_encoding;
static PyObject *__pyx_n_s__out_signal;
static PyObject *__pyx_n_s__outencoding;
static PyObject *__pyx_n_s__output;
static PyObject *__pyx_n_s__outsignal;
static PyObject *__pyx_n_s__outstream;
static PyObject *__pyx_n_s__path;
static PyObject *__pyx_n_s__precision;
static PyObject *__pyx_n_s__print_exc;
static PyObject *__pyx_n_s__r;
static PyObject *__pyx_n_u__r;
static PyObject *__pyx_n_s__range;
static PyObject *__pyx_n_s__rate;
static PyObject *__pyx_n_s__read_only;
static PyObject *__pyx_n_s__readonly;
static PyObject *__pyx_n_s__receive_header;
static PyObject *__pyx_n_s__recieved_flags;
static PyObject *__pyx_n_s__recv_bytes;
static PyObject *__pyx_n_s__release_ok;
static PyObject *__pyx_n_s__s_encoding;
static PyObject *__pyx_n_s__s_signal;
static PyObject *__pyx_n_s__seek;
static PyObject *__pyx_n_s__seekable;
static PyObject *__pyx_n_s__set_buffer;
static PyObject *__pyx_n_s__shape;
static PyObject *__pyx_n_s__signal;
static PyObject *__pyx_n_s__signalInfo;
static PyObject *__pyx_n_s__sox_read;
static PyObject *__pyx_n_s__sox_read_wide;
static PyObject *__pyx_n_s__stdout;
static PyObject *__pyx_n_s__strides;
static PyObject *__pyx_n_s__suboffsets;
static PyObject *__pyx_n_s__sys;
static PyObject *__pyx_n_s__traceback;
static PyObject *__pyx_n_b__trim;
static PyObject *__pyx_n_s__types;
static PyObject *__pyx_n_s__u;
static PyObject *__pyx_n_s__unicode_escape;
static PyObject *__pyx_n_s__viewcount;
static PyObject *__pyx_n_s__w;
static PyObject *__pyx_n_s__write;
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_2;
static PyObject *__pyx_int_3;
static PyObject *__pyx_int_4;
static PyObject *__pyx_int_5;
static PyObject *__pyx_int_6;
static PyObject *__pyx_int_7;
static PyObject *__pyx_int_8;
static PyObject *__pyx_int_9;
static PyObject *__pyx_int_10;
static PyObject *__pyx_int_11;
static PyObject *__pyx_int_12;
static PyObject *__pyx_int_13;
static PyObject *__pyx_int_14;
static PyObject *__pyx_int_15;
static PyObject *__pyx_int_16;
static PyObject *__pyx_int_17;
static PyObject *__pyx_int_18;
static PyObject *__pyx_int_19;
static PyObject *__pyx_int_20;
static PyObject *__pyx_int_21;
static PyObject *__pyx_int_22;
static PyObject *__pyx_int_23;
static PyObject *__pyx_int_24;
static PyObject *__pyx_int_25;
static PyObject *__pyx_int_26;
static PyObject *__pyx_int_27;
static PyObject *__pyx_int_32;
static PyObject *__pyx_int_64;
static PyObject *__pyx_int_128;
static PyObject *__pyx_int_256;
static PyObject *__pyx_int_512;
static PyObject *__pyx_int_1024;
static PyObject *__pyx_int_48000;
static PyObject *__pyx_k_35;
static PyObject *__pyx_k_tuple_2;
static PyObject *__pyx_k_tuple_9;
static PyObject *__pyx_k_tuple_11;
static PyObject *__pyx_k_tuple_12;
static PyObject *__pyx_k_tuple_16;
static PyObject *__pyx_k_tuple_22;
static PyObject *__pyx_k_tuple_23;
static PyObject *__pyx_k_tuple_27;
static PyObject *__pyx_k_tuple_29;
static PyObject *__pyx_k_tuple_32;
static PyObject *__pyx_k_tuple_34;
static PyObject *__pyx_k_tuple_37;
static PyObject *__pyx_k_tuple_40;
static PyObject *__pyx_k_tuple_44;
static PyObject *__pyx_k_tuple_45;
static PyObject *__pyx_k_tuple_47;
static PyObject *__pyx_k_tuple_49;
static PyObject *__pyx_k_tuple_51;
static PyObject *__pyx_k_tuple_53;
static PyObject *__pyx_k_tuple_54;
static PyObject *__pyx_k_tuple_55;
static PyObject *__pyx_k_tuple_57;

/* "pysox/sox.pyx":29
 * PY3 = PY_MAJOR_VERSION >= 3
 * if PY3:
 *     def b(s):             # <<<<<<<<<<<<<<
 *         return s.encode("utf-8")
 *     def u(s):
 */

static PyObject *__pyx_pf_5pysox_3sox_b(PyObject *__pyx_self, PyObject *__pyx_v_s); /*proto*/
static PyMethodDef __pyx_mdef_5pysox_3sox_b = {__Pyx_NAMESTR("b"), (PyCFunction)__pyx_pf_5pysox_3sox_b, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_5pysox_3sox_b(PyObject *__pyx_self, PyObject *__pyx_v_s) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("b");
  __pyx_self = __pyx_self;

  /* "pysox/sox.pyx":30
 * if PY3:
 *     def b(s):
 *         return s.encode("utf-8")             # <<<<<<<<<<<<<<
 *     def u(s):
 *         return s
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_s, __pyx_n_s__encode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_2), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysox.sox.b");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":31
 *     def b(s):
 *         return s.encode("utf-8")
 *     def u(s):             # <<<<<<<<<<<<<<
 *         return s
 * else:
 */

static PyObject *__pyx_pf_5pysox_3sox_1u(PyObject *__pyx_self, PyObject *__pyx_v_s); /*proto*/
static PyMethodDef __pyx_mdef_5pysox_3sox_1u = {__Pyx_NAMESTR("u"), (PyCFunction)__pyx_pf_5pysox_3sox_1u, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_5pysox_3sox_1u(PyObject *__pyx_self, PyObject *__pyx_v_s) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannySetupContext("u");
  __pyx_self = __pyx_self;

  /* "pysox/sox.pyx":32
 *         return s.encode("utf-8")
 *     def u(s):
 *         return s             # <<<<<<<<<<<<<<
 * else:
 *     def b(s):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_s);
  __pyx_r = __pyx_v_s;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":34
 *         return s
 * else:
 *     def b(s):             # <<<<<<<<<<<<<<
 *         return s
 *     def u(s):
 */

static PyObject *__pyx_pf_5pysox_3sox_2b(PyObject *__pyx_self, PyObject *__pyx_v_s); /*proto*/
static PyMethodDef __pyx_mdef_5pysox_3sox_2b = {__Pyx_NAMESTR("b"), (PyCFunction)__pyx_pf_5pysox_3sox_2b, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_5pysox_3sox_2b(PyObject *__pyx_self, PyObject *__pyx_v_s) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannySetupContext("b");
  __pyx_self = __pyx_self;

  /* "pysox/sox.pyx":35
 * else:
 *     def b(s):
 *         return s             # <<<<<<<<<<<<<<
 *     def u(s):
 *         return unicode(s, "unicode_escape")
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_s);
  __pyx_r = __pyx_v_s;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":36
 *     def b(s):
 *         return s
 *     def u(s):             # <<<<<<<<<<<<<<
 *         return unicode(s, "unicode_escape")
 * 
 */

static PyObject *__pyx_pf_5pysox_3sox_3u(PyObject *__pyx_self, PyObject *__pyx_v_s); /*proto*/
static PyMethodDef __pyx_mdef_5pysox_3sox_3u = {__Pyx_NAMESTR("u"), (PyCFunction)__pyx_pf_5pysox_3sox_3u, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_5pysox_3sox_3u(PyObject *__pyx_self, PyObject *__pyx_v_s) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("u");
  __pyx_self = __pyx_self;

  /* "pysox/sox.pyx":37
 *         return s
 *     def u(s):
 *         return unicode(s, "unicode_escape")             # <<<<<<<<<<<<<<
 * 
 * cdef unicode char2u(char * s):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(__pyx_v_s);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_s);
  __Pyx_GIVEREF(__pyx_v_s);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__unicode_escape));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_n_s__unicode_escape));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__unicode_escape));
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyUnicode_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysox.sox.u");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":39
 *         return unicode(s, "unicode_escape")
 * 
 * cdef unicode char2u(char * s):             # <<<<<<<<<<<<<<
 *     if PY3:
 *         return u(s.decode('utf-8'))
 */

static  PyObject *__pyx_f_5pysox_3sox_char2u(char *__pyx_v_s) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("char2u");

  /* "pysox/sox.pyx":40
 * 
 * cdef unicode char2u(char * s):
 *     if PY3:             # <<<<<<<<<<<<<<
 *         return u(s.decode('utf-8'))
 *     else:
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__PY3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "pysox/sox.pyx":41
 * cdef unicode char2u(char * s):
 *     if PY3:
 *         return u(s.decode('utf-8'))             # <<<<<<<<<<<<<<
 *     else:
 *         return u(s)
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__u); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = ((PyObject *)PyUnicode_DecodeUTF8(__pyx_v_s, strlen(__pyx_v_s), NULL)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_3));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
    __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected unicode, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_r = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pysox/sox.pyx":43
 *         return u(s.decode('utf-8'))
 *     else:
 *         return u(s)             # <<<<<<<<<<<<<<
 * 
 * cdef char * toCharP(uobj):
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__u); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyBytes_FromString(__pyx_v_s); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_4));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
    __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected unicode, got %.200s", Py_TYPE(__pyx_t_4)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_r = ((PyObject*)__pyx_t_4);
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }
  __pyx_L3:;

  __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pysox.sox.char2u");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":45
 *         return u(s)
 * 
 * cdef char * toCharP(uobj):             # <<<<<<<<<<<<<<
 *     cdef char * result
 *     try:
 */

static  char *__pyx_f_5pysox_3sox_toCharP(PyObject *__pyx_v_uobj) {
  PyObject *__pyx_v_bobj;
  PyObject *__pyx_v_e;
  PyObject *__pyx_v_traceback;
  PyObject *__pyx_v_sys;
  char *__pyx_r;
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  char *__pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("toCharP");
  __pyx_v_bobj = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_e = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_traceback = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_sys = Py_None; __Pyx_INCREF(Py_None);

  /* "pysox/sox.pyx":47
 * cdef char * toCharP(uobj):
 *     cdef char * result
 *     try:             # <<<<<<<<<<<<<<
 *         if PY3:
 *             bobj = <bytes>b(uobj)
 */
  {
    PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
    __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
    __Pyx_XGOTREF(__pyx_save_exc_type);
    __Pyx_XGOTREF(__pyx_save_exc_value);
    __Pyx_XGOTREF(__pyx_save_exc_tb);
    /*try:*/ {

      /* "pysox/sox.pyx":48
 *     cdef char * result
 *     try:
 *         if PY3:             # <<<<<<<<<<<<<<
 *             bobj = <bytes>b(uobj)
 *         else:
 */
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__PY3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_2) {

        /* "pysox/sox.pyx":49
 *     try:
 *         if PY3:
 *             bobj = <bytes>b(uobj)             # <<<<<<<<<<<<<<
 *         else:
 *             bobj = uobj
 */
        __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__b); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_3));
        __Pyx_INCREF(__pyx_v_uobj);
        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_uobj);
        __Pyx_GIVEREF(__pyx_v_uobj);
        __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
        __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_t_4)));
        __Pyx_DECREF(__pyx_v_bobj);
        __pyx_v_bobj = __pyx_t_4;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        goto __pyx_L11;
      }
      /*else*/ {

        /* "pysox/sox.pyx":51
 *             bobj = <bytes>b(uobj)
 *         else:
 *             bobj = uobj             # <<<<<<<<<<<<<<
 *         return <char *>bobj
 *     except Exception, e:
 */
        __Pyx_INCREF(__pyx_v_uobj);
        __Pyx_DECREF(__pyx_v_bobj);
        __pyx_v_bobj = __pyx_v_uobj;
      }
      __pyx_L11:;

      /* "pysox/sox.pyx":52
 *         else:
 *             bobj = uobj
 *         return <char *>bobj             # <<<<<<<<<<<<<<
 *     except Exception, e:
 *         print('XXXXXXX',e)
 */
      __pyx_t_5 = PyBytes_AsString(__pyx_v_bobj); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __pyx_r = __pyx_t_5;
      goto __pyx_L7_try_return;
    }
    __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
    __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
    __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
    goto __pyx_L10_try_end;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_save_exc_type);
    __Pyx_XGIVEREF(__pyx_save_exc_value);
    __Pyx_XGIVEREF(__pyx_save_exc_tb);
    __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
    goto __pyx_L0;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pysox/sox.pyx":53
 *             bobj = uobj
 *         return <char *>bobj
 *     except Exception, e:             # <<<<<<<<<<<<<<
 *         print('XXXXXXX',e)
 *         print('XXXXXXX',uobj)
 */
    __pyx_t_6 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
    if (__pyx_t_6) {
      __Pyx_AddTraceback("pysox.sox.toCharP");
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_3, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_v_e);
      __pyx_v_e = __pyx_t_3;

      /* "pysox/sox.pyx":54
 *         return <char *>bobj
 *     except Exception, e:
 *         print('XXXXXXX',e)             # <<<<<<<<<<<<<<
 *         print('XXXXXXX',uobj)
 *         import traceback,sys
 */
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_7));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__XXXXXXX));
      PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_n_s__XXXXXXX));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__XXXXXXX));
      __Pyx_INCREF(__pyx_v_e);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_e);
      __Pyx_GIVEREF(__pyx_v_e);
      if (__Pyx_PrintOne(0, ((PyObject *)__pyx_t_7)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;

      /* "pysox/sox.pyx":55
 *     except Exception, e:
 *         print('XXXXXXX',e)
 *         print('XXXXXXX',uobj)             # <<<<<<<<<<<<<<
 *         import traceback,sys
 *         traceback.print_exc()
 */
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_7));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__XXXXXXX));
      PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_n_s__XXXXXXX));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__XXXXXXX));
      __Pyx_INCREF(__pyx_v_uobj);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_uobj);
      __Pyx_GIVEREF(__pyx_v_uobj);
      if (__Pyx_PrintOne(0, ((PyObject *)__pyx_t_7)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;

      /* "pysox/sox.pyx":56
 *         print('XXXXXXX',e)
 *         print('XXXXXXX',uobj)
 *         import traceback,sys             # <<<<<<<<<<<<<<
 *         traceback.print_exc()
 *         sys.stdout.flush()
 */
      __pyx_t_7 = __Pyx_Import(((PyObject *)__pyx_n_s__traceback), 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_v_traceback);
      __pyx_v_traceback = __pyx_t_7;
      __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_Import(((PyObject *)__pyx_n_s__sys), 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_v_sys);
      __pyx_v_sys = __pyx_t_7;
      __pyx_t_7 = 0;

      /* "pysox/sox.pyx":57
 *         print('XXXXXXX',uobj)
 *         import traceback,sys
 *         traceback.print_exc()             # <<<<<<<<<<<<<<
 *         sys.stdout.flush()
 * ################################################################################################
 */
      __pyx_t_7 = PyObject_GetAttr(__pyx_v_traceback, __pyx_n_s__print_exc); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "pysox/sox.pyx":58
 *         import traceback,sys
 *         traceback.print_exc()
 *         sys.stdout.flush()             # <<<<<<<<<<<<<<
 * ################################################################################################
 * #
 */
      __pyx_t_8 = PyObject_GetAttr(__pyx_v_sys, __pyx_n_s__stdout); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_7 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__flush); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L4_exception_handled;
    }
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_save_exc_type);
    __Pyx_XGIVEREF(__pyx_save_exc_value);
    __Pyx_XGIVEREF(__pyx_save_exc_tb);
    __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_save_exc_type);
    __Pyx_XGIVEREF(__pyx_save_exc_value);
    __Pyx_XGIVEREF(__pyx_save_exc_tb);
    __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
    __pyx_L10_try_end:;
  }

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_WriteUnraisable("pysox.sox.toCharP");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_bobj);
  __Pyx_DECREF(__pyx_v_e);
  __Pyx_DECREF(__pyx_v_traceback);
  __Pyx_DECREF(__pyx_v_sys);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":106
 *     LPC10 = 27    #, /[inserted by cython to avoid comment start]*  *[inserted by cython to avoid comment closer]/
 * 
 *     def __init__(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         """Constructor to create an encodinginfo
 * 
 */

static int __pyx_pf_5pysox_3sox_13CEncodingInfo___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pysox_3sox_13CEncodingInfo___init__[] = "Constructor to create an encodinginfo\n\n        .. class:: pysox.CEncodingInfo(CSoxEncoding.SIGN2, 32)\n        \n        The optional positional arguments encoding, bits_per_sample can be given,\n        in order to generate a static encodinginfo suitable to provide configuration data for streams.\n        ";
struct wrapperbase __pyx_wrapperbase_5pysox_3sox_13CEncodingInfo___init__;
static int __pyx_pf_5pysox_3sox_13CEncodingInfo___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  int __pyx_r;
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  sox_encoding_t __pyx_t_4;
  unsigned int __pyx_t_5;
  __Pyx_RefNannySetupContext("__init__");
  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1;
  __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New();
  if (unlikely(!__pyx_v_kwargs)) return -1;
  __Pyx_GOTREF(__pyx_v_kwargs);
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;

  /* "pysox/sox.pyx":114
 *         in order to generate a static encodinginfo suitable to provide configuration data for streams.
 *         """
 *         self.encoding = NULL             # <<<<<<<<<<<<<<
 *         if len(args) > 0:
 *             self.encoding = &self.s_encoding
 */
  ((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)__pyx_v_self)->encoding = NULL;

  /* "pysox/sox.pyx":115
 *         """
 *         self.encoding = NULL
 *         if len(args) > 0:             # <<<<<<<<<<<<<<
 *             self.encoding = &self.s_encoding
 *             self.encoding.encoding = args[0]
 */
  if (unlikely(__pyx_v_args == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
  }
  __pyx_t_1 = PyTuple_GET_SIZE(((PyObject *)__pyx_v_args)); 
  __pyx_t_2 = (__pyx_t_1 > 0);
  if (__pyx_t_2) {

    /* "pysox/sox.pyx":116
 *         self.encoding = NULL
 *         if len(args) > 0:
 *             self.encoding = &self.s_encoding             # <<<<<<<<<<<<<<
 *             self.encoding.encoding = args[0]
 *         if len(args) > 1:
 */
    ((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)__pyx_v_self)->encoding = (&((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)__pyx_v_self)->s_encoding);

    /* "pysox/sox.pyx":117
 *         if len(args) > 0:
 *             self.encoding = &self.s_encoding
 *             self.encoding.encoding = args[0]             # <<<<<<<<<<<<<<
 *         if len(args) > 1:
 *             self.encoding.bits_per_sample = args[1]
 */
    __pyx_t_3 = __Pyx_GetItemInt_Tuple(((PyObject *)__pyx_v_args), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = ((sox_encoding_t)PyInt_AsLong(__pyx_t_3)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    ((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)__pyx_v_self)->encoding->encoding = __pyx_t_4;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pysox/sox.pyx":118
 *             self.encoding = &self.s_encoding
 *             self.encoding.encoding = args[0]
 *         if len(args) > 1:             # <<<<<<<<<<<<<<
 *             self.encoding.bits_per_sample = args[1]
 * 
 */
  if (unlikely(__pyx_v_args == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
  }
  __pyx_t_1 = PyTuple_GET_SIZE(((PyObject *)__pyx_v_args)); 
  __pyx_t_2 = (__pyx_t_1 > 1);
  if (__pyx_t_2) {

    /* "pysox/sox.pyx":119
 *             self.encoding.encoding = args[0]
 *         if len(args) > 1:
 *             self.encoding.bits_per_sample = args[1]             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
    __pyx_t_3 = __Pyx_GetItemInt_Tuple(((PyObject *)__pyx_v_args), 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyInt_AsUnsignedInt(__pyx_t_3); if (unlikely((__pyx_t_5 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    ((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)__pyx_v_self)->encoding->bits_per_sample = __pyx_t_5;
    goto __pyx_L6;
  }
  __pyx_L6:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysox.sox.CEncodingInfo.__init__");
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_args);
  __Pyx_DECREF(__pyx_v_kwargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":121
 *             self.encoding.bits_per_sample = args[1]
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         cdef csox.sox_encodings_info_t edesc
 *         edesc = csox.sox_encodings_info[<int>self.encoding.encoding]
 */

static PyObject *__pyx_pf_5pysox_3sox_13CEncodingInfo_1__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_5pysox_3sox_13CEncodingInfo_1__repr__(PyObject *__pyx_v_self) {
  sox_encodings_info_t __pyx_v_edesc;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__repr__");

  /* "pysox/sox.pyx":123
 *     def __repr__(self):
 *         cdef csox.sox_encodings_info_t edesc
 *         edesc = csox.sox_encodings_info[<int>self.encoding.encoding]             # <<<<<<<<<<<<<<
 * 
 *         return u'CencodingInfo(%s,%s,"%s","%s",%s)' % (
 */
  __pyx_v_edesc = (sox_encodings_info[((int)((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)__pyx_v_self)->encoding->encoding)]);

  /* "pysox/sox.pyx":125
 *         edesc = csox.sox_encodings_info[<int>self.encoding.encoding]
 * 
 *         return u'CencodingInfo(%s,%s,"%s","%s",%s)' % (             # <<<<<<<<<<<<<<
 *             str(self.encoding.encoding),
 *             str(self.encoding.bits_per_sample),
 */
  __Pyx_XDECREF(__pyx_r);

  /* "pysox/sox.pyx":126
 * 
 *         return u'CencodingInfo(%s,%s,"%s","%s",%s)' % (
 *             str(self.encoding.encoding),             # <<<<<<<<<<<<<<
 *             str(self.encoding.bits_per_sample),
 *             edesc.name,edesc.desc,
 */
  __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)__pyx_v_self)->encoding->encoding); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;

  /* "pysox/sox.pyx":127
 *         return u'CencodingInfo(%s,%s,"%s","%s",%s)' % (
 *             str(self.encoding.encoding),
 *             str(self.encoding.bits_per_sample),             # <<<<<<<<<<<<<<
 *             edesc.name,edesc.desc,
 *             str(self.encoding.compression))
 */
  __pyx_t_2 = PyLong_FromUnsignedLong(((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)__pyx_v_self)->encoding->bits_per_sample); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;

  /* "pysox/sox.pyx":128
 *             str(self.encoding.encoding),
 *             str(self.encoding.bits_per_sample),
 *             edesc.name,edesc.desc,             # <<<<<<<<<<<<<<
 *             str(self.encoding.compression))
 *     def get_encodinginfo(self):
 */
  __pyx_t_3 = PyBytes_FromString(__pyx_v_edesc.name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __pyx_t_4 = PyBytes_FromString(__pyx_v_edesc.desc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));

  /* "pysox/sox.pyx":129
 *             str(self.encoding.bits_per_sample),
 *             edesc.name,edesc.desc,
 *             str(self.encoding.compression))             # <<<<<<<<<<<<<<
 *     def get_encodinginfo(self):
 *         """.. method:: get_encodinginfo()
 */
  __pyx_t_5 = PyFloat_FromDouble(((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)__pyx_v_self)->encoding->compression); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
  __pyx_t_6 = PyTuple_New(5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_t_3));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_6, 3, ((PyObject *)__pyx_t_4));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_3), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
  __pyx_r = ((PyObject *)__pyx_t_5);
  __pyx_t_5 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pysox.sox.CEncodingInfo.__repr__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":130
 *             edesc.name,edesc.desc,
 *             str(self.encoding.compression))
 *     def get_encodinginfo(self):             # <<<<<<<<<<<<<<
 *         """.. method:: get_encodinginfo()
 * 
 */

static PyObject *__pyx_pf_5pysox_3sox_13CEncodingInfo_2get_encodinginfo(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pysox_3sox_13CEncodingInfo_2get_encodinginfo[] = ".. method:: get_encodinginfo()\n        \n        Return a dictionary describing the encoding of the stream.\n        ";
static PyObject *__pyx_pf_5pysox_3sox_13CEncodingInfo_2get_encodinginfo(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  sox_encodings_info_t __pyx_v_edesc;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("get_encodinginfo");

  /* "pysox/sox.pyx":136
 *         """
 *         cdef csox.sox_encodings_info_t edesc
 *         edesc = csox.sox_encodings_info[<int>self.encoding.encoding]             # <<<<<<<<<<<<<<
 *         return {'encoding':self.encoding.encoding,
 *                 'bits_per_sample':self.encoding.bits_per_sample,
 */
  __pyx_v_edesc = (sox_encodings_info[((int)((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)__pyx_v_self)->encoding->encoding)]);

  /* "pysox/sox.pyx":137
 *         cdef csox.sox_encodings_info_t edesc
 *         edesc = csox.sox_encodings_info[<int>self.encoding.encoding]
 *         return {'encoding':self.encoding.encoding,             # <<<<<<<<<<<<<<
 *                 'bits_per_sample':self.encoding.bits_per_sample,
 *                 'compression':self.encoding.compression,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_2 = PyInt_FromLong(((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)__pyx_v_self)->encoding->encoding); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__encoding), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pysox/sox.pyx":138
 *         edesc = csox.sox_encodings_info[<int>self.encoding.encoding]
 *         return {'encoding':self.encoding.encoding,
 *                 'bits_per_sample':self.encoding.bits_per_sample,             # <<<<<<<<<<<<<<
 *                 'compression':self.encoding.compression,
 *                 'name':edesc.name,
 */
  __pyx_t_2 = PyLong_FromUnsignedLong(((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)__pyx_v_self)->encoding->bits_per_sample); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__bits_per_sample), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pysox/sox.pyx":139
 *         return {'encoding':self.encoding.encoding,
 *                 'bits_per_sample':self.encoding.bits_per_sample,
 *                 'compression':self.encoding.compression,             # <<<<<<<<<<<<<<
 *                 'name':edesc.name,
 *                 'description':edesc.desc
 */
  __pyx_t_2 = PyFloat_FromDouble(((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)__pyx_v_self)->encoding->compression); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__compression), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pysox/sox.pyx":140
 *                 'bits_per_sample':self.encoding.bits_per_sample,
 *                 'compression':self.encoding.compression,
 *                 'name':edesc.name,             # <<<<<<<<<<<<<<
 *                 'description':edesc.desc
 *                 }
 */
  __pyx_t_2 = PyBytes_FromString(__pyx_v_edesc.name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__name), ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;

  /* "pysox/sox.pyx":141
 *                 'compression':self.encoding.compression,
 *                 'name':edesc.name,
 *                 'description':edesc.desc             # <<<<<<<<<<<<<<
 *                 }
 * 
 */
  __pyx_t_2 = PyBytes_FromString(__pyx_v_edesc.desc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__description), ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysox.sox.CEncodingInfo.get_encodinginfo");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":144
 *                 }
 * 
 *     cdef cset_encoding(self, csox.sox_encodinginfo_t * encoding):             # <<<<<<<<<<<<<<
 *         self.encoding = encoding
 *     cdef csox.sox_encodinginfo_t * cget_encoding(self):
 */

static  PyObject *__pyx_f_5pysox_3sox_13CEncodingInfo_cset_encoding(struct __pyx_obj_5pysox_3sox_CEncodingInfo *__pyx_v_self, sox_encodinginfo_t *__pyx_v_encoding) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannySetupContext("cset_encoding");

  /* "pysox/sox.pyx":145
 * 
 *     cdef cset_encoding(self, csox.sox_encodinginfo_t * encoding):
 *         self.encoding = encoding             # <<<<<<<<<<<<<<
 *     cdef csox.sox_encodinginfo_t * cget_encoding(self):
 *         return self.encoding
 */
  __pyx_v_self->encoding = __pyx_v_encoding;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":146
 *     cdef cset_encoding(self, csox.sox_encodinginfo_t * encoding):
 *         self.encoding = encoding
 *     cdef csox.sox_encodinginfo_t * cget_encoding(self):             # <<<<<<<<<<<<<<
 *         return self.encoding
 * 
 */

static  sox_encodinginfo_t *__pyx_f_5pysox_3sox_13CEncodingInfo_cget_encoding(struct __pyx_obj_5pysox_3sox_CEncodingInfo *__pyx_v_self) {
  sox_encodinginfo_t *__pyx_r;
  __Pyx_RefNannySetupContext("cget_encoding");

  /* "pysox/sox.pyx":147
 *         self.encoding = encoding
 *     cdef csox.sox_encodinginfo_t * cget_encoding(self):
 *         return self.encoding             # <<<<<<<<<<<<<<
 * 
 *     def set_param(self, **param):
 */
  __pyx_r = __pyx_v_self->encoding;
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":149
 *         return self.encoding
 * 
 *     def set_param(self, **param):             # <<<<<<<<<<<<<<
 *         """.. method:: set_param( [encoding=ecode] [, bits_per_sample=bps] )
 * 
 */

static PyObject *__pyx_pf_5pysox_3sox_13CEncodingInfo_3set_param(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pysox_3sox_13CEncodingInfo_3set_param[] = ".. method:: set_param( [encoding=ecode] [, bits_per_sample=bps] )\n        \n        Alter the given parameters of this encodinginfo.\n        \n        *ecode* is the numeric encoding, see sox.h, enum sox_encoding_t for encodings.\n        CEncodingInfo defines symbols for encoding as class attributes::\n        \n            CSoxEncoding.UNKNOWN = 0 #,\n            CSoxEncoding.SIGN2 = 1   #, /* signed linear 2's comp: Mac */\n            CSoxEncoding.UNSIGNED = 2 #, /* unsigned linear: Sound Blaster */\n            CSoxEncoding.FLOAT = 3    #, /* floating point (binary format) */\n            CSoxEncoding.FLOAT_TEXT = 4 #, /* floating point (text format) */\n            CSoxEncoding.FLAC = 5     #, /* FLAC compression */\n            CSoxEncoding.HCOM = 6     #, /*  */\n            CSoxEncoding.WAVPACK = 7  #, /*  */\n            CSoxEncoding.WAVPACKF = 8 #, /*  */\n            CSoxEncoding.ULAW = 9     #, /* u-law signed logs: US telephony, SPARC */\n            CSoxEncoding.ALAW = 10     #, /* A-law signed logs: non-US telephony, Psion */\n            CSoxEncoding.G721 = 11     #, /* G.721 4-bit ADPCM */\n            CSoxEncoding.G723 = 12     #, /* G.723 3 or 5 bit ADPCM */\n            CSoxEncoding.CL_ADPCM = 13 #, /* Creative Labs 8 --> 2,3,4 bit Compressed PCM */\n            CSoxEncoding.CL_ADPCM16 = 14#, /* Creative Labs 16 --> 4 bit Compressed PCM */\n            CSoxEncoding.MS_ADPCM = 15 #, /* Microsoft Compressed PCM */\n            CSoxEncoding.IMA_ADPCM = 16#, /* IMA Compressed PCM */\n            CSoxEncoding.OKI_ADPCM = 17#, /* Dialogic/OKI Compressed PCM */\n            CSoxEncoding.DPCM = 18     #, /*  */\n            CSoxEncoding.DWVW = 19     #, /*  */\n            CSoxEncoding.DWVWN = 20    #, /*  */\n            CSoxEncoding.GSM = 21      #, /* GSM 6.10 33byte frame lossy compression */\n            CSoxEncoding.MP3 = 22      #, /* MP3 compression */\n            CSoxEncoding.VORBIS = 23   #, /* Vorbis compression */\n            CSoxEncodin""g.AMR_WB = 24   #, /* AMR-WB compression */\n            CSoxEncoding.AMR_NB = 25   #, /* AMR-NB compression */\n            CSoxEncoding.CVSD = 26     #, /*  */\n            CSoxEncoding.LPC10 = 27    #, /*  */\n        \n        *bps* is the sample rate in bits per sample\n        \n        ";
static PyObject *__pyx_pf_5pysox_3sox_13CEncodingInfo_3set_param(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_param = 0;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("set_param");
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("set_param", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
  if (__pyx_kwds && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "set_param", 1))) return NULL;
  __pyx_v_param = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New();
  if (unlikely(!__pyx_v_param)) return NULL;
  __Pyx_GOTREF(__pyx_v_param);

  /* "pysox/sox.pyx":189
 * 
 *         """
 *         if 'encoding' in param:             # <<<<<<<<<<<<<<
 *             self.signal.encoding = param['encoding']
 *         if 'bits_per_sample' in param:
 */
  if (unlikely(__pyx_v_param == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
  }
  __pyx_t_1 = ((PyDict_Contains(((PyObject *)__pyx_v_param), ((PyObject *)__pyx_n_s__encoding)))); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pysox/sox.pyx":190
 *         """
 *         if 'encoding' in param:
 *             self.signal.encoding = param['encoding']             # <<<<<<<<<<<<<<
 *         if 'bits_per_sample' in param:
 *             self.signal.bits_per_sample = param['bits_per_sample']
 */
    __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_param), ((PyObject *)__pyx_n_s__encoding)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__signal); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__encoding, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pysox/sox.pyx":191
 *         if 'encoding' in param:
 *             self.signal.encoding = param['encoding']
 *         if 'bits_per_sample' in param:             # <<<<<<<<<<<<<<
 *             self.signal.bits_per_sample = param['bits_per_sample']
 * 
 */
  if (unlikely(__pyx_v_param == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
  }
  __pyx_t_1 = ((PyDict_Contains(((PyObject *)__pyx_v_param), ((PyObject *)__pyx_n_s__bits_per_sample)))); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pysox/sox.pyx":192
 *             self.signal.encoding = param['encoding']
 *         if 'bits_per_sample' in param:
 *             self.signal.bits_per_sample = param['bits_per_sample']             # <<<<<<<<<<<<<<
 * 
 * ################################################################################################
 */
    __pyx_t_3 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_param), ((PyObject *)__pyx_n_s__bits_per_sample)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__signal); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s__bits_per_sample, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysox.sox.CEncodingInfo.set_param");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_param);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":203
 * #    cdef csox.sox_signalinfo_t s_signal
 * 
 *     def __init__(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         """create a signalinfo descriptor
 * 
 */

static int __pyx_pf_5pysox_3sox_11CSignalInfo___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pysox_3sox_11CSignalInfo___init__[] = "create a signalinfo descriptor\n        \n        .. class:: pysox.CSignalInfo([rate, channels, precision] [,length])\n        \n        If the parameters are given, the signalinfo is a static structure usable to provide signal data for streams.\n        ";
struct wrapperbase __pyx_wrapperbase_5pysox_3sox_11CSignalInfo___init__;
static int __pyx_pf_5pysox_3sox_11CSignalInfo___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  int __pyx_r;
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __pyx_t_5pysox_4csox_sox_rate_t __pyx_t_4;
  unsigned int __pyx_t_5;
  size_t __pyx_t_6;
  __Pyx_RefNannySetupContext("__init__");
  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1;
  __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New();
  if (unlikely(!__pyx_v_kwargs)) return -1;
  __Pyx_GOTREF(__pyx_v_kwargs);
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;

  /* "pysox/sox.pyx":210
 *         If the parameters are given, the signalinfo is a static structure usable to provide signal data for streams.
 *         """
 *         self.signal = NULL             # <<<<<<<<<<<<<<
 *         if len(args) > 0:
 *             self.signal = &self.s_signal
 */
  ((struct __pyx_obj_5pysox_3sox_CSignalInfo *)__pyx_v_self)->signal = NULL;

  /* "pysox/sox.pyx":211
 *         """
 *         self.signal = NULL
 *         if len(args) > 0:             # <<<<<<<<<<<<<<
 *             self.signal = &self.s_signal
 *             self.signal.rate = args[0]
 */
  if (unlikely(__pyx_v_args == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
  }
  __pyx_t_1 = PyTuple_GET_SIZE(((PyObject *)__pyx_v_args)); 
  __pyx_t_2 = (__pyx_t_1 > 0);
  if (__pyx_t_2) {

    /* "pysox/sox.pyx":212
 *         self.signal = NULL
 *         if len(args) > 0:
 *             self.signal = &self.s_signal             # <<<<<<<<<<<<<<
 *             self.signal.rate = args[0]
 *         if len(args) > 1:
 */
    ((struct __pyx_obj_5pysox_3sox_CSignalInfo *)__pyx_v_self)->signal = (&((struct __pyx_obj_5pysox_3sox_CSignalInfo *)__pyx_v_self)->s_signal);

    /* "pysox/sox.pyx":213
 *         if len(args) > 0:
 *             self.signal = &self.s_signal
 *             self.signal.rate = args[0]             # <<<<<<<<<<<<<<
 *         if len(args) > 1:
 *             self.signal.channels = args[1]
 */
    __pyx_t_3 = __Pyx_GetItemInt_Tuple(((PyObject *)__pyx_v_args), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    ((struct __pyx_obj_5pysox_3sox_CSignalInfo *)__pyx_v_self)->signal->rate = __pyx_t_4;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pysox/sox.pyx":214
 *             self.signal = &self.s_signal
 *             self.signal.rate = args[0]
 *         if len(args) > 1:             # <<<<<<<<<<<<<<
 *             self.signal.channels = args[1]
 *         if len(args) > 2:
 */
  if (unlikely(__pyx_v_args == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
  }
  __pyx_t_1 = PyTuple_GET_SIZE(((PyObject *)__pyx_v_args)); 
  __pyx_t_2 = (__pyx_t_1 > 1);
  if (__pyx_t_2) {

    /* "pysox/sox.pyx":215
 *             self.signal.rate = args[0]
 *         if len(args) > 1:
 *             self.signal.channels = args[1]             # <<<<<<<<<<<<<<
 *         if len(args) > 2:
 *             self.signal.precision = args[2]
 */
    __pyx_t_3 = __Pyx_GetItemInt_Tuple(((PyObject *)__pyx_v_args), 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyInt_AsUnsignedInt(__pyx_t_3); if (unlikely((__pyx_t_5 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    ((struct __pyx_obj_5pysox_3sox_CSignalInfo *)__pyx_v_self)->signal->channels = __pyx_t_5;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "pysox/sox.pyx":216
 *         if len(args) > 1:
 *             self.signal.channels = args[1]
 *         if len(args) > 2:             # <<<<<<<<<<<<<<
 *             self.signal.precision = args[2]
 *         if len(args) > 3:
 */
  if (unlikely(__pyx_v_args == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
  }
  __pyx_t_1 = PyTuple_GET_SIZE(((PyObject *)__pyx_v_args)); 
  __pyx_t_2 = (__pyx_t_1 > 2);
  if (__pyx_t_2) {

    /* "pysox/sox.pyx":217
 *             self.signal.channels = args[1]
 *         if len(args) > 2:
 *             self.signal.precision = args[2]             # <<<<<<<<<<<<<<
 *         if len(args) > 3:
 *             self.signal.length = args[3]
 */
    __pyx_t_3 = __Pyx_GetItemInt_Tuple(((PyObject *)__pyx_v_args), 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyInt_AsUnsignedInt(__pyx_t_3); if (unlikely((__pyx_t_5 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    ((struct __pyx_obj_5pysox_3sox_CSignalInfo *)__pyx_v_self)->signal->precision = __pyx_t_5;
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "pysox/sox.pyx":218
 *         if len(args) > 2:
 *             self.signal.precision = args[2]
 *         if len(args) > 3:             # <<<<<<<<<<<<<<
 *             self.signal.length = args[3]
 * 
 */
  if (unlikely(__pyx_v_args == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
  }
  __pyx_t_1 = PyTuple_GET_SIZE(((PyObject *)__pyx_v_args)); 
  __pyx_t_2 = (__pyx_t_1 > 3);
  if (__pyx_t_2) {

    /* "pysox/sox.pyx":219
 *             self.signal.precision = args[2]
 *         if len(args) > 3:
 *             self.signal.length = args[3]             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
    __pyx_t_3 = __Pyx_GetItemInt_Tuple(((PyObject *)__pyx_v_args), 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __Pyx_PyInt_AsSize_t(__pyx_t_3); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    ((struct __pyx_obj_5pysox_3sox_CSignalInfo *)__pyx_v_self)->signal->length = __pyx_t_6;
    goto __pyx_L8;
  }
  __pyx_L8:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysox.sox.CSignalInfo.__init__");
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_args);
  __Pyx_DECREF(__pyx_v_kwargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":221
 *             self.signal.length = args[3]
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return u'CSignalInfo(%s,%s,%s,%s)' % (
 *             str(self.signal.rate),
 */

static PyObject *__pyx_pf_5pysox_3sox_11CSignalInfo_1__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_5pysox_3sox_11CSignalInfo_1__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__repr__");

  /* "pysox/sox.pyx":222
 * 
 *     def __repr__(self):
 *         return u'CSignalInfo(%s,%s,%s,%s)' % (             # <<<<<<<<<<<<<<
 *             str(self.signal.rate),
 *             str(self.signal.channels),
 */
  __Pyx_XDECREF(__pyx_r);

  /* "pysox/sox.pyx":223
 *     def __repr__(self):
 *         return u'CSignalInfo(%s,%s,%s,%s)' % (
 *             str(self.signal.rate),             # <<<<<<<<<<<<<<
 *             str(self.signal.channels),
 *             str(self.signal.precision),
 */
  __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_obj_5pysox_3sox_CSignalInfo *)__pyx_v_self)->signal->rate); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;

  /* "pysox/sox.pyx":224
 *         return u'CSignalInfo(%s,%s,%s,%s)' % (
 *             str(self.signal.rate),
 *             str(self.signal.channels),             # <<<<<<<<<<<<<<
 *             str(self.signal.precision),
 *             str(self.signal.length))
 */
  __pyx_t_2 = PyLong_FromUnsignedLong(((struct __pyx_obj_5pysox_3sox_CSignalInfo *)__pyx_v_self)->signal->channels); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;

  /* "pysox/sox.pyx":225
 *             str(self.signal.rate),
 *             str(self.signal.channels),
 *             str(self.signal.precision),             # <<<<<<<<<<<<<<
 *             str(self.signal.length))
 * 
 */
  __pyx_t_3 = PyLong_FromUnsignedLong(((struct __pyx_obj_5pysox_3sox_CSignalInfo *)__pyx_v_self)->signal->precision); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;

  /* "pysox/sox.pyx":226
 *             str(self.signal.channels),
 *             str(self.signal.precision),
 *             str(self.signal.length))             # <<<<<<<<<<<<<<
 * 
 *     def get_signalinfo(self):
 */
  __pyx_t_4 = __Pyx_PyInt_FromSize_t(((struct __pyx_obj_5pysox_3sox_CSignalInfo *)__pyx_v_self)->signal->length); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_4), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __pyx_r = ((PyObject *)__pyx_t_4);
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pysox.sox.CSignalInfo.__repr__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":228
 *             str(self.signal.length))
 * 
 *     def get_signalinfo(self):             # <<<<<<<<<<<<<<
 *         """Retrieve the details of the signal
 * 
 */

static PyObject *__pyx_pf_5pysox_3sox_11CSignalInfo_2get_signalinfo(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pysox_3sox_11CSignalInfo_2get_signalinfo[] = "Retrieve the details of the signal\n        \n        Returns:\n        \n            dict containing rate, channels, precision and length\n        ";
static PyObject *__pyx_pf_5pysox_3sox_11CSignalInfo_2get_signalinfo(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("get_signalinfo");

  /* "pysox/sox.pyx":235
 *             dict containing rate, channels, precision and length
 *         """
 *         return {'rate':self.signal.rate,             # <<<<<<<<<<<<<<
 *                 'channels':self.signal.channels,
 *                 'precision':self.signal.precision,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_2 = PyFloat_FromDouble(((struct __pyx_obj_5pysox_3sox_CSignalInfo *)__pyx_v_self)->signal->rate); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__rate), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pysox/sox.pyx":236
 *         """
 *         return {'rate':self.signal.rate,
 *                 'channels':self.signal.channels,             # <<<<<<<<<<<<<<
 *                 'precision':self.signal.precision,
 *                 'length':self.signal.length
 */
  __pyx_t_2 = PyLong_FromUnsignedLong(((struct __pyx_obj_5pysox_3sox_CSignalInfo *)__pyx_v_self)->signal->channels); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__channels), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pysox/sox.pyx":237
 *         return {'rate':self.signal.rate,
 *                 'channels':self.signal.channels,
 *                 'precision':self.signal.precision,             # <<<<<<<<<<<<<<
 *                 'length':self.signal.length
 *                 }
 */
  __pyx_t_2 = PyLong_FromUnsignedLong(((struct __pyx_obj_5pysox_3sox_CSignalInfo *)__pyx_v_self)->signal->precision); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__precision), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pysox/sox.pyx":238
 *                 'channels':self.signal.channels,
 *                 'precision':self.signal.precision,
 *                 'length':self.signal.length             # <<<<<<<<<<<<<<
 *                 }
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_FromSize_t(((struct __pyx_obj_5pysox_3sox_CSignalInfo *)__pyx_v_self)->signal->length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__length), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysox.sox.CSignalInfo.get_signalinfo");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":241
 *                 }
 * 
 *     cdef cset_signal(self, csox.sox_signalinfo_t * signal):             # <<<<<<<<<<<<<<
 *         self.signal = signal
 *     cdef csox.sox_signalinfo_t * cget_signal(self):
 */

static  PyObject *__pyx_f_5pysox_3sox_11CSignalInfo_cset_signal(struct __pyx_obj_5pysox_3sox_CSignalInfo *__pyx_v_self, sox_signalinfo_t *__pyx_v_signal) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannySetupContext("cset_signal");

  /* "pysox/sox.pyx":242
 * 
 *     cdef cset_signal(self, csox.sox_signalinfo_t * signal):
 *         self.signal = signal             # <<<<<<<<<<<<<<
 *     cdef csox.sox_signalinfo_t * cget_signal(self):
 *         return self.signal
 */
  __pyx_v_self->signal = __pyx_v_signal;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":243
 *     cdef cset_signal(self, csox.sox_signalinfo_t * signal):
 *         self.signal = signal
 *     cdef csox.sox_signalinfo_t * cget_signal(self):             # <<<<<<<<<<<<<<
 *         return self.signal
 * 
 */

static  sox_signalinfo_t *__pyx_f_5pysox_3sox_11CSignalInfo_cget_signal(struct __pyx_obj_5pysox_3sox_CSignalInfo *__pyx_v_self) {
  sox_signalinfo_t *__pyx_r;
  __Pyx_RefNannySetupContext("cget_signal");

  /* "pysox/sox.pyx":244
 *         self.signal = signal
 *     cdef csox.sox_signalinfo_t * cget_signal(self):
 *         return self.signal             # <<<<<<<<<<<<<<
 * 
 *     def set_param(self, **param):
 */
  __pyx_r = __pyx_v_self->signal;
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":246
 *         return self.signal
 * 
 *     def set_param(self, **param):             # <<<<<<<<<<<<<<
 *         """alter the parameters of this signalinfo.
 *         Either of the kwargs can be given to set appropriate aspect.
 */

static PyObject *__pyx_pf_5pysox_3sox_11CSignalInfo_3set_param(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pysox_3sox_11CSignalInfo_3set_param[] = "alter the parameters of this signalinfo.\n        Either of the kwargs can be given to set appropriate aspect.\n        \n        Kwargs:\n        rate: int\n        \n        channels: int\n        \n        precision: int\n        \n        length: int\n        ";
static PyObject *__pyx_pf_5pysox_3sox_11CSignalInfo_3set_param(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_param = 0;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __pyx_t_5pysox_4csox_sox_rate_t __pyx_t_3;
  unsigned int __pyx_t_4;
  size_t __pyx_t_5;
  __Pyx_RefNannySetupContext("set_param");
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("set_param", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
  if (__pyx_kwds && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "set_param", 1))) return NULL;
  __pyx_v_param = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New();
  if (unlikely(!__pyx_v_param)) return NULL;
  __Pyx_GOTREF(__pyx_v_param);

  /* "pysox/sox.pyx":259
 *         length: int
 *         """
 *         if 'rate' in param:             # <<<<<<<<<<<<<<
 *             self.signal.rate = param['rate']
 *         if 'channels' in param:
 */
  if (unlikely(__pyx_v_param == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
  }
  __pyx_t_1 = ((PyDict_Contains(((PyObject *)__pyx_v_param), ((PyObject *)__pyx_n_s__rate)))); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pysox/sox.pyx":260
 *         """
 *         if 'rate' in param:
 *             self.signal.rate = param['rate']             # <<<<<<<<<<<<<<
 *         if 'channels' in param:
 *             self.signal.channels = param['channels']
 */
    __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_param), ((PyObject *)__pyx_n_s__rate)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    ((struct __pyx_obj_5pysox_3sox_CSignalInfo *)__pyx_v_self)->signal->rate = __pyx_t_3;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pysox/sox.pyx":261
 *         if 'rate' in param:
 *             self.signal.rate = param['rate']
 *         if 'channels' in param:             # <<<<<<<<<<<<<<
 *             self.signal.channels = param['channels']
 *         if 'precision' in param:
 */
  if (unlikely(__pyx_v_param == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
  }
  __pyx_t_1 = ((PyDict_Contains(((PyObject *)__pyx_v_param), ((PyObject *)__pyx_n_s__channels)))); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pysox/sox.pyx":262
 *             self.signal.rate = param['rate']
 *         if 'channels' in param:
 *             self.signal.channels = param['channels']             # <<<<<<<<<<<<<<
 *         if 'precision' in param:
 *             self.signal.precision = param['precision']
 */
    __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_param), ((PyObject *)__pyx_n_s__channels)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyInt_AsUnsignedInt(__pyx_t_2); if (unlikely((__pyx_t_4 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    ((struct __pyx_obj_5pysox_3sox_CSignalInfo *)__pyx_v_self)->signal->channels = __pyx_t_4;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "pysox/sox.pyx":263
 *         if 'channels' in param:
 *             self.signal.channels = param['channels']
 *         if 'precision' in param:             # <<<<<<<<<<<<<<
 *             self.signal.precision = param['precision']
 *         if 'length' in param:
 */
  if (unlikely(__pyx_v_param == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
  }
  __pyx_t_1 = ((PyDict_Contains(((PyObject *)__pyx_v_param), ((PyObject *)__pyx_n_s__precision)))); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pysox/sox.pyx":264
 *             self.signal.channels = param['channels']
 *         if 'precision' in param:
 *             self.signal.precision = param['precision']             # <<<<<<<<<<<<<<
 *         if 'length' in param:
 *             self.signal.length = param['length']
 */
    __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_param), ((PyObject *)__pyx_n_s__precision)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyInt_AsUnsignedInt(__pyx_t_2); if (unlikely((__pyx_t_4 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    ((struct __pyx_obj_5pysox_3sox_CSignalInfo *)__pyx_v_self)->signal->precision = __pyx_t_4;
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "pysox/sox.pyx":265
 *         if 'precision' in param:
 *             self.signal.precision = param['precision']
 *         if 'length' in param:             # <<<<<<<<<<<<<<
 *             self.signal.length = param['length']
 * 
 */
  if (unlikely(__pyx_v_param == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
  }
  __pyx_t_1 = ((PyDict_Contains(((PyObject *)__pyx_v_param), ((PyObject *)__pyx_n_s__length)))); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pysox/sox.pyx":266
 *             self.signal.precision = param['precision']
 *         if 'length' in param:
 *             self.signal.length = param['length']             # <<<<<<<<<<<<<<
 * 
 * ################################################################################################
 */
    __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_param), ((PyObject *)__pyx_n_s__length)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyInt_AsSize_t(__pyx_t_2); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    ((struct __pyx_obj_5pysox_3sox_CSignalInfo *)__pyx_v_self)->signal->length = __pyx_t_5;
    goto __pyx_L8;
  }
  __pyx_L8:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysox.sox.CSignalInfo.set_param");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_param);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":281
 *     """
 *     #cdef csox.sox_format_t * ft
 *     def __init__(self, path=None, mode=None, CSignalInfo signalInfo=None, CEncodingInfo encodingInfo=None, fileType=None):             # <<<<<<<<<<<<<<
 *         """Create a sox stream (sox_format_t)
 * 
 */

static int __pyx_pf_5pysox_3sox_10CSoxStream___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pysox_3sox_10CSoxStream___init__[] = "Create a sox stream (sox_format_t)\n\n        .. py:class:: pysox.CSoxStream(path)\n        .. py:class:: pysox.CSoxStream(path, 'w', CSignalInfo signalInfo)\n        .. py:class:: pysox.CSoxStream(path, 'w', CSignalInfo signalInfo [, CEncodingInfo encodingInfo] [, fileType])\n        \n        Constructor\n    \n        Kwargs:\n            :param String path: The filename to read or write\n            :param String mode: optional file mode 'r' or 'w', defaults to 'r'\n            :param CSignalInfo signalInfo: required only for write mode to define the signal characteristics using the :py:class:`CSignalInfo` class.\n            :param CEncodingInfo encodingInfo: optional output encoding for write mode using the :py:class:`CEncodingInfo` class.\n            :param String fileType: optional, e.g. \"wav\"\n            :raises IOError: if the file cannot be opened\n            :raises TypeError: if write mode is requested and the signalInfo is not given        \n        ";
struct wrapperbase __pyx_wrapperbase_5pysox_3sox_10CSoxStream___init__;
static int __pyx_pf_5pysox_3sox_10CSoxStream___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_mode = 0;
  struct __pyx_obj_5pysox_3sox_CSignalInfo *__pyx_v_signalInfo = 0;
  struct __pyx_obj_5pysox_3sox_CEncodingInfo *__pyx_v_encodingInfo = 0;
  PyObject *__pyx_v_fileType = 0;
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  struct __pyx_opt_args_5pysox_3sox_10CSoxStream_open_read __pyx_t_5;
  struct __pyx_opt_args_5pysox_3sox_10CSoxStream_open_write __pyx_t_6;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__path,&__pyx_n_s__mode,&__pyx_n_s__signalInfo,&__pyx_n_s__encodingInfo,&__pyx_n_s__fileType,0};
  __Pyx_RefNannySetupContext("__init__");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[5] = {0,0,0,0,0};
    values[0] = ((PyObject *)Py_None);
    values[1] = ((PyObject *)Py_None);
    values[2] = (PyObject *)((struct __pyx_obj_5pysox_3sox_CSignalInfo *)Py_None);
    values[3] = (PyObject *)((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)Py_None);
    values[4] = ((PyObject *)Py_None);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__path);
        if (value) { values[0] = value; kw_args--; }
      }
      case  1:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__mode);
        if (value) { values[1] = value; kw_args--; }
      }
      case  2:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__signalInfo);
        if (value) { values[2] = value; kw_args--; }
      }
      case  3:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__encodingInfo);
        if (value) { values[3] = value; kw_args--; }
      }
      case  4:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fileType);
        if (value) { values[4] = value; kw_args--; }
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_path = values[0];
    __pyx_v_mode = values[1];
    __pyx_v_signalInfo = ((struct __pyx_obj_5pysox_3sox_CSignalInfo *)values[2]);
    __pyx_v_encodingInfo = ((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)values[3]);
    __pyx_v_fileType = values[4];
  } else {
    __pyx_v_path = ((PyObject *)Py_None);
    __pyx_v_mode = ((PyObject *)Py_None);
    __pyx_v_signalInfo = ((struct __pyx_obj_5pysox_3sox_CSignalInfo *)Py_None);
    __pyx_v_encodingInfo = ((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)Py_None);
    __pyx_v_fileType = ((PyObject *)Py_None);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  5: __pyx_v_fileType = PyTuple_GET_ITEM(__pyx_args, 4);
      case  4: __pyx_v_encodingInfo = ((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)PyTuple_GET_ITEM(__pyx_args, 3));
      case  3: __pyx_v_signalInfo = ((struct __pyx_obj_5pysox_3sox_CSignalInfo *)PyTuple_GET_ITEM(__pyx_args, 2));
      case  2: __pyx_v_mode = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: __pyx_v_path = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysox.sox.CSoxStream.__init__");
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_INCREF(__pyx_v_mode);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_signalInfo), __pyx_ptype_5pysox_3sox_CSignalInfo, 1, "signalInfo", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encodingInfo), __pyx_ptype_5pysox_3sox_CEncodingInfo, 1, "encodingInfo", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pysox/sox.pyx":299
 *             :raises TypeError: if write mode is requested and the signalInfo is not given
 *         """
 *         self.ft = NULL             # <<<<<<<<<<<<<<
 *         if not mode:
 *             mode = 'r'
 */
  ((struct __pyx_obj_5pysox_3sox_CSoxStream *)__pyx_v_self)->ft = NULL;

  /* "pysox/sox.pyx":300
 *         """
 *         self.ft = NULL
 *         if not mode:             # <<<<<<<<<<<<<<
 *             mode = 'r'
 *         if path:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_mode); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = (!__pyx_t_1);
  if (__pyx_t_2) {

    /* "pysox/sox.pyx":301
 *         self.ft = NULL
 *         if not mode:
 *             mode = 'r'             # <<<<<<<<<<<<<<
 *         if path:
 *             if mode == 'r':
 */
    __Pyx_INCREF(((PyObject *)__pyx_n_s__r));
    __Pyx_DECREF(__pyx_v_mode);
    __pyx_v_mode = ((PyObject *)__pyx_n_s__r);
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "pysox/sox.pyx":302
 *         if not mode:
 *             mode = 'r'
 *         if path:             # <<<<<<<<<<<<<<
 *             if mode == 'r':
 *                 self.open_read(path, signalInfo, encodingInfo, fileType)
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_path); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {

    /* "pysox/sox.pyx":303
 *             mode = 'r'
 *         if path:
 *             if mode == 'r':             # <<<<<<<<<<<<<<
 *                 self.open_read(path, signalInfo, encodingInfo, fileType)
 *             elif mode == 'w':
 */
    __pyx_t_3 = PyObject_RichCompare(__pyx_v_mode, ((PyObject *)__pyx_n_s__r), Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_2) {

      /* "pysox/sox.pyx":304
 *         if path:
 *             if mode == 'r':
 *                 self.open_read(path, signalInfo, encodingInfo, fileType)             # <<<<<<<<<<<<<<
 *             elif mode == 'w':
 *                 self.open_write(path, signalInfo, encodingInfo, fileType)
 */
      __pyx_t_5.__pyx_n = 3;
      __pyx_t_5.signalInfo = __pyx_v_signalInfo;
      __pyx_t_5.encodingInfo = __pyx_v_encodingInfo;
      __pyx_t_5.fileType = __pyx_v_fileType;
      __pyx_t_4 = ((struct __pyx_vtabstruct_5pysox_3sox_CSoxStream *)((struct __pyx_obj_5pysox_3sox_CSoxStream *)__pyx_v_self)->__pyx_vtab)->open_read(((struct __pyx_obj_5pysox_3sox_CSoxStream *)__pyx_v_self), __pyx_v_path, 0, &__pyx_t_5); if (unlikely(__pyx_t_4 == 0 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L8;
    }

    /* "pysox/sox.pyx":305
 *             if mode == 'r':
 *                 self.open_read(path, signalInfo, encodingInfo, fileType)
 *             elif mode == 'w':             # <<<<<<<<<<<<<<
 *                 self.open_write(path, signalInfo, encodingInfo, fileType)
 * 
 */
    __pyx_t_3 = PyObject_RichCompare(__pyx_v_mode, ((PyObject *)__pyx_n_s__w), Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_2) {

      /* "pysox/sox.pyx":306
 *                 self.open_read(path, signalInfo, encodingInfo, fileType)
 *             elif mode == 'w':
 *                 self.open_write(path, signalInfo, encodingInfo, fileType)             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
      __pyx_t_6.__pyx_n = 2;
      __pyx_t_6.encodingInfo = __pyx_v_encodingInfo;
      __pyx_t_6.fileType = __pyx_v_fileType;
      __pyx_t_3 = ((struct __pyx_vtabstruct_5pysox_3sox_CSoxStream *)((struct __pyx_obj_5pysox_3sox_CSoxStream *)__pyx_v_self)->__pyx_vtab)->open_write(((struct __pyx_obj_5pysox_3sox_CSoxStream *)__pyx_v_self), __pyx_v_path, __pyx_v_signalInfo, 0, &__pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L8;
    }
    __pyx_L8:;
    goto __pyx_L7;
  }
  __pyx_L7:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysox.sox.CSoxStream.__init__");
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_mode);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":308
 *                 self.open_write(path, signalInfo, encodingInfo, fileType)
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         self.close()
 * 
 */

static void __pyx_pf_5pysox_3sox_10CSoxStream_1__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pf_5pysox_3sox_10CSoxStream_1__dealloc__(PyObject *__pyx_v_self) {
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__dealloc__");

  /* "pysox/sox.pyx":309
 * 
 *     def __dealloc__(self):
 *         self.close()             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__close); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysox.sox.CSoxStream.__dealloc__");
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pysox/sox.pyx":311
 *         self.close()
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         if not self.ft:
 *             return u''
 */

static PyObject *__pyx_pf_5pysox_3sox_10CSoxStream_2__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_5pysox_3sox_10CSoxStream_2__str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__str__");

  /* "pysox/sox.pyx":312
 * 
 *     def __str__(self):
 *         if not self.ft:             # <<<<<<<<<<<<<<
 *             return u''
 *         return char2u(self.ft.filename)
 */
  __pyx_t_1 = (!(((struct __pyx_obj_5pysox_3sox_CSoxStream *)__pyx_v_self)->ft != 0));
  if (__pyx_t_1) {

    /* "pysox/sox.pyx":313
 *     def __str__(self):
 *         if not self.ft:
 *             return u''             # <<<<<<<<<<<<<<
 *         return char2u(self.ft.filename)
 *     def __repr__(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_kp_u_5));
    __pyx_r = ((PyObject *)__pyx_kp_u_5);
    goto __pyx_L0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pysox/sox.pyx":314
 *         if not self.ft:
 *             return u''
 *         return char2u(self.ft.filename)             # <<<<<<<<<<<<<<
 *     def __repr__(self):
 *         if not self.ft:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_f_5pysox_3sox_char2u(((struct __pyx_obj_5pysox_3sox_CSoxStream *)__pyx_v_self)->ft->filename)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysox.sox.CSoxStream.__str__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":315
 *             return u''
 *         return char2u(self.ft.filename)
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if not self.ft:
 *             return u'CSoxStream()'
 */

static PyObject *__pyx_pf_5pysox_3sox_10CSoxStream_3__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_5pysox_3sox_10CSoxStream_3__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__repr__");

  /* "pysox/sox.pyx":316
 *         return char2u(self.ft.filename)
 *     def __repr__(self):
 *         if not self.ft:             # <<<<<<<<<<<<<<
 *             return u'CSoxStream()'
 *         return u'CSoxStream(%s, %s)' %(char2u(self.ft.filename), char2u(self.ft.filetype))
 */
  __pyx_t_1 = (!(((struct __pyx_obj_5pysox_3sox_CSoxStream *)__pyx_v_self)->ft != 0));
  if (__pyx_t_1) {

    /* "pysox/sox.pyx":317
 *     def __repr__(self):
 *         if not self.ft:
 *             return u'CSoxStream()'             # <<<<<<<<<<<<<<
 *         return u'CSoxStream(%s, %s)' %(char2u(self.ft.filename), char2u(self.ft.filetype))
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_kp_u_6));
    __pyx_r = ((PyObject *)__pyx_kp_u_6);
    goto __pyx_L0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pysox/sox.pyx":318
 *         if not self.ft:
 *             return u'CSoxStream()'
 *         return u'CSoxStream(%s, %s)' %(char2u(self.ft.filename), char2u(self.ft.filetype))             # <<<<<<<<<<<<<<
 * 
 *     cdef csox.sox_format_t * get_ft(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_f_5pysox_3sox_char2u(((struct __pyx_obj_5pysox_3sox_CSoxStream *)__pyx_v_self)->ft->filename)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = ((PyObject *)__pyx_f_5pysox_3sox_char2u(((struct __pyx_obj_5pysox_3sox_CSoxStream *)__pyx_v_self)->ft->filetype)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_7), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __pyx_r = ((PyObject *)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pysox.sox.CSoxStream.__repr__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":320
 *         return u'CSoxStream(%s, %s)' %(char2u(self.ft.filename), char2u(self.ft.filetype))
 * 
 *     cdef csox.sox_format_t * get_ft(self):             # <<<<<<<<<<<<<<
 *         return self.ft
 * 
 */

static  sox_format_t *__pyx_f_5pysox_3sox_10CSoxStream_get_ft(struct __pyx_obj_5pysox_3sox_CSoxStream *__pyx_v_self) {
  sox_format_t *__pyx_r;
  __Pyx_RefNannySetupContext("get_ft");

  /* "pysox/sox.pyx":321
 * 
 *     cdef csox.sox_format_t * get_ft(self):
 *         return self.ft             # <<<<<<<<<<<<<<
 * 
 *     cdef char * asCharP(self):
 */
  __pyx_r = __pyx_v_self->ft;
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":323
 *         return self.ft
 * 
 *     cdef char * asCharP(self):             # <<<<<<<<<<<<<<
 *         return <char *>self.ft
 * 
 */

static  char *__pyx_f_5pysox_3sox_10CSoxStream_asCharP(struct __pyx_obj_5pysox_3sox_CSoxStream *__pyx_v_self) {
  char *__pyx_r;
  __Pyx_RefNannySetupContext("asCharP");

  /* "pysox/sox.pyx":324
 * 
 *     cdef char * asCharP(self):
 *         return <char *>self.ft             # <<<<<<<<<<<<<<
 * 
 *     cdef int sox_read(self, csox.sox_sample_t * obuf, size_t max):
 */
  __pyx_r = ((char *)__pyx_v_self->ft);
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":326
 *         return <char *>self.ft
 * 
 *     cdef int sox_read(self, csox.sox_sample_t * obuf, size_t max):             # <<<<<<<<<<<<<<
 *         """public size_t sox_read(csox.sox_sample_t * obuf, size_t max)
 * 
 */

static  int __pyx_f_5pysox_3sox_10CSoxStream_sox_read(struct __pyx_obj_5pysox_3sox_CSoxStream *__pyx_v_self, __pyx_t_5pysox_4csox_sox_sample_t *__pyx_v_obuf, size_t __pyx_v_max) {
  size_t __pyx_v_nread;
  int __pyx_r;
  __Pyx_RefNannySetupContext("sox_read");

  /* "pysox/sox.pyx":333
 *         """
 *         cdef size_t nread
 *         nread = csox.sox_read(self.ft, obuf, max);             # <<<<<<<<<<<<<<
 *         return nread
 * 
 */
  __pyx_v_nread = sox_read(__pyx_v_self->ft, __pyx_v_obuf, __pyx_v_max);

  /* "pysox/sox.pyx":334
 *         cdef size_t nread
 *         nread = csox.sox_read(self.ft, obuf, max);
 *         return nread             # <<<<<<<<<<<<<<
 * 
 *     cdef int sox_read_wide(self, csox.sox_sample_t * obuf, size_t max):
 */
  __pyx_r = __pyx_v_nread;
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":336
 *         return nread
 * 
 *     cdef int sox_read_wide(self, csox.sox_sample_t * obuf, size_t max):             # <<<<<<<<<<<<<<
 *         """public size_t sox_read_wide(csox.sox_sample_t * obuf, size_t max)
 * 
 */

static  int __pyx_f_5pysox_3sox_10CSoxStream_sox_read_wide(struct __pyx_obj_5pysox_3sox_CSoxStream *__pyx_v_self, __pyx_t_5pysox_4csox_sox_sample_t *__pyx_v_obuf, size_t __pyx_v_max) {
  size_t __pyx_v_nread;
  int __pyx_r;
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("sox_read_wide");

  /* "pysox/sox.pyx":343
 *         """
 *         cdef size_t nread
 *         nread = self.sox_read(obuf, max * self.ft.signal.channels) / self.ft.signal.channels;             # <<<<<<<<<<<<<<
 *         return nread
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pysox_3sox_CSoxStream *)__pyx_v_self->__pyx_vtab)->sox_read(__pyx_v_self, __pyx_v_obuf, (__pyx_v_max * __pyx_v_self->ft->signal.channels));
  if (unlikely(__pyx_v_self->ft->signal.channels == 0)) {
    PyErr_Format(PyExc_ZeroDivisionError, "integer division or modulo by zero");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_nread = (__pyx_t_1 / __pyx_v_self->ft->signal.channels);

  /* "pysox/sox.pyx":344
 *         cdef size_t nread
 *         nread = self.sox_read(obuf, max * self.ft.signal.channels) / self.ft.signal.channels;
 *         return nread             # <<<<<<<<<<<<<<
 * 
 *     cpdef int open_read(self, path, CSignalInfo signalInfo=None, CEncodingInfo encodingInfo=None, fileType=None) except ?0:
 */
  __pyx_r = __pyx_v_nread;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("pysox.sox.CSoxStream.sox_read_wide");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":346
 *         return nread
 * 
 *     cpdef int open_read(self, path, CSignalInfo signalInfo=None, CEncodingInfo encodingInfo=None, fileType=None) except ?0:             # <<<<<<<<<<<<<<
 *         """
 *         .. method:: open_read(path [, CSignalInfo signalInfo=None] [, CEncodingInfo encodingInfo=None] [, fileType=None])
 */

static PyObject *__pyx_pf_5pysox_3sox_10CSoxStream_4open_read(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static  int __pyx_f_5pysox_3sox_10CSoxStream_open_read(struct __pyx_obj_5pysox_3sox_CSoxStream *__pyx_v_self, PyObject *__pyx_v_path, int __pyx_skip_dispatch, struct __pyx_opt_args_5pysox_3sox_10CSoxStream_open_read *__pyx_optional_args) {
  struct __pyx_obj_5pysox_3sox_CSignalInfo *__pyx_v_signalInfo = ((struct __pyx_obj_5pysox_3sox_CSignalInfo *)Py_None);
  struct __pyx_obj_5pysox_3sox_CEncodingInfo *__pyx_v_encodingInfo = ((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)Py_None);
  PyObject *__pyx_v_fileType = ((PyObject *)Py_None);
  char *__pyx_v_cpath;
  sox_encodinginfo_t *__pyx_v_encoding;
  sox_signalinfo_t *__pyx_v_signal;
  char *__pyx_v_cfiletype;
  int __pyx_r;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("open_read");
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_signalInfo = __pyx_optional_args->signalInfo;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_encodingInfo = __pyx_optional_args->encodingInfo;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_fileType = __pyx_optional_args->fileType;
        }
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__open_read); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_5pysox_3sox_10CSoxStream_4open_read)) {
      __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __Pyx_INCREF(__pyx_v_path);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_path);
      __Pyx_GIVEREF(__pyx_v_path);
      __Pyx_INCREF(((PyObject *)__pyx_v_signalInfo));
      PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_signalInfo));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_signalInfo));
      __Pyx_INCREF(((PyObject *)__pyx_v_encodingInfo));
      PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_encodingInfo));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_encodingInfo));
      __Pyx_INCREF(__pyx_v_fileType);
      PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_fileType);
      __Pyx_GIVEREF(__pyx_v_fileType);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_4;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pysox/sox.pyx":355
 *             IOError if file not existent
 *         """
 *         cdef char * cpath = NULL             # <<<<<<<<<<<<<<
 *         cdef csox.sox_encodinginfo_t * encoding = NULL
 *         cdef csox.sox_signalinfo_t * signal = NULL
 */
  __pyx_v_cpath = NULL;

  /* "pysox/sox.pyx":356
 *         """
 *         cdef char * cpath = NULL
 *         cdef csox.sox_encodinginfo_t * encoding = NULL             # <<<<<<<<<<<<<<
 *         cdef csox.sox_signalinfo_t * signal = NULL
 *         cdef char * cfiletype = NULL
 */
  __pyx_v_encoding = NULL;

  /* "pysox/sox.pyx":357
 *         cdef char * cpath = NULL
 *         cdef csox.sox_encodinginfo_t * encoding = NULL
 *         cdef csox.sox_signalinfo_t * signal = NULL             # <<<<<<<<<<<<<<
 *         cdef char * cfiletype = NULL
 * 
 */
  __pyx_v_signal = NULL;

  /* "pysox/sox.pyx":358
 *         cdef csox.sox_encodinginfo_t * encoding = NULL
 *         cdef csox.sox_signalinfo_t * signal = NULL
 *         cdef char * cfiletype = NULL             # <<<<<<<<<<<<<<
 * 
 *         cpath = toCharP(path)
 */
  __pyx_v_cfiletype = NULL;

  /* "pysox/sox.pyx":360
 *         cdef char * cfiletype = NULL
 * 
 *         cpath = toCharP(path)             # <<<<<<<<<<<<<<
 * 
 *         if signalInfo:
 */
  __pyx_v_cpath = __pyx_f_5pysox_3sox_toCharP(__pyx_v_path);

  /* "pysox/sox.pyx":362
 *         cpath = toCharP(path)
 * 
 *         if signalInfo:             # <<<<<<<<<<<<<<
 *             signal = signalInfo.cget_signal() #exctract the c struct
 *         if encodingInfo:
 */
  __pyx_t_5 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_signalInfo)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_5) {

    /* "pysox/sox.pyx":363
 * 
 *         if signalInfo:
 *             signal = signalInfo.cget_signal() #exctract the c struct             # <<<<<<<<<<<<<<
 *         if encodingInfo:
 *             encoding = encodingInfo.cget_encoding()
 */
    __pyx_v_signal = ((struct __pyx_vtabstruct_5pysox_3sox_CSignalInfo *)__pyx_v_signalInfo->__pyx_vtab)->cget_signal(__pyx_v_signalInfo);
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pysox/sox.pyx":364
 *         if signalInfo:
 *             signal = signalInfo.cget_signal() #exctract the c struct
 *         if encodingInfo:             # <<<<<<<<<<<<<<
 *             encoding = encodingInfo.cget_encoding()
 *         if fileType:
 */
  __pyx_t_5 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_encodingInfo)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_5) {

    /* "pysox/sox.pyx":365
 *             signal = signalInfo.cget_signal() #exctract the c struct
 *         if encodingInfo:
 *             encoding = encodingInfo.cget_encoding()             # <<<<<<<<<<<<<<
 *         if fileType:
 *             cfiletype = toCharP(fileType)
 */
    __pyx_v_encoding = ((struct __pyx_vtabstruct_5pysox_3sox_CEncodingInfo *)__pyx_v_encodingInfo->__pyx_vtab)->cget_encoding(__pyx_v_encodingInfo);
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pysox/sox.pyx":366
 *         if encodingInfo:
 *             encoding = encodingInfo.cget_encoding()
 *         if fileType:             # <<<<<<<<<<<<<<
 *             cfiletype = toCharP(fileType)
 * 
 */
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_fileType); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_5) {

    /* "pysox/sox.pyx":367
 *             encoding = encodingInfo.cget_encoding()
 *         if fileType:
 *             cfiletype = toCharP(fileType)             # <<<<<<<<<<<<<<
 * 
 *         self.ft = csox.sox_open_read(cpath, signal , encoding,  cfiletype)
 */
    __pyx_v_cfiletype = __pyx_f_5pysox_3sox_toCharP(__pyx_v_fileType);
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pysox/sox.pyx":369
 *             cfiletype = toCharP(fileType)
 * 
 *         self.ft = csox.sox_open_read(cpath, signal , encoding,  cfiletype)             # <<<<<<<<<<<<<<
 *         if not self.ft:
 *             raise IOError("No such file")
 */
  __pyx_v_self->ft = sox_open_read(__pyx_v_cpath, __pyx_v_signal, __pyx_v_encoding, __pyx_v_cfiletype);

  /* "pysox/sox.pyx":370
 * 
 *         self.ft = csox.sox_open_read(cpath, signal , encoding,  cfiletype)
 *         if not self.ft:             # <<<<<<<<<<<<<<
 *             raise IOError("No such file")
 *         return 1
 */
  __pyx_t_5 = (!(__pyx_v_self->ft != 0));
  if (__pyx_t_5) {

    /* "pysox/sox.pyx":371
 *         self.ft = csox.sox_open_read(cpath, signal , encoding,  cfiletype)
 *         if not self.ft:
 *             raise IOError("No such file")             # <<<<<<<<<<<<<<
 *         return 1
 * 
 */
    __pyx_t_1 = PyObject_Call(__pyx_builtin_IOError, ((PyObject *)__pyx_k_tuple_9), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "pysox/sox.pyx":372
 *         if not self.ft:
 *             raise IOError("No such file")
 *         return 1             # <<<<<<<<<<<<<<
 * 
 *     cpdef open_write(self, path, CSignalInfo signalInfo, CEncodingInfo encodingInfo=None, fileType=None):
 */
  __pyx_r = 1;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysox.sox.CSoxStream.open_read");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":346
 *         return nread
 * 
 *     cpdef int open_read(self, path, CSignalInfo signalInfo=None, CEncodingInfo encodingInfo=None, fileType=None) except ?0:             # <<<<<<<<<<<<<<
 *         """
 *         .. method:: open_read(path [, CSignalInfo signalInfo=None] [, CEncodingInfo encodingInfo=None] [, fileType=None])
 */

static PyObject *__pyx_pf_5pysox_3sox_10CSoxStream_4open_read(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pysox_3sox_10CSoxStream_4open_read[] = "\n        .. method:: open_read(path [, CSignalInfo signalInfo=None] [, CEncodingInfo encodingInfo=None] [, fileType=None])\n        \n        open an audio file for reading\n        \n        Raises:\n            IOError if file not existent\n        ";
static PyObject *__pyx_pf_5pysox_3sox_10CSoxStream_4open_read(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_path = 0;
  struct __pyx_obj_5pysox_3sox_CSignalInfo *__pyx_v_signalInfo = 0;
  struct __pyx_obj_5pysox_3sox_CEncodingInfo *__pyx_v_encodingInfo = 0;
  PyObject *__pyx_v_fileType = 0;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  struct __pyx_opt_args_5pysox_3sox_10CSoxStream_open_read __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__path,&__pyx_n_s__signalInfo,&__pyx_n_s__encodingInfo,&__pyx_n_s__fileType,0};
  __Pyx_RefNannySetupContext("open_read");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[4] = {0,0,0,0};
    values[1] = (PyObject *)((struct __pyx_obj_5pysox_3sox_CSignalInfo *)Py_None);
    values[2] = (PyObject *)((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)Py_None);
    values[3] = ((PyObject *)Py_None);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__path);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__signalInfo);
        if (value) { values[1] = value; kw_args--; }
      }
      case  2:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__encodingInfo);
        if (value) { values[2] = value; kw_args--; }
      }
      case  3:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fileType);
        if (value) { values[3] = value; kw_args--; }
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "open_read") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_path = values[0];
    __pyx_v_signalInfo = ((struct __pyx_obj_5pysox_3sox_CSignalInfo *)values[1]);
    __pyx_v_encodingInfo = ((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)values[2]);
    __pyx_v_fileType = values[3];
  } else {
    __pyx_v_signalInfo = ((struct __pyx_obj_5pysox_3sox_CSignalInfo *)Py_None);
    __pyx_v_encodingInfo = ((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)Py_None);
    __pyx_v_fileType = ((PyObject *)Py_None);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  4: __pyx_v_fileType = PyTuple_GET_ITEM(__pyx_args, 3);
      case  3: __pyx_v_encodingInfo = ((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)PyTuple_GET_ITEM(__pyx_args, 2));
      case  2: __pyx_v_signalInfo = ((struct __pyx_obj_5pysox_3sox_CSignalInfo *)PyTuple_GET_ITEM(__pyx_args, 1));
      case  1: __pyx_v_path = PyTuple_GET_ITEM(__pyx_args, 0);
      break;
      default: goto __pyx_L5_argtuple_error;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("open_read", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysox.sox.CSoxStream.open_read");
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_signalInfo), __pyx_ptype_5pysox_3sox_CSignalInfo, 1, "signalInfo", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encodingInfo), __pyx_ptype_5pysox_3sox_CEncodingInfo, 1, "encodingInfo", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 3;
  __pyx_t_2.signalInfo = __pyx_v_signalInfo;
  __pyx_t_2.encodingInfo = __pyx_v_encodingInfo;
  __pyx_t_2.fileType = __pyx_v_fileType;
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pysox_3sox_CSoxStream *)((struct __pyx_obj_5pysox_3sox_CSoxStream *)__pyx_v_self)->__pyx_vtab)->open_read(((struct __pyx_obj_5pysox_3sox_CSoxStream *)__pyx_v_self), __pyx_v_path, 1, &__pyx_t_2); if (unlikely(__pyx_t_1 == 0 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysox.sox.CSoxStream.open_read");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":374
 *         return 1
 * 
 *     cpdef open_write(self, path, CSignalInfo signalInfo, CEncodingInfo encodingInfo=None, fileType=None):             # <<<<<<<<<<<<<<
 *         """
 *         .. method:: open_write(path, CSignalInfo signalInfo [, CEncodingInfo encodingInfo=None] [, fileType=None])
 */

static PyObject *__pyx_pf_5pysox_3sox_10CSoxStream_5open_write(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static  PyObject *__pyx_f_5pysox_3sox_10CSoxStream_open_write(struct __pyx_obj_5pysox_3sox_CSoxStream *__pyx_v_self, PyObject *__pyx_v_path, struct __pyx_obj_5pysox_3sox_CSignalInfo *__pyx_v_signalInfo, int __pyx_skip_dispatch, struct __pyx_opt_args_5pysox_3sox_10CSoxStream_open_write *__pyx_optional_args) {
  struct __pyx_obj_5pysox_3sox_CEncodingInfo *__pyx_v_encodingInfo = ((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)Py_None);
  PyObject *__pyx_v_fileType = ((PyObject *)Py_None);
  char *__pyx_v_cpath;
  sox_signalinfo_t *__pyx_v_signal;
  sox_encodinginfo_t *__pyx_v_encoding;
  char *__pyx_v_cfiletype;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("open_write");
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_encodingInfo = __pyx_optional_args->encodingInfo;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_fileType = __pyx_optional_args->fileType;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__open_write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_5pysox_3sox_10CSoxStream_5open_write)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __Pyx_INCREF(__pyx_v_path);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_path);
      __Pyx_GIVEREF(__pyx_v_path);
      __Pyx_INCREF(((PyObject *)__pyx_v_signalInfo));
      PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_signalInfo));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_signalInfo));
      __Pyx_INCREF(((PyObject *)__pyx_v_encodingInfo));
      PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_encodingInfo));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_encodingInfo));
      __Pyx_INCREF(__pyx_v_fileType);
      PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_fileType);
      __Pyx_GIVEREF(__pyx_v_fileType);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pysox/sox.pyx":396
 * 
 *         """
 *         cdef char * cpath = NULL             # <<<<<<<<<<<<<<
 *         cdef csox.sox_signalinfo_t * signal = NULL
 *         cdef csox.sox_encodinginfo_t  * encoding = NULL
 */
  __pyx_v_cpath = NULL;

  /* "pysox/sox.pyx":397
 *         """
 *         cdef char * cpath = NULL
 *         cdef csox.sox_signalinfo_t * signal = NULL             # <<<<<<<<<<<<<<
 *         cdef csox.sox_encodinginfo_t  * encoding = NULL
 *         cdef char * cfiletype = NULL
 */
  __pyx_v_signal = NULL;

  /* "pysox/sox.pyx":398
 *         cdef char * cpath = NULL
 *         cdef csox.sox_signalinfo_t * signal = NULL
 *         cdef csox.sox_encodinginfo_t  * encoding = NULL             # <<<<<<<<<<<<<<
 *         cdef char * cfiletype = NULL
 * 
 */
  __pyx_v_encoding = NULL;

  /* "pysox/sox.pyx":399
 *         cdef csox.sox_signalinfo_t * signal = NULL
 *         cdef csox.sox_encodinginfo_t  * encoding = NULL
 *         cdef char * cfiletype = NULL             # <<<<<<<<<<<<<<
 * 
 *         if not signalInfo:
 */
  __pyx_v_cfiletype = NULL;

  /* "pysox/sox.pyx":401
 *         cdef char * cfiletype = NULL
 * 
 *         if not signalInfo:             # <<<<<<<<<<<<<<
 *             raise TypeError("signalInfo must be a CSignalInfo instance")
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_signalInfo)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = (!__pyx_t_4);
  if (__pyx_t_5) {

    /* "pysox/sox.pyx":402
 * 
 *         if not signalInfo:
 *             raise TypeError("signalInfo must be a CSignalInfo instance")             # <<<<<<<<<<<<<<
 * 
 *         cpath = toCharP(path)
 */
    __pyx_t_1 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_11), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pysox/sox.pyx":404
 *             raise TypeError("signalInfo must be a CSignalInfo instance")
 * 
 *         cpath = toCharP(path)             # <<<<<<<<<<<<<<
 *         signal = signalInfo.cget_signal() #exctract the c struct
 * 
 */
  __pyx_v_cpath = __pyx_f_5pysox_3sox_toCharP(__pyx_v_path);

  /* "pysox/sox.pyx":405
 * 
 *         cpath = toCharP(path)
 *         signal = signalInfo.cget_signal() #exctract the c struct             # <<<<<<<<<<<<<<
 * 
 *         if encodingInfo:
 */
  __pyx_v_signal = ((struct __pyx_vtabstruct_5pysox_3sox_CSignalInfo *)__pyx_v_signalInfo->__pyx_vtab)->cget_signal(__pyx_v_signalInfo);

  /* "pysox/sox.pyx":407
 *         signal = signalInfo.cget_signal() #exctract the c struct
 * 
 *         if encodingInfo:             # <<<<<<<<<<<<<<
 *             encoding = encodingInfo.cget_encoding()
 * 
 */
  __pyx_t_5 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_encodingInfo)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_5) {

    /* "pysox/sox.pyx":408
 * 
 *         if encodingInfo:
 *             encoding = encodingInfo.cget_encoding()             # <<<<<<<<<<<<<<
 * 
 *         if fileType:
 */
    __pyx_v_encoding = ((struct __pyx_vtabstruct_5pysox_3sox_CEncodingInfo *)__pyx_v_encodingInfo->__pyx_vtab)->cget_encoding(__pyx_v_encodingInfo);
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pysox/sox.pyx":410
 *             encoding = encodingInfo.cget_encoding()
 * 
 *         if fileType:             # <<<<<<<<<<<<<<
 *             cfiletype = toCharP(fileType)
 * 
 */
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_fileType); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_5) {

    /* "pysox/sox.pyx":411
 * 
 *         if fileType:
 *             cfiletype = toCharP(fileType)             # <<<<<<<<<<<<<<
 * 
 *         self.ft = csox.sox_open_write(cpath, signal, encoding, cfiletype, NULL, NULL)
 */
    __pyx_v_cfiletype = __pyx_f_5pysox_3sox_toCharP(__pyx_v_fileType);
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pysox/sox.pyx":413
 *             cfiletype = toCharP(fileType)
 * 
 *         self.ft = csox.sox_open_write(cpath, signal, encoding, cfiletype, NULL, NULL)             # <<<<<<<<<<<<<<
 *         if not self.ft:
 *             raise IOError("No such file")
 */
  __pyx_v_self->ft = sox_open_write(__pyx_v_cpath, __pyx_v_signal, __pyx_v_encoding, __pyx_v_cfiletype, NULL, NULL);

  /* "pysox/sox.pyx":414
 * 
 *         self.ft = csox.sox_open_write(cpath, signal, encoding, cfiletype, NULL, NULL)
 *         if not self.ft:             # <<<<<<<<<<<<<<
 *             raise IOError("No such file")
 * 
 */
  __pyx_t_5 = (!(__pyx_v_self->ft != 0));
  if (__pyx_t_5) {

    /* "pysox/sox.pyx":415
 *         self.ft = csox.sox_open_write(cpath, signal, encoding, cfiletype, NULL, NULL)
 *         if not self.ft:
 *             raise IOError("No such file")             # <<<<<<<<<<<<<<
 * 
 *     def close(self):
 */
    __pyx_t_1 = PyObject_Call(__pyx_builtin_IOError, ((PyObject *)__pyx_k_tuple_12), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysox.sox.CSoxStream.open_write");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":374
 *         return 1
 * 
 *     cpdef open_write(self, path, CSignalInfo signalInfo, CEncodingInfo encodingInfo=None, fileType=None):             # <<<<<<<<<<<<<<
 *         """
 *         .. method:: open_write(path, CSignalInfo signalInfo [, CEncodingInfo encodingInfo=None] [, fileType=None])
 */

static PyObject *__pyx_pf_5pysox_3sox_10CSoxStream_5open_write(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pysox_3sox_10CSoxStream_5open_write[] = "\n        .. method:: open_write(path, CSignalInfo signalInfo [, CEncodingInfo encodingInfo=None] [, fileType=None])\n\n        Open this stream for writing\n        \n        Args:\n            path\n            \n            signalInfo\n        \n        Kwargs:\n            encodingInfo\n            \n            fileType\n            \n        Raises:\n            TypeError if signalInfo is missing\n            \n            IOError if the file cannot be opened\n\n        ";
static PyObject *__pyx_pf_5pysox_3sox_10CSoxStream_5open_write(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_path = 0;
  struct __pyx_obj_5pysox_3sox_CSignalInfo *__pyx_v_signalInfo = 0;
  struct __pyx_obj_5pysox_3sox_CEncodingInfo *__pyx_v_encodingInfo = 0;
  PyObject *__pyx_v_fileType = 0;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_5pysox_3sox_10CSoxStream_open_write __pyx_t_2;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__path,&__pyx_n_s__signalInfo,&__pyx_n_s__encodingInfo,&__pyx_n_s__fileType,0};
  __Pyx_RefNannySetupContext("open_write");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[4] = {0,0,0,0};
    values[2] = (PyObject *)((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)Py_None);
    values[3] = ((PyObject *)Py_None);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__path);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__signalInfo);
      if (likely(values[1])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("open_write", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
      case  2:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__encodingInfo);
        if (value) { values[2] = value; kw_args--; }
      }
      case  3:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fileType);
        if (value) { values[3] = value; kw_args--; }
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "open_write") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_path = values[0];
    __pyx_v_signalInfo = ((struct __pyx_obj_5pysox_3sox_CSignalInfo *)values[1]);
    __pyx_v_encodingInfo = ((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)values[2]);
    __pyx_v_fileType = values[3];
  } else {
    __pyx_v_encodingInfo = ((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)Py_None);
    __pyx_v_fileType = ((PyObject *)Py_None);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  4:
      __pyx_v_fileType = PyTuple_GET_ITEM(__pyx_args, 3);
      case  3:
      __pyx_v_encodingInfo = ((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)PyTuple_GET_ITEM(__pyx_args, 2));
      case  2:
      __pyx_v_signalInfo = ((struct __pyx_obj_5pysox_3sox_CSignalInfo *)PyTuple_GET_ITEM(__pyx_args, 1));
      __pyx_v_path = PyTuple_GET_ITEM(__pyx_args, 0);
      break;
      default: goto __pyx_L5_argtuple_error;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("open_write", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysox.sox.CSoxStream.open_write");
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_signalInfo), __pyx_ptype_5pysox_3sox_CSignalInfo, 1, "signalInfo", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encodingInfo), __pyx_ptype_5pysox_3sox_CEncodingInfo, 1, "encodingInfo", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.encodingInfo = __pyx_v_encodingInfo;
  __pyx_t_2.fileType = __pyx_v_fileType;
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pysox_3sox_CSoxStream *)((struct __pyx_obj_5pysox_3sox_CSoxStream *)__pyx_v_self)->__pyx_vtab)->open_write(((struct __pyx_obj_5pysox_3sox_CSoxStream *)__pyx_v_self), __pyx_v_path, __pyx_v_signalInfo, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysox.sox.CSoxStream.open_write");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":417
 *             raise IOError("No such file")
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         """Close the stream"""
 *         if self.ft:
 */

static PyObject *__pyx_pf_5pysox_3sox_10CSoxStream_6close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pysox_3sox_10CSoxStream_6close[] = "Close the stream";
static PyObject *__pyx_pf_5pysox_3sox_10CSoxStream_6close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("close");

  /* "pysox/sox.pyx":419
 *     def close(self):
 *         """Close the stream"""
 *         if self.ft:             # <<<<<<<<<<<<<<
 *             csox.sox_close(self.ft)
 *             self.ft = NULL
 */
  __pyx_t_1 = (((struct __pyx_obj_5pysox_3sox_CSoxStream *)__pyx_v_self)->ft != 0);
  if (__pyx_t_1) {

    /* "pysox/sox.pyx":420
 *         """Close the stream"""
 *         if self.ft:
 *             csox.sox_close(self.ft)             # <<<<<<<<<<<<<<
 *             self.ft = NULL
 * 
 */
    sox_close(((struct __pyx_obj_5pysox_3sox_CSoxStream *)__pyx_v_self)->ft);

    /* "pysox/sox.pyx":421
 *         if self.ft:
 *             csox.sox_close(self.ft)
 *             self.ft = NULL             # <<<<<<<<<<<<<<
 * 
 *     def get_signal(self):
 */
    ((struct __pyx_obj_5pysox_3sox_CSoxStream *)__pyx_v_self)->ft = NULL;
    goto __pyx_L5;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":423
 *             self.ft = NULL
 * 
 *     def get_signal(self):             # <<<<<<<<<<<<<<
 *         """retrieve the CSignalInfo object representation of this streams signal
 * 
 */

static PyObject *__pyx_pf_5pysox_3sox_10CSoxStream_7get_signal(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pysox_3sox_10CSoxStream_7get_signal[] = "retrieve the CSignalInfo object representation of this streams signal\n        \n        Changes to the signal's parameter will change the stream's parameters, too";
static PyObject *__pyx_pf_5pysox_3sox_10CSoxStream_7get_signal(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  struct __pyx_obj_5pysox_3sox_CSignalInfo *__pyx_v_si;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("get_signal");
  __pyx_v_si = ((struct __pyx_obj_5pysox_3sox_CSignalInfo *)Py_None); __Pyx_INCREF(Py_None);

  /* "pysox/sox.pyx":427
 * 
 *         Changes to the signal's parameter will change the stream's parameters, too"""
 *         if not self.ft:             # <<<<<<<<<<<<<<
 *             return None
 *         si = CSignalInfo()
 */
  __pyx_t_1 = (!(((struct __pyx_obj_5pysox_3sox_CSoxStream *)__pyx_v_self)->ft != 0));
  if (__pyx_t_1) {

    /* "pysox/sox.pyx":428
 *         Changes to the signal's parameter will change the stream's parameters, too"""
 *         if not self.ft:
 *             return None             # <<<<<<<<<<<<<<
 *         si = CSignalInfo()
 *         si.cset_signal(&self.ft.signal)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pysox/sox.pyx":429
 *         if not self.ft:
 *             return None
 *         si = CSignalInfo()             # <<<<<<<<<<<<<<
 *         si.cset_signal(&self.ft.signal)
 *         return si
 */
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pysox_3sox_CSignalInfo)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_v_si));
  __pyx_v_si = ((struct __pyx_obj_5pysox_3sox_CSignalInfo *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pysox/sox.pyx":430
 *             return None
 *         si = CSignalInfo()
 *         si.cset_signal(&self.ft.signal)             # <<<<<<<<<<<<<<
 *         return si
 *     cdef csox.sox_signalinfo_t * cget_signal(self):
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_5pysox_3sox_CSignalInfo *)__pyx_v_si->__pyx_vtab)->cset_signal(__pyx_v_si, (&((struct __pyx_obj_5pysox_3sox_CSoxStream *)__pyx_v_self)->ft->signal)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pysox/sox.pyx":431
 *         si = CSignalInfo()
 *         si.cset_signal(&self.ft.signal)
 *         return si             # <<<<<<<<<<<<<<
 *     cdef csox.sox_signalinfo_t * cget_signal(self):
 *         return &self.ft.signal
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_si));
  __pyx_r = ((PyObject *)__pyx_v_si);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysox.sox.CSoxStream.get_signal");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_si);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":432
 *         si.cset_signal(&self.ft.signal)
 *         return si
 *     cdef csox.sox_signalinfo_t * cget_signal(self):             # <<<<<<<<<<<<<<
 *         return &self.ft.signal
 * 
 */

static  sox_signalinfo_t *__pyx_f_5pysox_3sox_10CSoxStream_cget_signal(struct __pyx_obj_5pysox_3sox_CSoxStream *__pyx_v_self) {
  sox_signalinfo_t *__pyx_r;
  __Pyx_RefNannySetupContext("cget_signal");

  /* "pysox/sox.pyx":433
 *         return si
 *     cdef csox.sox_signalinfo_t * cget_signal(self):
 *         return &self.ft.signal             # <<<<<<<<<<<<<<
 * 
 *     def get_encoding(self):
 */
  __pyx_r = (&__pyx_v_self->ft->signal);
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":435
 *         return &self.ft.signal
 * 
 *     def get_encoding(self):             # <<<<<<<<<<<<<<
 *         """retrieve the CEncodingInfo object representation of this streams encoding
 * 
 */

static PyObject *__pyx_pf_5pysox_3sox_10CSoxStream_8get_encoding(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pysox_3sox_10CSoxStream_8get_encoding[] = "retrieve the CEncodingInfo object representation of this streams encoding\n        \n        Changes to the encoding's parameters will change the stream's encoding, too";
static PyObject *__pyx_pf_5pysox_3sox_10CSoxStream_8get_encoding(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  struct __pyx_obj_5pysox_3sox_CEncodingInfo *__pyx_v_si;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("get_encoding");
  __pyx_v_si = ((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)Py_None); __Pyx_INCREF(Py_None);

  /* "pysox/sox.pyx":439
 * 
 *         Changes to the encoding's parameters will change the stream's encoding, too"""
 *         if not self.ft:             # <<<<<<<<<<<<<<
 *             return None
 *         si = CEncodingInfo()
 */
  __pyx_t_1 = (!(((struct __pyx_obj_5pysox_3sox_CSoxStream *)__pyx_v_self)->ft != 0));
  if (__pyx_t_1) {

    /* "pysox/sox.pyx":440
 *         Changes to the encoding's parameters will change the stream's encoding, too"""
 *         if not self.ft:
 *             return None             # <<<<<<<<<<<<<<
 *         si = CEncodingInfo()
 *         si.cset_encoding(&self.ft.encoding)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pysox/sox.pyx":441
 *         if not self.ft:
 *             return None
 *         si = CEncodingInfo()             # <<<<<<<<<<<<<<
 *         si.cset_encoding(&self.ft.encoding)
 *         return si
 */
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pysox_3sox_CEncodingInfo)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_v_si));
  __pyx_v_si = ((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pysox/sox.pyx":442
 *             return None
 *         si = CEncodingInfo()
 *         si.cset_encoding(&self.ft.encoding)             # <<<<<<<<<<<<<<
 *         return si
 *     cdef csox.sox_encodinginfo_t * cget_encoding(self):
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_5pysox_3sox_CEncodingInfo *)__pyx_v_si->__pyx_vtab)->cset_encoding(__pyx_v_si, (&((struct __pyx_obj_5pysox_3sox_CSoxStream *)__pyx_v_self)->ft->encoding)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pysox/sox.pyx":443
 *         si = CEncodingInfo()
 *         si.cset_encoding(&self.ft.encoding)
 *         return si             # <<<<<<<<<<<<<<
 *     cdef csox.sox_encodinginfo_t * cget_encoding(self):
 *         return &self.ft.encoding
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_si));
  __pyx_r = ((PyObject *)__pyx_v_si);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysox.sox.CSoxStream.get_encoding");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_si);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":444
 *         si.cset_encoding(&self.ft.encoding)
 *         return si
 *     cdef csox.sox_encodinginfo_t * cget_encoding(self):             # <<<<<<<<<<<<<<
 *         return &self.ft.encoding
 * 
 */

static  sox_encodinginfo_t *__pyx_f_5pysox_3sox_10CSoxStream_cget_encoding(struct __pyx_obj_5pysox_3sox_CSoxStream *__pyx_v_self) {
  sox_encodinginfo_t *__pyx_r;
  __Pyx_RefNannySetupContext("cget_encoding");

  /* "pysox/sox.pyx":445
 *         return si
 *     cdef csox.sox_encodinginfo_t * cget_encoding(self):
 *         return &self.ft.encoding             # <<<<<<<<<<<<<<
 * 
 * ################################################################################################
 */
  __pyx_r = (&__pyx_v_self->ft->encoding);
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":460
 * #    cdef object initialdata
 * 
 *     def __init__(self, path=None, mode=None, CSignalInfo signalInfo=None, CEncodingInfo encodingInfo=None, fileType=None):             # <<<<<<<<<<<<<<
 *         #NOT calling __parent__.__init__(self)
 *         self.channel = path
 */

static int __pyx_pf_5pysox_3sox_16CPysoxPipeStream___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_5pysox_3sox_16CPysoxPipeStream___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_mode = 0;
  struct __pyx_obj_5pysox_3sox_CSignalInfo *__pyx_v_signalInfo = 0;
  struct __pyx_obj_5pysox_3sox_CEncodingInfo *__pyx_v_encodingInfo = 0;
  PyObject *__pyx_v_fileType = 0;
  int __pyx_r;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__path,&__pyx_n_s__mode,&__pyx_n_s__signalInfo,&__pyx_n_s__encodingInfo,&__pyx_n_s__fileType,0};
  __Pyx_RefNannySetupContext("__init__");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[5] = {0,0,0,0,0};
    values[0] = ((PyObject *)Py_None);
    values[1] = ((PyObject *)Py_None);
    values[2] = (PyObject *)((struct __pyx_obj_5pysox_3sox_CSignalInfo *)Py_None);
    values[3] = (PyObject *)((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)Py_None);
    values[4] = ((PyObject *)Py_None);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__path);
        if (value) { values[0] = value; kw_args--; }
      }
      case  1:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__mode);
        if (value) { values[1] = value; kw_args--; }
      }
      case  2:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__signalInfo);
        if (value) { values[2] = value; kw_args--; }
      }
      case  3:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__encodingInfo);
        if (value) { values[3] = value; kw_args--; }
      }
      case  4:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fileType);
        if (value) { values[4] = value; kw_args--; }
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_path = values[0];
    __pyx_v_mode = values[1];
    __pyx_v_signalInfo = ((struct __pyx_obj_5pysox_3sox_CSignalInfo *)values[2]);
    __pyx_v_encodingInfo = ((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)values[3]);
    __pyx_v_fileType = values[4];
  } else {
    __pyx_v_path = ((PyObject *)Py_None);
    __pyx_v_mode = ((PyObject *)Py_None);
    __pyx_v_signalInfo = ((struct __pyx_obj_5pysox_3sox_CSignalInfo *)Py_None);
    __pyx_v_encodingInfo = ((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)Py_None);
    __pyx_v_fileType = ((PyObject *)Py_None);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  5: __pyx_v_fileType = PyTuple_GET_ITEM(__pyx_args, 4);
      case  4: __pyx_v_encodingInfo = ((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)PyTuple_GET_ITEM(__pyx_args, 3));
      case  3: __pyx_v_signalInfo = ((struct __pyx_obj_5pysox_3sox_CSignalInfo *)PyTuple_GET_ITEM(__pyx_args, 2));
      case  2: __pyx_v_mode = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: __pyx_v_path = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysox.sox.CPysoxPipeStream.__init__");
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_signalInfo), __pyx_ptype_5pysox_3sox_CSignalInfo, 1, "signalInfo", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encodingInfo), __pyx_ptype_5pysox_3sox_CEncodingInfo, 1, "encodingInfo", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pysox/sox.pyx":462
 *     def __init__(self, path=None, mode=None, CSignalInfo signalInfo=None, CEncodingInfo encodingInfo=None, fileType=None):
 *         #NOT calling __parent__.__init__(self)
 *         self.channel = path             # <<<<<<<<<<<<<<
 *         self.initialdata = None
 * 
 */
  __Pyx_INCREF(__pyx_v_path);
  __Pyx_GIVEREF(__pyx_v_path);
  __Pyx_GOTREF(((struct __pyx_obj_5pysox_3sox_CPysoxPipeStream *)__pyx_v_self)->channel);
  __Pyx_DECREF(((struct __pyx_obj_5pysox_3sox_CPysoxPipeStream *)__pyx_v_self)->channel);
  ((struct __pyx_obj_5pysox_3sox_CPysoxPipeStream *)__pyx_v_self)->channel = __pyx_v_path;

  /* "pysox/sox.pyx":463
 *         #NOT calling __parent__.__init__(self)
 *         self.channel = path
 *         self.initialdata = None             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(((struct __pyx_obj_5pysox_3sox_CPysoxPipeStream *)__pyx_v_self)->initialdata);
  __Pyx_DECREF(((struct __pyx_obj_5pysox_3sox_CPysoxPipeStream *)__pyx_v_self)->initialdata);
  ((struct __pyx_obj_5pysox_3sox_CPysoxPipeStream *)__pyx_v_self)->initialdata = Py_None;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysox.sox.CPysoxPipeStream.__init__");
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":465
 *         self.initialdata = None
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         if not self.channel:
 *             return u''
 */

static PyObject *__pyx_pf_5pysox_3sox_16CPysoxPipeStream_1__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_5pysox_3sox_16CPysoxPipeStream_1__str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__str__");

  /* "pysox/sox.pyx":466
 * 
 *     def __str__(self):
 *         if not self.channel:             # <<<<<<<<<<<<<<
 *             return u''
 *         return str(self.channel)
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(((struct __pyx_obj_5pysox_3sox_CPysoxPipeStream *)__pyx_v_self)->channel); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = (!__pyx_t_1);
  if (__pyx_t_2) {

    /* "pysox/sox.pyx":467
 *     def __str__(self):
 *         if not self.channel:
 *             return u''             # <<<<<<<<<<<<<<
 *         return str(self.channel)
 *     def __repr__(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_kp_u_5));
    __pyx_r = ((PyObject *)__pyx_kp_u_5);
    goto __pyx_L0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pysox/sox.pyx":468
 *         if not self.channel:
 *             return u''
 *         return str(self.channel)             # <<<<<<<<<<<<<<
 *     def __repr__(self):
 *         if not self.channel:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_INCREF(((struct __pyx_obj_5pysox_3sox_CPysoxPipeStream *)__pyx_v_self)->channel);
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((struct __pyx_obj_5pysox_3sox_CPysoxPipeStream *)__pyx_v_self)->channel);
  __Pyx_GIVEREF(((struct __pyx_obj_5pysox_3sox_CPysoxPipeStream *)__pyx_v_self)->channel);
  __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pysox.sox.CPysoxPipeStream.__str__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":469
 *             return u''
 *         return str(self.channel)
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if not self.channel:
 *             return u'CPysoxPipeStream()'
 */

static PyObject *__pyx_pf_5pysox_3sox_16CPysoxPipeStream_2__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_5pysox_3sox_16CPysoxPipeStream_2__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__repr__");

  /* "pysox/sox.pyx":470
 *         return str(self.channel)
 *     def __repr__(self):
 *         if not self.channel:             # <<<<<<<<<<<<<<
 *             return u'CPysoxPipeStream()'
 *         return u'CPysoxPipeStream(%s)' %(str(self.channel))
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(((struct __pyx_obj_5pysox_3sox_CPysoxPipeStream *)__pyx_v_self)->channel); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = (!__pyx_t_1);
  if (__pyx_t_2) {

    /* "pysox/sox.pyx":471
 *     def __repr__(self):
 *         if not self.channel:
 *             return u'CPysoxPipeStream()'             # <<<<<<<<<<<<<<
 *         return u'CPysoxPipeStream(%s)' %(str(self.channel))
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_kp_u_13));
    __pyx_r = ((PyObject *)__pyx_kp_u_13);
    goto __pyx_L0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pysox/sox.pyx":472
 *         if not self.channel:
 *             return u'CPysoxPipeStream()'
 *         return u'CPysoxPipeStream(%s)' %(str(self.channel))             # <<<<<<<<<<<<<<
 * 
 *     cdef int sox_read(self, csox.sox_sample_t * obuf, size_t max):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_INCREF(((struct __pyx_obj_5pysox_3sox_CPysoxPipeStream *)__pyx_v_self)->channel);
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((struct __pyx_obj_5pysox_3sox_CPysoxPipeStream *)__pyx_v_self)->channel);
  __Pyx_GIVEREF(((struct __pyx_obj_5pysox_3sox_CPysoxPipeStream *)__pyx_v_self)->channel);
  __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_14), __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = ((PyObject *)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pysox.sox.CPysoxPipeStream.__repr__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":474
 *         return u'CPysoxPipeStream(%s)' %(str(self.channel))
 * 
 *     cdef int sox_read(self, csox.sox_sample_t * obuf, size_t max):             # <<<<<<<<<<<<<<
 *         raise RuntimeError('CPysoxPipeStream::sox_read not implemented')
 *         return 0
 */

static  int __pyx_f_5pysox_3sox_16CPysoxPipeStream_sox_read(struct __pyx_obj_5pysox_3sox_CPysoxPipeStream *__pyx_v_self, __pyx_t_5pysox_4csox_sox_sample_t *__pyx_v_obuf, size_t __pyx_v_max) {
  int __pyx_r;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("sox_read");

  /* "pysox/sox.pyx":475
 * 
 *     cdef int sox_read(self, csox.sox_sample_t * obuf, size_t max):
 *         raise RuntimeError('CPysoxPipeStream::sox_read not implemented')             # <<<<<<<<<<<<<<
 *         return 0
 * 
 */
  __pyx_t_1 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_16), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pysox/sox.pyx":476
 *     cdef int sox_read(self, csox.sox_sample_t * obuf, size_t max):
 *         raise RuntimeError('CPysoxPipeStream::sox_read not implemented')
 *         return 0             # <<<<<<<<<<<<<<
 * 
 *     cdef int sox_read_wide(self, csox.sox_sample_t * obuf, size_t max):
 */
  __pyx_r = 0;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("pysox.sox.CPysoxPipeStream.sox_read");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":478
 *         return 0
 * 
 *     cdef int sox_read_wide(self, csox.sox_sample_t * obuf, size_t max):             # <<<<<<<<<<<<<<
 *         """public size_t sox_read_wide(csox.sox_sample_t * obuf, size_t max)
 * 
 */

static  int __pyx_f_5pysox_3sox_16CPysoxPipeStream_sox_read_wide(struct __pyx_obj_5pysox_3sox_CPysoxPipeStream *__pyx_v_self, __pyx_t_5pysox_4csox_sox_sample_t *__pyx_v_obuf, size_t __pyx_v_max) {
  PyObject *__pyx_v_data;
  char *__pyx_v_cdata;
  size_t __pyx_v_length;
  int __pyx_r;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  char *__pyx_t_9;
  size_t __pyx_t_10;
  size_t __pyx_t_11;
  __Pyx_RefNannySetupContext("sox_read_wide");
  __pyx_v_data = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);

  /* "pysox/sox.pyx":486
 *         cdef bytes data
 *         cdef char * cdata
 *         cdef size_t length=0             # <<<<<<<<<<<<<<
 *         print('ZZZZZZZZZZ',self,'sox_read_wide',max)
 *         try:
 */
  __pyx_v_length = 0;

  /* "pysox/sox.pyx":487
 *         cdef char * cdata
 *         cdef size_t length=0
 *         print('ZZZZZZZZZZ',self,'sox_read_wide',max)             # <<<<<<<<<<<<<<
 *         try:
 *             data = self.channel.recv_bytes()
 */
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_max); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__ZZZZZZZZZZ));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_n_s__ZZZZZZZZZZ));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ZZZZZZZZZZ));
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__sox_read_wide));
  PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_n_s__sox_read_wide));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__sox_read_wide));
  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  if (__Pyx_PrintOne(0, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;

  /* "pysox/sox.pyx":488
 *         cdef size_t length=0
 *         print('ZZZZZZZZZZ',self,'sox_read_wide',max)
 *         try:             # <<<<<<<<<<<<<<
 *             data = self.channel.recv_bytes()
 *         except EOFError:
 */
  {
    PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
    __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
    __Pyx_XGOTREF(__pyx_save_exc_type);
    __Pyx_XGOTREF(__pyx_save_exc_value);
    __Pyx_XGOTREF(__pyx_save_exc_tb);
    /*try:*/ {

      /* "pysox/sox.pyx":489
 *         print('ZZZZZZZZZZ',self,'sox_read_wide',max)
 *         try:
 *             data = self.channel.recv_bytes()             # <<<<<<<<<<<<<<
 *         except EOFError:
 *             print('CPySoxPipeStream EOF')
 */
      __pyx_t_2 = PyObject_GetAttr(__pyx_v_self->channel, __pyx_n_s__recv_bytes); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_DECREF(((PyObject *)__pyx_v_data));
      __pyx_v_data = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;
    }
    __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
    __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
    __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
    goto __pyx_L10_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pysox/sox.pyx":490
 *         try:
 *             data = self.channel.recv_bytes()
 *         except EOFError:             # <<<<<<<<<<<<<<
 *             print('CPySoxPipeStream EOF')
 *             return 0
 */
    __pyx_t_3 = PyErr_ExceptionMatches(__pyx_builtin_EOFError);
    if (__pyx_t_3) {
      __Pyx_AddTraceback("pysox.sox.CPysoxPipeStream.sox_read_wide");
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_4);

      /* "pysox/sox.pyx":491
 *             data = self.channel.recv_bytes()
 *         except EOFError:
 *             print('CPySoxPipeStream EOF')             # <<<<<<<<<<<<<<
 *             return 0
 *         length = len(data)
 */
      if (__Pyx_PrintOne(0, ((PyObject *)__pyx_kp_s_17)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}

      /* "pysox/sox.pyx":492
 *         except EOFError:
 *             print('CPySoxPipeStream EOF')
 *             return 0             # <<<<<<<<<<<<<<
 *         length = len(data)
 * ##            print("MixSockets::drain td",type(data), length, data)
 */
      __pyx_r = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L6_except_return;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L4_exception_handled;
    }
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_save_exc_type);
    __Pyx_XGIVEREF(__pyx_save_exc_value);
    __Pyx_XGIVEREF(__pyx_save_exc_tb);
    __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
    goto __pyx_L1_error;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_save_exc_type);
    __Pyx_XGIVEREF(__pyx_save_exc_value);
    __Pyx_XGIVEREF(__pyx_save_exc_tb);
    __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
    goto __pyx_L0;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_save_exc_type);
    __Pyx_XGIVEREF(__pyx_save_exc_value);
    __Pyx_XGIVEREF(__pyx_save_exc_tb);
    __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
    __pyx_L10_try_end:;
  }

  /* "pysox/sox.pyx":493
 *             print('CPySoxPipeStream EOF')
 *             return 0
 *         length = len(data)             # <<<<<<<<<<<<<<
 * ##            print("MixSockets::drain td",type(data), length, data)
 *         if not data or not length:
 */
  if (unlikely(__pyx_v_data == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
  }
  __pyx_t_5 = PyBytes_GET_SIZE(((PyObject *)__pyx_v_data)); 
  __pyx_v_length = __pyx_t_5;

  /* "pysox/sox.pyx":495
 *         length = len(data)
 * ##            print("MixSockets::drain td",type(data), length, data)
 *         if not data or not length:             # <<<<<<<<<<<<<<
 *             print("IEffr data is None, channel is finished", self)
 *         else:
 */
  __pyx_t_6 = (((PyObject *)__pyx_v_data) != Py_None) && (PyBytes_GET_SIZE(((PyObject *)__pyx_v_data)) != 0);
  __pyx_t_7 = (!__pyx_t_6);
  if (!__pyx_t_7) {
    __pyx_t_6 = (!__pyx_v_length);
    __pyx_t_8 = __pyx_t_6;
  } else {
    __pyx_t_8 = __pyx_t_7;
  }
  if (__pyx_t_8) {

    /* "pysox/sox.pyx":496
 * ##            print("MixSockets::drain td",type(data), length, data)
 *         if not data or not length:
 *             print("IEffr data is None, channel is finished", self)             # <<<<<<<<<<<<<<
 *         else:
 *             cdata = data #cast to char
 */
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_18));
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_s_18));
    __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_18));
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    if (__Pyx_PrintOne(0, ((PyObject *)__pyx_t_4)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    goto __pyx_L13;
  }
  /*else*/ {

    /* "pysox/sox.pyx":498
 *             print("IEffr data is None, channel is finished", self)
 *         else:
 *             cdata = data #cast to char             # <<<<<<<<<<<<<<
 *             csox.bcopy(cdata, obuf, length); #FIXME: return max samples at most!
 *             return length / sizeof(csox.sox_sample_t) / self.ft.signal.channels #wide
 */
    __pyx_t_9 = PyBytes_AsString(((PyObject *)__pyx_v_data)); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_cdata = __pyx_t_9;

    /* "pysox/sox.pyx":499
 *         else:
 *             cdata = data #cast to char
 *             csox.bcopy(cdata, obuf, length); #FIXME: return max samples at most!             # <<<<<<<<<<<<<<
 *             return length / sizeof(csox.sox_sample_t) / self.ft.signal.channels #wide
 *         return 0
 */
    bcopy(__pyx_v_cdata, __pyx_v_obuf, __pyx_v_length);

    /* "pysox/sox.pyx":500
 *             cdata = data #cast to char
 *             csox.bcopy(cdata, obuf, length); #FIXME: return max samples at most!
 *             return length / sizeof(csox.sox_sample_t) / self.ft.signal.channels #wide             # <<<<<<<<<<<<<<
 *         return 0
 * 
 */
    __pyx_t_10 = (sizeof(__pyx_t_5pysox_4csox_sox_sample_t));
    if (unlikely(__pyx_t_10 == 0)) {
      PyErr_Format(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_11 = (__pyx_v_length / __pyx_t_10);
    if (unlikely(__pyx_v_self->__pyx_base.ft->signal.channels == 0)) {
      PyErr_Format(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_r = (__pyx_t_11 / __pyx_v_self->__pyx_base.ft->signal.channels);
    goto __pyx_L0;
  }
  __pyx_L13:;

  /* "pysox/sox.pyx":501
 *             csox.bcopy(cdata, obuf, length); #FIXME: return max samples at most!
 *             return length / sizeof(csox.sox_sample_t) / self.ft.signal.channels #wide
 *         return 0             # <<<<<<<<<<<<<<
 * 
 *     cpdef int open_read(self, path, CSignalInfo signalInfo=None, CEncodingInfo encodingInfo=None, fileType=None) except ?0:
 */
  __pyx_r = 0;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("pysox.sox.CPysoxPipeStream.sox_read_wide");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_data);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":503
 *         return 0
 * 
 *     cpdef int open_read(self, path, CSignalInfo signalInfo=None, CEncodingInfo encodingInfo=None, fileType=None) except ?0:             # <<<<<<<<<<<<<<
 *         print(self,'open_read')
 *         return 0
 */

static PyObject *__pyx_pf_5pysox_3sox_16CPysoxPipeStream_3open_read(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static  int __pyx_f_5pysox_3sox_16CPysoxPipeStream_open_read(struct __pyx_obj_5pysox_3sox_CPysoxPipeStream *__pyx_v_self, PyObject *__pyx_v_path, int __pyx_skip_dispatch, struct __pyx_opt_args_5pysox_3sox_16CPysoxPipeStream_open_read *__pyx_optional_args) {
  struct __pyx_obj_5pysox_3sox_CSignalInfo *__pyx_v_signalInfo = ((struct __pyx_obj_5pysox_3sox_CSignalInfo *)Py_None);
  struct __pyx_obj_5pysox_3sox_CEncodingInfo *__pyx_v_encodingInfo = ((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)Py_None);
  PyObject *__pyx_v_fileType = ((PyObject *)Py_None);
  int __pyx_r;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("open_read");
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_signalInfo = __pyx_optional_args->signalInfo;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_encodingInfo = __pyx_optional_args->encodingInfo;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_fileType = __pyx_optional_args->fileType;
        }
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__open_read); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_5pysox_3sox_16CPysoxPipeStream_3open_read)) {
      __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __Pyx_INCREF(__pyx_v_path);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_path);
      __Pyx_GIVEREF(__pyx_v_path);
      __Pyx_INCREF(((PyObject *)__pyx_v_signalInfo));
      PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_signalInfo));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_signalInfo));
      __Pyx_INCREF(((PyObject *)__pyx_v_encodingInfo));
      PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_encodingInfo));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_encodingInfo));
      __Pyx_INCREF(__pyx_v_fileType);
      PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_fileType);
      __Pyx_GIVEREF(__pyx_v_fileType);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_4;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pysox/sox.pyx":504
 * 
 *     cpdef int open_read(self, path, CSignalInfo signalInfo=None, CEncodingInfo encodingInfo=None, fileType=None) except ?0:
 *         print(self,'open_read')             # <<<<<<<<<<<<<<
 *         return 0
 * 
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__open_read));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_n_s__open_read));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__open_read));
  if (__Pyx_PrintOne(0, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

  /* "pysox/sox.pyx":505
 *     cpdef int open_read(self, path, CSignalInfo signalInfo=None, CEncodingInfo encodingInfo=None, fileType=None) except ?0:
 *         print(self,'open_read')
 *         return 0             # <<<<<<<<<<<<<<
 * 
 *     cpdef open_write(self, path, CSignalInfo signalInfo, CEncodingInfo encodingInfo=None, fileType=None):
 */
  __pyx_r = 0;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysox.sox.CPysoxPipeStream.open_read");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":503
 *         return 0
 * 
 *     cpdef int open_read(self, path, CSignalInfo signalInfo=None, CEncodingInfo encodingInfo=None, fileType=None) except ?0:             # <<<<<<<<<<<<<<
 *         print(self,'open_read')
 *         return 0
 */

static PyObject *__pyx_pf_5pysox_3sox_16CPysoxPipeStream_3open_read(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_5pysox_3sox_16CPysoxPipeStream_3open_read(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_path = 0;
  struct __pyx_obj_5pysox_3sox_CSignalInfo *__pyx_v_signalInfo = 0;
  struct __pyx_obj_5pysox_3sox_CEncodingInfo *__pyx_v_encodingInfo = 0;
  PyObject *__pyx_v_fileType = 0;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  struct __pyx_opt_args_5pysox_3sox_10CSoxStream_open_read __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__path,&__pyx_n_s__signalInfo,&__pyx_n_s__encodingInfo,&__pyx_n_s__fileType,0};
  __Pyx_RefNannySetupContext("open_read");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[4] = {0,0,0,0};
    values[1] = (PyObject *)((struct __pyx_obj_5pysox_3sox_CSignalInfo *)Py_None);
    values[2] = (PyObject *)((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)Py_None);
    values[3] = ((PyObject *)Py_None);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__path);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__signalInfo);
        if (value) { values[1] = value; kw_args--; }
      }
      case  2:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__encodingInfo);
        if (value) { values[2] = value; kw_args--; }
      }
      case  3:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fileType);
        if (value) { values[3] = value; kw_args--; }
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "open_read") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_path = values[0];
    __pyx_v_signalInfo = ((struct __pyx_obj_5pysox_3sox_CSignalInfo *)values[1]);
    __pyx_v_encodingInfo = ((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)values[2]);
    __pyx_v_fileType = values[3];
  } else {
    __pyx_v_signalInfo = ((struct __pyx_obj_5pysox_3sox_CSignalInfo *)Py_None);
    __pyx_v_encodingInfo = ((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)Py_None);
    __pyx_v_fileType = ((PyObject *)Py_None);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  4: __pyx_v_fileType = PyTuple_GET_ITEM(__pyx_args, 3);
      case  3: __pyx_v_encodingInfo = ((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)PyTuple_GET_ITEM(__pyx_args, 2));
      case  2: __pyx_v_signalInfo = ((struct __pyx_obj_5pysox_3sox_CSignalInfo *)PyTuple_GET_ITEM(__pyx_args, 1));
      case  1: __pyx_v_path = PyTuple_GET_ITEM(__pyx_args, 0);
      break;
      default: goto __pyx_L5_argtuple_error;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("open_read", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysox.sox.CPysoxPipeStream.open_read");
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_signalInfo), __pyx_ptype_5pysox_3sox_CSignalInfo, 1, "signalInfo", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encodingInfo), __pyx_ptype_5pysox_3sox_CEncodingInfo, 1, "encodingInfo", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 3;
  __pyx_t_2.signalInfo = __pyx_v_signalInfo;
  __pyx_t_2.encodingInfo = __pyx_v_encodingInfo;
  __pyx_t_2.fileType = __pyx_v_fileType;
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pysox_3sox_CPysoxPipeStream *)((struct __pyx_obj_5pysox_3sox_CPysoxPipeStream *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.open_read(((struct __pyx_obj_5pysox_3sox_CSoxStream *)__pyx_v_self), __pyx_v_path, 1, &__pyx_t_2); if (unlikely(__pyx_t_1 == 0 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysox.sox.CPysoxPipeStream.open_read");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":507
 *         return 0
 * 
 *     cpdef open_write(self, path, CSignalInfo signalInfo, CEncodingInfo encodingInfo=None, fileType=None):             # <<<<<<<<<<<<<<
 *         return 0
 * 
 */

static PyObject *__pyx_pf_5pysox_3sox_16CPysoxPipeStream_4open_write(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static  PyObject *__pyx_f_5pysox_3sox_16CPysoxPipeStream_open_write(struct __pyx_obj_5pysox_3sox_CPysoxPipeStream *__pyx_v_self, PyObject *__pyx_v_path, struct __pyx_obj_5pysox_3sox_CSignalInfo *__pyx_v_signalInfo, int __pyx_skip_dispatch, struct __pyx_opt_args_5pysox_3sox_16CPysoxPipeStream_open_write *__pyx_optional_args) {
  struct __pyx_obj_5pysox_3sox_CEncodingInfo *__pyx_v_encodingInfo = ((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)Py_None);
  PyObject *__pyx_v_fileType = ((PyObject *)Py_None);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("open_write");
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_encodingInfo = __pyx_optional_args->encodingInfo;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_fileType = __pyx_optional_args->fileType;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__open_write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_5pysox_3sox_16CPysoxPipeStream_4open_write)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __Pyx_INCREF(__pyx_v_path);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_path);
      __Pyx_GIVEREF(__pyx_v_path);
      __Pyx_INCREF(((PyObject *)__pyx_v_signalInfo));
      PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_signalInfo));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_signalInfo));
      __Pyx_INCREF(((PyObject *)__pyx_v_encodingInfo));
      PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_encodingInfo));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_encodingInfo));
      __Pyx_INCREF(__pyx_v_fileType);
      PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_fileType);
      __Pyx_GIVEREF(__pyx_v_fileType);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pysox/sox.pyx":508
 * 
 *     cpdef open_write(self, path, CSignalInfo signalInfo, CEncodingInfo encodingInfo=None, fileType=None):
 *         return 0             # <<<<<<<<<<<<<<
 * 
 *     def close(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_int_0);
  __pyx_r = __pyx_int_0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysox.sox.CPysoxPipeStream.open_write");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":507
 *         return 0
 * 
 *     cpdef open_write(self, path, CSignalInfo signalInfo, CEncodingInfo encodingInfo=None, fileType=None):             # <<<<<<<<<<<<<<
 *         return 0
 * 
 */

static PyObject *__pyx_pf_5pysox_3sox_16CPysoxPipeStream_4open_write(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_5pysox_3sox_16CPysoxPipeStream_4open_write(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_path = 0;
  struct __pyx_obj_5pysox_3sox_CSignalInfo *__pyx_v_signalInfo = 0;
  struct __pyx_obj_5pysox_3sox_CEncodingInfo *__pyx_v_encodingInfo = 0;
  PyObject *__pyx_v_fileType = 0;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_5pysox_3sox_10CSoxStream_open_write __pyx_t_2;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__path,&__pyx_n_s__signalInfo,&__pyx_n_s__encodingInfo,&__pyx_n_s__fileType,0};
  __Pyx_RefNannySetupContext("open_write");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[4] = {0,0,0,0};
    values[2] = (PyObject *)((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)Py_None);
    values[3] = ((PyObject *)Py_None);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__path);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__signalInfo);
      if (likely(values[1])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("open_write", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
      case  2:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__encodingInfo);
        if (value) { values[2] = value; kw_args--; }
      }
      case  3:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fileType);
        if (value) { values[3] = value; kw_args--; }
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "open_write") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_path = values[0];
    __pyx_v_signalInfo = ((struct __pyx_obj_5pysox_3sox_CSignalInfo *)values[1]);
    __pyx_v_encodingInfo = ((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)values[2]);
    __pyx_v_fileType = values[3];
  } else {
    __pyx_v_encodingInfo = ((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)Py_None);
    __pyx_v_fileType = ((PyObject *)Py_None);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  4:
      __pyx_v_fileType = PyTuple_GET_ITEM(__pyx_args, 3);
      case  3:
      __pyx_v_encodingInfo = ((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)PyTuple_GET_ITEM(__pyx_args, 2));
      case  2:
      __pyx_v_signalInfo = ((struct __pyx_obj_5pysox_3sox_CSignalInfo *)PyTuple_GET_ITEM(__pyx_args, 1));
      __pyx_v_path = PyTuple_GET_ITEM(__pyx_args, 0);
      break;
      default: goto __pyx_L5_argtuple_error;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("open_write", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysox.sox.CPysoxPipeStream.open_write");
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_signalInfo), __pyx_ptype_5pysox_3sox_CSignalInfo, 1, "signalInfo", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encodingInfo), __pyx_ptype_5pysox_3sox_CEncodingInfo, 1, "encodingInfo", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.encodingInfo = __pyx_v_encodingInfo;
  __pyx_t_2.fileType = __pyx_v_fileType;
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pysox_3sox_CPysoxPipeStream *)((struct __pyx_obj_5pysox_3sox_CPysoxPipeStream *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.open_write(((struct __pyx_obj_5pysox_3sox_CSoxStream *)__pyx_v_self), __pyx_v_path, __pyx_v_signalInfo, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysox.sox.CPysoxPipeStream.open_write");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":510
 *         return 0
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         """Close the stream"""
 *         if self.ft:
 */

static PyObject *__pyx_pf_5pysox_3sox_16CPysoxPipeStream_5close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pysox_3sox_16CPysoxPipeStream_5close[] = "Close the stream";
static PyObject *__pyx_pf_5pysox_3sox_16CPysoxPipeStream_5close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("close");

  /* "pysox/sox.pyx":512
 *     def close(self):
 *         """Close the stream"""
 *         if self.ft:             # <<<<<<<<<<<<<<
 *             stdlib.free(self.ft)
 *             self.ft = NULL
 */
  __pyx_t_1 = (((struct __pyx_obj_5pysox_3sox_CPysoxPipeStream *)__pyx_v_self)->__pyx_base.ft != 0);
  if (__pyx_t_1) {

    /* "pysox/sox.pyx":513
 *         """Close the stream"""
 *         if self.ft:
 *             stdlib.free(self.ft)             # <<<<<<<<<<<<<<
 *             self.ft = NULL
 * 
 */
    free(((struct __pyx_obj_5pysox_3sox_CPysoxPipeStream *)__pyx_v_self)->__pyx_base.ft);

    /* "pysox/sox.pyx":514
 *         if self.ft:
 *             stdlib.free(self.ft)
 *             self.ft = NULL             # <<<<<<<<<<<<<<
 * 
 *     def start_read(self):
 */
    ((struct __pyx_obj_5pysox_3sox_CPysoxPipeStream *)__pyx_v_self)->__pyx_base.ft = NULL;
    goto __pyx_L5;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":516
 *             self.ft = NULL
 * 
 *     def start_read(self):             # <<<<<<<<<<<<<<
 *         print("CPysoxPipeStream::start_read")
 *         self.ft = <csox.sox_format_t *>stdlib.malloc(sizeof(csox.sox_format_t)) #will free in close
 */

static PyObject *__pyx_pf_5pysox_3sox_16CPysoxPipeStream_6start_read(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_5pysox_3sox_16CPysoxPipeStream_6start_read(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannySetupContext("start_read");

  /* "pysox/sox.pyx":517
 * 
 *     def start_read(self):
 *         print("CPysoxPipeStream::start_read")             # <<<<<<<<<<<<<<
 *         self.ft = <csox.sox_format_t *>stdlib.malloc(sizeof(csox.sox_format_t)) #will free in close
 *         self.receive_header()
 */
  if (__Pyx_PrintOne(0, ((PyObject *)__pyx_kp_s_19)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pysox/sox.pyx":518
 *     def start_read(self):
 *         print("CPysoxPipeStream::start_read")
 *         self.ft = <csox.sox_format_t *>stdlib.malloc(sizeof(csox.sox_format_t)) #will free in close             # <<<<<<<<<<<<<<
 *         self.receive_header()
 * 
 */
  ((struct __pyx_obj_5pysox_3sox_CPysoxPipeStream *)__pyx_v_self)->__pyx_base.ft = ((sox_format_t *)malloc((sizeof(sox_format_t))));

  /* "pysox/sox.pyx":519
 *         print("CPysoxPipeStream::start_read")
 *         self.ft = <csox.sox_format_t *>stdlib.malloc(sizeof(csox.sox_format_t)) #will free in close
 *         self.receive_header()             # <<<<<<<<<<<<<<
 * 
 *     cdef int receive_header(self):
 */
  ((struct __pyx_vtabstruct_5pysox_3sox_CPysoxPipeStream *)((struct __pyx_obj_5pysox_3sox_CPysoxPipeStream *)__pyx_v_self)->__pyx_base.__pyx_vtab)->receive_header(((struct __pyx_obj_5pysox_3sox_CPysoxPipeStream *)__pyx_v_self));

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysox.sox.CPysoxPipeStream.start_read");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":521
 *         self.receive_header()
 * 
 *     cdef int receive_header(self):             # <<<<<<<<<<<<<<
 *         cdef pysoxtransportheader_t header
 *         cdef size_t length
 */

static  int __pyx_f_5pysox_3sox_16CPysoxPipeStream_receive_header(struct __pyx_obj_5pysox_3sox_CPysoxPipeStream *__pyx_v_self) {
  __pyx_t_5pysox_3sox_pysoxtransportheader_t __pyx_v_header;
  size_t __pyx_v_length;
  PyObject *__pyx_v_data;
  int __pyx_r;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  char *__pyx_t_3;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("receive_header");
  __pyx_v_data = Py_None; __Pyx_INCREF(Py_None);

  /* "pysox/sox.pyx":524
 *         cdef pysoxtransportheader_t header
 *         cdef size_t length
 *         length = sizeof(pysoxtransportheader_t)             # <<<<<<<<<<<<<<
 *         self.initialdata = b''
 * 
 */
  __pyx_v_length = (sizeof(__pyx_t_5pysox_3sox_pysoxtransportheader_t));

  /* "pysox/sox.pyx":525
 *         cdef size_t length
 *         length = sizeof(pysoxtransportheader_t)
 *         self.initialdata = b''             # <<<<<<<<<<<<<<
 * 
 *         data = self.channel.recv_bytes()
 */
  __Pyx_INCREF(((PyObject *)__pyx_kp_b_5));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_b_5));
  __Pyx_GOTREF(__pyx_v_self->initialdata);
  __Pyx_DECREF(__pyx_v_self->initialdata);
  __pyx_v_self->initialdata = ((PyObject *)__pyx_kp_b_5);

  /* "pysox/sox.pyx":527
 *         self.initialdata = b''
 * 
 *         data = self.channel.recv_bytes()             # <<<<<<<<<<<<<<
 *         csox.bcopy(<char *>data, <char *>&header, length)
 *         print(self,"got header")
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self->channel, __pyx_n_s__recv_bytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_v_data);
  __pyx_v_data = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pysox/sox.pyx":528
 * 
 *         data = self.channel.recv_bytes()
 *         csox.bcopy(<char *>data, <char *>&header, length)             # <<<<<<<<<<<<<<
 *         print(self,"got header")
 *         csox.bcopy((<char *>&header)+4, &self.ft.signal, length-4)
 */
  __pyx_t_3 = PyBytes_AsString(__pyx_v_data); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  bcopy(__pyx_t_3, ((char *)(&__pyx_v_header)), __pyx_v_length);

  /* "pysox/sox.pyx":529
 *         data = self.channel.recv_bytes()
 *         csox.bcopy(<char *>data, <char *>&header, length)
 *         print(self,"got header")             # <<<<<<<<<<<<<<
 *         csox.bcopy((<char *>&header)+4, &self.ft.signal, length-4)
 * 
 */
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_20));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_kp_s_20));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_20));
  if (__Pyx_PrintOne(0, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;

  /* "pysox/sox.pyx":530
 *         csox.bcopy(<char *>data, <char *>&header, length)
 *         print(self,"got header")
 *         csox.bcopy((<char *>&header)+4, &self.ft.signal, length-4)             # <<<<<<<<<<<<<<
 * 
 *         if len(data) > length:
 */
  bcopy((((char *)(&__pyx_v_header)) + 4), (&__pyx_v_self->__pyx_base.ft->signal), (__pyx_v_length - 4));

  /* "pysox/sox.pyx":532
 *         csox.bcopy((<char *>&header)+4, &self.ft.signal, length-4)
 * 
 *         if len(data) > length:             # <<<<<<<<<<<<<<
 *             self.initialdata = data[length:]
 *             print("Got excessive data while reading header",len(self.initialdata))
 */
  __pyx_t_4 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = (__pyx_t_4 > __pyx_v_length);
  if (__pyx_t_5) {

    /* "pysox/sox.pyx":533
 * 
 *         if len(data) > length:
 *             self.initialdata = data[length:]             # <<<<<<<<<<<<<<
 *             print("Got excessive data while reading header",len(self.initialdata))
 *         return SOX_SUCCESS
 */
    __pyx_t_2 = __Pyx_PySequence_GetSlice(__pyx_v_data, __pyx_v_length, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __Pyx_GOTREF(__pyx_v_self->initialdata);
    __Pyx_DECREF(__pyx_v_self->initialdata);
    __pyx_v_self->initialdata = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "pysox/sox.pyx":534
 *         if len(data) > length:
 *             self.initialdata = data[length:]
 *             print("Got excessive data while reading header",len(self.initialdata))             # <<<<<<<<<<<<<<
 *         return SOX_SUCCESS
 * ################################################################################################
 */
    __pyx_t_2 = __pyx_v_self->initialdata;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_4 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_21));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_21));
    __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_21));
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    if (__Pyx_PrintOne(0, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pysox/sox.pyx":535
 *             self.initialdata = data[length:]
 *             print("Got excessive data while reading header",len(self.initialdata))
 *         return SOX_SUCCESS             # <<<<<<<<<<<<<<
 * ################################################################################################
 * #
 */
  __pyx_r = 0;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("pysox.sox.CPysoxPipeStream.receive_header");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_data);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":560
 *         fileType: string
 *     """
 *     def __init__(self, path=None, mode=None, CSignalInfo signalInfo=None, CEncodingInfo encodingInfo=None, fileType=None):             # <<<<<<<<<<<<<<
 *         """Create the null input file, which produces silence of infinite length."""
 *         mode= u'r'
 */

static int __pyx_pf_5pysox_3sox_9CNullFile___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pysox_3sox_9CNullFile___init__[] = "Create the null input file, which produces silence of infinite length.";
struct wrapperbase __pyx_wrapperbase_5pysox_3sox_9CNullFile___init__;
static int __pyx_pf_5pysox_3sox_9CNullFile___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_mode = 0;
  struct __pyx_obj_5pysox_3sox_CSignalInfo *__pyx_v_signalInfo = 0;
  struct __pyx_obj_5pysox_3sox_CEncodingInfo *__pyx_v_encodingInfo = 0;
  PyObject *__pyx_v_fileType = 0;
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__path,&__pyx_n_s__mode,&__pyx_n_s__signalInfo,&__pyx_n_s__encodingInfo,&__pyx_n_s__fileType,0};
  __Pyx_RefNannySetupContext("__init__");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[5] = {0,0,0,0,0};
    values[0] = ((PyObject *)Py_None);
    values[1] = ((PyObject *)Py_None);
    values[2] = (PyObject *)((struct __pyx_obj_5pysox_3sox_CSignalInfo *)Py_None);
    values[3] = (PyObject *)((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)Py_None);
    values[4] = ((PyObject *)Py_None);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__path);
        if (value) { values[0] = value; kw_args--; }
      }
      case  1:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__mode);
        if (value) { values[1] = value; kw_args--; }
      }
      case  2:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__signalInfo);
        if (value) { values[2] = value; kw_args--; }
      }
      case  3:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__encodingInfo);
        if (value) { values[3] = value; kw_args--; }
      }
      case  4:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fileType);
        if (value) { values[4] = value; kw_args--; }
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_path = values[0];
    __pyx_v_mode = values[1];
    __pyx_v_signalInfo = ((struct __pyx_obj_5pysox_3sox_CSignalInfo *)values[2]);
    __pyx_v_encodingInfo = ((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)values[3]);
    __pyx_v_fileType = values[4];
  } else {
    __pyx_v_path = ((PyObject *)Py_None);
    __pyx_v_mode = ((PyObject *)Py_None);
    __pyx_v_signalInfo = ((struct __pyx_obj_5pysox_3sox_CSignalInfo *)Py_None);
    __pyx_v_encodingInfo = ((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)Py_None);
    __pyx_v_fileType = ((PyObject *)Py_None);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  5: __pyx_v_fileType = PyTuple_GET_ITEM(__pyx_args, 4);
      case  4: __pyx_v_encodingInfo = ((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)PyTuple_GET_ITEM(__pyx_args, 3));
      case  3: __pyx_v_signalInfo = ((struct __pyx_obj_5pysox_3sox_CSignalInfo *)PyTuple_GET_ITEM(__pyx_args, 2));
      case  2: __pyx_v_mode = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: __pyx_v_path = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysox.sox.CNullFile.__init__");
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_INCREF(__pyx_v_path);
  __Pyx_INCREF(__pyx_v_mode);
  __Pyx_INCREF((PyObject *)__pyx_v_signalInfo);
  __Pyx_INCREF((PyObject *)__pyx_v_encodingInfo);
  __Pyx_INCREF(__pyx_v_fileType);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_signalInfo), __pyx_ptype_5pysox_3sox_CSignalInfo, 1, "signalInfo", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encodingInfo), __pyx_ptype_5pysox_3sox_CEncodingInfo, 1, "encodingInfo", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pysox/sox.pyx":562
 *     def __init__(self, path=None, mode=None, CSignalInfo signalInfo=None, CEncodingInfo encodingInfo=None, fileType=None):
 *         """Create the null input file, which produces silence of infinite length."""
 *         mode= u'r'             # <<<<<<<<<<<<<<
 *         path= u'null'
 *         fileType = u'null'
 */
  __Pyx_INCREF(((PyObject *)__pyx_n_u__r));
  __Pyx_DECREF(__pyx_v_mode);
  __pyx_v_mode = ((PyObject *)__pyx_n_u__r);

  /* "pysox/sox.pyx":563
 *         """Create the null input file, which produces silence of infinite length."""
 *         mode= u'r'
 *         path= u'null'             # <<<<<<<<<<<<<<
 *         fileType = u'null'
 *         if not signalInfo:
 */
  __Pyx_INCREF(((PyObject *)__pyx_n_u__null));
  __Pyx_DECREF(__pyx_v_path);
  __pyx_v_path = ((PyObject *)__pyx_n_u__null);

  /* "pysox/sox.pyx":564
 *         mode= u'r'
 *         path= u'null'
 *         fileType = u'null'             # <<<<<<<<<<<<<<
 *         if not signalInfo:
 *             signalInfo = CSignalInfo(48000,2,32, 0)
 */
  __Pyx_INCREF(((PyObject *)__pyx_n_u__null));
  __Pyx_DECREF(__pyx_v_fileType);
  __pyx_v_fileType = ((PyObject *)__pyx_n_u__null);

  /* "pysox/sox.pyx":565
 *         path= u'null'
 *         fileType = u'null'
 *         if not signalInfo:             # <<<<<<<<<<<<<<
 *             signalInfo = CSignalInfo(48000,2,32, 0)
 *         if not encodingInfo:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_signalInfo)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = (!__pyx_t_1);
  if (__pyx_t_2) {

    /* "pysox/sox.pyx":566
 *         fileType = u'null'
 *         if not signalInfo:
 *             signalInfo = CSignalInfo(48000,2,32, 0)             # <<<<<<<<<<<<<<
 *         if not encodingInfo:
 *             encodingInfo = CEncodingInfo(1,32)
 */
    __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pysox_3sox_CSignalInfo)), ((PyObject *)__pyx_k_tuple_22), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(((PyObject *)__pyx_v_signalInfo));
    __pyx_v_signalInfo = ((struct __pyx_obj_5pysox_3sox_CSignalInfo *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "pysox/sox.pyx":567
 *         if not signalInfo:
 *             signalInfo = CSignalInfo(48000,2,32, 0)
 *         if not encodingInfo:             # <<<<<<<<<<<<<<
 *             encodingInfo = CEncodingInfo(1,32)
 *         CSoxStream.__init__(self, path, mode, signalInfo, encodingInfo, fileType)
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_encodingInfo)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = (!__pyx_t_2);
  if (__pyx_t_1) {

    /* "pysox/sox.pyx":568
 *             signalInfo = CSignalInfo(48000,2,32, 0)
 *         if not encodingInfo:
 *             encodingInfo = CEncodingInfo(1,32)             # <<<<<<<<<<<<<<
 *         CSoxStream.__init__(self, path, mode, signalInfo, encodingInfo, fileType)
 * 
 */
    __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pysox_3sox_CEncodingInfo)), ((PyObject *)__pyx_k_tuple_23), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(((PyObject *)__pyx_v_encodingInfo));
    __pyx_v_encodingInfo = ((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "pysox/sox.pyx":569
 *         if not encodingInfo:
 *             encodingInfo = CEncodingInfo(1,32)
 *         CSoxStream.__init__(self, path, mode, signalInfo, encodingInfo, fileType)             # <<<<<<<<<<<<<<
 * 
 * ################################################################################################
 */
  __pyx_t_3 = PyObject_GetAttr(((PyObject *)((PyObject*)__pyx_ptype_5pysox_3sox_CSoxStream)), __pyx_n_s____init__); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __Pyx_INCREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  __Pyx_INCREF(__pyx_v_path);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_path);
  __Pyx_GIVEREF(__pyx_v_path);
  __Pyx_INCREF(__pyx_v_mode);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_mode);
  __Pyx_GIVEREF(__pyx_v_mode);
  __Pyx_INCREF(((PyObject *)__pyx_v_signalInfo));
  PyTuple_SET_ITEM(__pyx_t_4, 3, ((PyObject *)__pyx_v_signalInfo));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_signalInfo));
  __Pyx_INCREF(((PyObject *)__pyx_v_encodingInfo));
  PyTuple_SET_ITEM(__pyx_t_4, 4, ((PyObject *)__pyx_v_encodingInfo));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_encodingInfo));
  __Pyx_INCREF(__pyx_v_fileType);
  PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_v_fileType);
  __Pyx_GIVEREF(__pyx_v_fileType);
  __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pysox.sox.CNullFile.__init__");
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_path);
  __Pyx_DECREF(__pyx_v_mode);
  __Pyx_DECREF((PyObject *)__pyx_v_signalInfo);
  __Pyx_DECREF((PyObject *)__pyx_v_encodingInfo);
  __Pyx_DECREF(__pyx_v_fileType);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":601
 *     SOX_EFF_INTERNAL = 1024        #/[inserted by cython to avoid comment start]* Is in libSoX but not sox *[inserted by cython to avoid comment closer]/
 * 
 *     def __init__(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         """Create a sox internal effect
 * 
 */

static int __pyx_pf_5pysox_3sox_7CEffect___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pysox_3sox_7CEffect___init__[] = "Create a sox internal effect\n        \n        optional parameters to initialize the effect:\n        @param <string> name of the effect\n        @param <[]> array of effect arguments\n        @see create \n        ";
struct wrapperbase __pyx_wrapperbase_5pysox_3sox_7CEffect___init__;
static int __pyx_pf_5pysox_3sox_7CEffect___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  int __pyx_r;
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__init__");
  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1;
  __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New();
  if (unlikely(!__pyx_v_kwargs)) return -1;
  __Pyx_GOTREF(__pyx_v_kwargs);
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;

  /* "pysox/sox.pyx":609
 *         @see create
 *         """
 *         self.name = None             # <<<<<<<<<<<<<<
 *         self.effect = NULL
 *         self.argv = NULL
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(((struct __pyx_obj_5pysox_3sox_CEffect *)__pyx_v_self)->name);
  __Pyx_DECREF(((struct __pyx_obj_5pysox_3sox_CEffect *)__pyx_v_self)->name);
  ((struct __pyx_obj_5pysox_3sox_CEffect *)__pyx_v_self)->name = Py_None;

  /* "pysox/sox.pyx":610
 *         """
 *         self.name = None
 *         self.effect = NULL             # <<<<<<<<<<<<<<
 *         self.argv = NULL
 *         self.argc=0
 */
  ((struct __pyx_obj_5pysox_3sox_CEffect *)__pyx_v_self)->effect = NULL;

  /* "pysox/sox.pyx":611
 *         self.name = None
 *         self.effect = NULL
 *         self.argv = NULL             # <<<<<<<<<<<<<<
 *         self.argc=0
 *         if len(args):
 */
  ((struct __pyx_obj_5pysox_3sox_CEffect *)__pyx_v_self)->argv = NULL;

  /* "pysox/sox.pyx":612
 *         self.effect = NULL
 *         self.argv = NULL
 *         self.argc=0             # <<<<<<<<<<<<<<
 *         if len(args):
 *             self.create(args[0], args[1])
 */
  ((struct __pyx_obj_5pysox_3sox_CEffect *)__pyx_v_self)->argc = 0;

  /* "pysox/sox.pyx":613
 *         self.argv = NULL
 *         self.argc=0
 *         if len(args):             # <<<<<<<<<<<<<<
 *             self.create(args[0], args[1])
 * 
 */
  if (unlikely(__pyx_v_args == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
  }
  __pyx_t_1 = PyTuple_GET_SIZE(((PyObject *)__pyx_v_args)); 
  if (__pyx_t_1) {

    /* "pysox/sox.pyx":614
 *         self.argc=0
 *         if len(args):
 *             self.create(args[0], args[1])             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
    __pyx_t_2 = __Pyx_GetItemInt_Tuple(((PyObject *)__pyx_v_args), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_GetItemInt_Tuple(((PyObject *)__pyx_v_args), 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = ((struct __pyx_vtabstruct_5pysox_3sox_CEffect *)((struct __pyx_obj_5pysox_3sox_CEffect *)__pyx_v_self)->__pyx_vtab)->create(((struct __pyx_obj_5pysox_3sox_CEffect *)__pyx_v_self), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pysox.sox.CEffect.__init__");
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_args);
  __Pyx_DECREF(__pyx_v_kwargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":616
 *             self.create(args[0], args[1])
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         cdef int c = 0
 *         if self.argc > 0:
 */

static void __pyx_pf_5pysox_3sox_7CEffect_1__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pf_5pysox_3sox_7CEffect_1__dealloc__(PyObject *__pyx_v_self) {
  int __pyx_v_c;
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__dealloc__");

  /* "pysox/sox.pyx":617
 * 
 *     def __dealloc__(self):
 *         cdef int c = 0             # <<<<<<<<<<<<<<
 *         if self.argc > 0:
 *             while c<self.argc:
 */
  __pyx_v_c = 0;

  /* "pysox/sox.pyx":618
 *     def __dealloc__(self):
 *         cdef int c = 0
 *         if self.argc > 0:             # <<<<<<<<<<<<<<
 *             while c<self.argc:
 *                 if self.argv[c]:
 */
  __pyx_t_1 = (((struct __pyx_obj_5pysox_3sox_CEffect *)__pyx_v_self)->argc > 0);
  if (__pyx_t_1) {

    /* "pysox/sox.pyx":619
 *         cdef int c = 0
 *         if self.argc > 0:
 *             while c<self.argc:             # <<<<<<<<<<<<<<
 *                 if self.argv[c]:
 *                     stdlib.free(self.argv[c])
 */
    while (1) {
      __pyx_t_1 = (__pyx_v_c < ((struct __pyx_obj_5pysox_3sox_CEffect *)__pyx_v_self)->argc);
      if (!__pyx_t_1) break;

      /* "pysox/sox.pyx":620
 *         if self.argc > 0:
 *             while c<self.argc:
 *                 if self.argv[c]:             # <<<<<<<<<<<<<<
 *                     stdlib.free(self.argv[c])
 *                 inc(c)
 */
      __pyx_t_1 = ((((struct __pyx_obj_5pysox_3sox_CEffect *)__pyx_v_self)->argv[__pyx_v_c]) != 0);
      if (__pyx_t_1) {

        /* "pysox/sox.pyx":621
 *             while c<self.argc:
 *                 if self.argv[c]:
 *                     stdlib.free(self.argv[c])             # <<<<<<<<<<<<<<
 *                 inc(c)
 *             stdlib.free(self.argv)
 */
        free((((struct __pyx_obj_5pysox_3sox_CEffect *)__pyx_v_self)->argv[__pyx_v_c]));
        goto __pyx_L8;
      }
      __pyx_L8:;

      /* "pysox/sox.pyx":622
 *                 if self.argv[c]:
 *                     stdlib.free(self.argv[c])
 *                 inc(c)             # <<<<<<<<<<<<<<
 *             stdlib.free(self.argv)
 *             self.argv = NULL
 */
      (++__pyx_v_c);
    }

    /* "pysox/sox.pyx":623
 *                     stdlib.free(self.argv[c])
 *                 inc(c)
 *             stdlib.free(self.argv)             # <<<<<<<<<<<<<<
 *             self.argv = NULL
 *             self.argc = 0
 */
    free(((struct __pyx_obj_5pysox_3sox_CEffect *)__pyx_v_self)->argv);

    /* "pysox/sox.pyx":624
 *                 inc(c)
 *             stdlib.free(self.argv)
 *             self.argv = NULL             # <<<<<<<<<<<<<<
 *             self.argc = 0
 * 
 */
    ((struct __pyx_obj_5pysox_3sox_CEffect *)__pyx_v_self)->argv = NULL;

    /* "pysox/sox.pyx":625
 *             stdlib.free(self.argv)
 *             self.argv = NULL
 *             self.argc = 0             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
    ((struct __pyx_obj_5pysox_3sox_CEffect *)__pyx_v_self)->argc = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  __Pyx_RefNannyFinishContext();
}

/* "pysox/sox.pyx":627
 *             self.argc = 0
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return u"CEffect(%s)"%self.name #name is pyobj
 * 
 */

static PyObject *__pyx_pf_5pysox_3sox_7CEffect_2__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_5pysox_3sox_7CEffect_2__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__repr__");

  /* "pysox/sox.pyx":628
 * 
 *     def __repr__(self):
 *         return u"CEffect(%s)"%self.name #name is pyobj             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_name(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_24), ((struct __pyx_obj_5pysox_3sox_CEffect *)__pyx_v_self)->name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysox.sox.CEffect.__repr__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":630
 *         return u"CEffect(%s)"%self.name #name is pyobj
 * 
 *     cpdef get_name(self):             # <<<<<<<<<<<<<<
 *         """Retrieve the effect's name
 * 
 */

static PyObject *__pyx_pf_5pysox_3sox_7CEffect_3get_name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static  PyObject *__pyx_f_5pysox_3sox_7CEffect_get_name(struct __pyx_obj_5pysox_3sox_CEffect *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("get_name");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_5pysox_3sox_7CEffect_3get_name)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pysox/sox.pyx":636
 *             string
 *         """
 *         return self.name             # <<<<<<<<<<<<<<
 *     cdef csox.sox_effect_t * get_effect(self):
 *         return self.effect
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->name);
  __pyx_r = __pyx_v_self->name;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysox.sox.CEffect.get_name");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":630
 *         return u"CEffect(%s)"%self.name #name is pyobj
 * 
 *     cpdef get_name(self):             # <<<<<<<<<<<<<<
 *         """Retrieve the effect's name
 * 
 */

static PyObject *__pyx_pf_5pysox_3sox_7CEffect_3get_name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pysox_3sox_7CEffect_3get_name[] = "Retrieve the effect's name\n        \n        Returns:\n            string\n        ";
static PyObject *__pyx_pf_5pysox_3sox_7CEffect_3get_name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("get_name");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pysox_3sox_CEffect *)((struct __pyx_obj_5pysox_3sox_CEffect *)__pyx_v_self)->__pyx_vtab)->get_name(((struct __pyx_obj_5pysox_3sox_CEffect *)__pyx_v_self), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysox.sox.CEffect.get_name");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":637
 *         """
 *         return self.name
 *     cdef csox.sox_effect_t * get_effect(self):             # <<<<<<<<<<<<<<
 *         return self.effect
 * 
 */

static  sox_effect_t *__pyx_f_5pysox_3sox_7CEffect_get_effect(struct __pyx_obj_5pysox_3sox_CEffect *__pyx_v_self) {
  sox_effect_t *__pyx_r;
  __Pyx_RefNannySetupContext("get_effect");

  /* "pysox/sox.pyx":638
 *         return self.name
 *     cdef csox.sox_effect_t * get_effect(self):
 *         return self.effect             # <<<<<<<<<<<<<<
 * 
 *     cdef create(self, name, arguments):
 */
  __pyx_r = __pyx_v_self->effect;
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":640
 *         return self.effect
 * 
 *     cdef create(self, name, arguments):             # <<<<<<<<<<<<<<
 *         """Create an effect
 * 
 */

static  PyObject *__pyx_f_5pysox_3sox_7CEffect_create(struct __pyx_obj_5pysox_3sox_CEffect *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_arguments) {
  int __pyx_v_argc;
  int __pyx_v_clen;
  char *__pyx_v_carg;
  char *__pyx_v_cname;
  PyObject *__pyx_v_a;
  PyObject *__pyx_r = NULL;
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  char *__pyx_t_5;
  Py_ssize_t __pyx_t_6;
  __Pyx_RefNannySetupContext("create");
  __pyx_v_a = Py_None; __Pyx_INCREF(Py_None);

  /* "pysox/sox.pyx":649
 *                 e.g. [ b'2', b'sine', b'1500' ]
 *         """
 *         cdef int argc = 0             # <<<<<<<<<<<<<<
 *         cdef int clen = 0
 *         cdef char *carg
 */
  __pyx_v_argc = 0;

  /* "pysox/sox.pyx":650
 *         """
 *         cdef int argc = 0
 *         cdef int clen = 0             # <<<<<<<<<<<<<<
 *         cdef char *carg
 *         cdef csox.sox_format_t * ft
 */
  __pyx_v_clen = 0;

  /* "pysox/sox.pyx":654
 *         cdef csox.sox_format_t * ft
 *         cdef char *cname
 *         self.name = name             # <<<<<<<<<<<<<<
 *         cname = toCharP(name)
 *         self.effect = csox.sox_create_effect(csox.sox_find_effect(cname))
 */
  __Pyx_INCREF(__pyx_v_name);
  __Pyx_GIVEREF(__pyx_v_name);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = __pyx_v_name;

  /* "pysox/sox.pyx":655
 *         cdef char *cname
 *         self.name = name
 *         cname = toCharP(name)             # <<<<<<<<<<<<<<
 *         self.effect = csox.sox_create_effect(csox.sox_find_effect(cname))
 * 
 */
  __pyx_v_cname = __pyx_f_5pysox_3sox_toCharP(__pyx_v_name);

  /* "pysox/sox.pyx":656
 *         self.name = name
 *         cname = toCharP(name)
 *         self.effect = csox.sox_create_effect(csox.sox_find_effect(cname))             # <<<<<<<<<<<<<<
 * 
 *         self.argc = len(arguments)
 */
  __pyx_v_self->effect = sox_create_effect(sox_find_effect(__pyx_v_cname));

  /* "pysox/sox.pyx":658
 *         self.effect = csox.sox_create_effect(csox.sox_find_effect(cname))
 * 
 *         self.argc = len(arguments)             # <<<<<<<<<<<<<<
 *         self.argv = <char **>stdlib.malloc((self.argc+1) * sizeof(char *))
 *         for a in arguments:
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_arguments); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->argc = __pyx_t_1;

  /* "pysox/sox.pyx":659
 * 
 *         self.argc = len(arguments)
 *         self.argv = <char **>stdlib.malloc((self.argc+1) * sizeof(char *))             # <<<<<<<<<<<<<<
 *         for a in arguments:
 *             if isinstance(a, CSoxStream):
 */
  __pyx_v_self->argv = ((char **)malloc(((__pyx_v_self->argc + 1) * (sizeof(char *)))));

  /* "pysox/sox.pyx":660
 *         self.argc = len(arguments)
 *         self.argv = <char **>stdlib.malloc((self.argc+1) * sizeof(char *))
 *         for a in arguments:             # <<<<<<<<<<<<<<
 *             if isinstance(a, CSoxStream):
 *                 carg = (<CSoxStream>a).asCharP()
 */
  if (PyList_CheckExact(__pyx_v_arguments) || PyTuple_CheckExact(__pyx_v_arguments)) {
    __pyx_t_1 = 0; __pyx_t_2 = __pyx_v_arguments; __Pyx_INCREF(__pyx_t_2);
  } else {
    __pyx_t_1 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_arguments); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
  }
  for (;;) {
    if (likely(PyList_CheckExact(__pyx_t_2))) {
      if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_2)) break;
      __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++;
    } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
      if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++;
    } else {
      __pyx_t_3 = PyIter_Next(__pyx_t_2);
      if (!__pyx_t_3) {
        if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_DECREF(__pyx_v_a);
    __pyx_v_a = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "pysox/sox.pyx":661
 *         self.argv = <char **>stdlib.malloc((self.argc+1) * sizeof(char *))
 *         for a in arguments:
 *             if isinstance(a, CSoxStream):             # <<<<<<<<<<<<<<
 *                 carg = (<CSoxStream>a).asCharP()
 *                 clen = sizeof(csox.sox_format_t)
 */
    __pyx_t_4 = __Pyx_TypeCheck(__pyx_v_a, ((PyObject*)__pyx_ptype_5pysox_3sox_CSoxStream)); 
    if (__pyx_t_4) {

      /* "pysox/sox.pyx":662
 *         for a in arguments:
 *             if isinstance(a, CSoxStream):
 *                 carg = (<CSoxStream>a).asCharP()             # <<<<<<<<<<<<<<
 *                 clen = sizeof(csox.sox_format_t)
 *             else:
 */
      __pyx_v_carg = ((struct __pyx_vtabstruct_5pysox_3sox_CSoxStream *)((struct __pyx_obj_5pysox_3sox_CSoxStream *)__pyx_v_a)->__pyx_vtab)->asCharP(((struct __pyx_obj_5pysox_3sox_CSoxStream *)__pyx_v_a));

      /* "pysox/sox.pyx":663
 *             if isinstance(a, CSoxStream):
 *                 carg = (<CSoxStream>a).asCharP()
 *                 clen = sizeof(csox.sox_format_t)             # <<<<<<<<<<<<<<
 *             else:
 *                 carg = <char *>a
 */
      __pyx_v_clen = (sizeof(sox_format_t));
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pysox/sox.pyx":665
 *                 clen = sizeof(csox.sox_format_t)
 *             else:
 *                 carg = <char *>a             # <<<<<<<<<<<<<<
 *                 clen = len(a)
 *             self.argv[argc] = <char *>stdlib.malloc(clen+1)
 */
      __pyx_t_5 = PyBytes_AsString(__pyx_v_a); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_v_carg = __pyx_t_5;

      /* "pysox/sox.pyx":666
 *             else:
 *                 carg = <char *>a
 *                 clen = len(a)             # <<<<<<<<<<<<<<
 *             self.argv[argc] = <char *>stdlib.malloc(clen+1)
 *             csox.bcopy(carg, self.argv[argc],clen)
 */
      __pyx_t_6 = PyObject_Length(__pyx_v_a); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_v_clen = __pyx_t_6;
    }
    __pyx_L5:;

    /* "pysox/sox.pyx":667
 *                 carg = <char *>a
 *                 clen = len(a)
 *             self.argv[argc] = <char *>stdlib.malloc(clen+1)             # <<<<<<<<<<<<<<
 *             csox.bcopy(carg, self.argv[argc],clen)
 *             self.argv[argc][clen]=<char>0
 */
    (__pyx_v_self->argv[__pyx_v_argc]) = ((char *)malloc((__pyx_v_clen + 1)));

    /* "pysox/sox.pyx":668
 *                 clen = len(a)
 *             self.argv[argc] = <char *>stdlib.malloc(clen+1)
 *             csox.bcopy(carg, self.argv[argc],clen)             # <<<<<<<<<<<<<<
 *             self.argv[argc][clen]=<char>0
 *             argc +=1
 */
    bcopy(__pyx_v_carg, (__pyx_v_self->argv[__pyx_v_argc]), __pyx_v_clen);

    /* "pysox/sox.pyx":669
 *             self.argv[argc] = <char *>stdlib.malloc(clen+1)
 *             csox.bcopy(carg, self.argv[argc],clen)
 *             self.argv[argc][clen]=<char>0             # <<<<<<<<<<<<<<
 *             argc +=1
 *         self.argv[argc]=NULL
 */
    ((__pyx_v_self->argv[__pyx_v_argc])[__pyx_v_clen]) = ((char)0);

    /* "pysox/sox.pyx":670
 *             csox.bcopy(carg, self.argv[argc],clen)
 *             self.argv[argc][clen]=<char>0
 *             argc +=1             # <<<<<<<<<<<<<<
 *         self.argv[argc]=NULL
 *         csox.sox_effect_options(self.effect, self.argc, self.argv)
 */
    __pyx_v_argc = (__pyx_v_argc + 1);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pysox/sox.pyx":671
 *             self.argv[argc][clen]=<char>0
 *             argc +=1
 *         self.argv[argc]=NULL             # <<<<<<<<<<<<<<
 *         csox.sox_effect_options(self.effect, self.argc, self.argv)
 * 
 */
  (__pyx_v_self->argv[__pyx_v_argc]) = NULL;

  /* "pysox/sox.pyx":672
 *             argc +=1
 *         self.argv[argc]=NULL
 *         csox.sox_effect_options(self.effect, self.argc, self.argv)             # <<<<<<<<<<<<<<
 * 
 *     #
 */
  sox_effect_options(__pyx_v_self->effect, __pyx_v_self->argc, __pyx_v_self->argv);

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysox.sox.CEffect.create");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_a);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":677
 *     # access to signal and encoding of effect_t
 *     #
 *     def get_in_signal(self):             # <<<<<<<<<<<<<<
 *         """retrieve the CSignalInfo object representation of this streams in_signal"""
 *         if not self.effect:
 */

static PyObject *__pyx_pf_5pysox_3sox_7CEffect_4get_in_signal(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pysox_3sox_7CEffect_4get_in_signal[] = "retrieve the CSignalInfo object representation of this streams in_signal";
static PyObject *__pyx_pf_5pysox_3sox_7CEffect_4get_in_signal(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  struct __pyx_obj_5pysox_3sox_CSignalInfo *__pyx_v_si;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("get_in_signal");
  __pyx_v_si = ((struct __pyx_obj_5pysox_3sox_CSignalInfo *)Py_None); __Pyx_INCREF(Py_None);

  /* "pysox/sox.pyx":679
 *     def get_in_signal(self):
 *         """retrieve the CSignalInfo object representation of this streams in_signal"""
 *         if not self.effect:             # <<<<<<<<<<<<<<
 *             return None
 *         si = CSignalInfo()
 */
  __pyx_t_1 = (!(((struct __pyx_obj_5pysox_3sox_CEffect *)__pyx_v_self)->effect != 0));
  if (__pyx_t_1) {

    /* "pysox/sox.pyx":680
 *         """retrieve the CSignalInfo object representation of this streams in_signal"""
 *         if not self.effect:
 *             return None             # <<<<<<<<<<<<<<
 *         si = CSignalInfo()
 *         si.cset_signal(&self.effect.in_signal)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pysox/sox.pyx":681
 *         if not self.effect:
 *             return None
 *         si = CSignalInfo()             # <<<<<<<<<<<<<<
 *         si.cset_signal(&self.effect.in_signal)
 *         return si
 */
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pysox_3sox_CSignalInfo)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_v_si));
  __pyx_v_si = ((struct __pyx_obj_5pysox_3sox_CSignalInfo *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pysox/sox.pyx":682
 *             return None
 *         si = CSignalInfo()
 *         si.cset_signal(&self.effect.in_signal)             # <<<<<<<<<<<<<<
 *         return si
 * #    def setInSignal(self):
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_5pysox_3sox_CSignalInfo *)__pyx_v_si->__pyx_vtab)->cset_signal(__pyx_v_si, (&((struct __pyx_obj_5pysox_3sox_CEffect *)__pyx_v_self)->effect->in_signal)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pysox/sox.pyx":683
 *         si = CSignalInfo()
 *         si.cset_signal(&self.effect.in_signal)
 *         return si             # <<<<<<<<<<<<<<
 * #    def setInSignal(self):
 * #        pass
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_si));
  __pyx_r = ((PyObject *)__pyx_v_si);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysox.sox.CEffect.get_in_signal");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_si);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":686
 * #    def setInSignal(self):
 * #        pass
 *     def get_out_signal(self):             # <<<<<<<<<<<<<<
 *         """retrieve the CSignalInfo object representation of this streams out_signal"""
 *         if not self.effect:
 */

static PyObject *__pyx_pf_5pysox_3sox_7CEffect_5get_out_signal(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pysox_3sox_7CEffect_5get_out_signal[] = "retrieve the CSignalInfo object representation of this streams out_signal";
static PyObject *__pyx_pf_5pysox_3sox_7CEffect_5get_out_signal(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  struct __pyx_obj_5pysox_3sox_CSignalInfo *__pyx_v_si;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("get_out_signal");
  __pyx_v_si = ((struct __pyx_obj_5pysox_3sox_CSignalInfo *)Py_None); __Pyx_INCREF(Py_None);

  /* "pysox/sox.pyx":688
 *     def get_out_signal(self):
 *         """retrieve the CSignalInfo object representation of this streams out_signal"""
 *         if not self.effect:             # <<<<<<<<<<<<<<
 *             return None
 *         si = CSignalInfo()
 */
  __pyx_t_1 = (!(((struct __pyx_obj_5pysox_3sox_CEffect *)__pyx_v_self)->effect != 0));
  if (__pyx_t_1) {

    /* "pysox/sox.pyx":689
 *         """retrieve the CSignalInfo object representation of this streams out_signal"""
 *         if not self.effect:
 *             return None             # <<<<<<<<<<<<<<
 *         si = CSignalInfo()
 *         si.cset_signal(&self.effect.out_signal)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pysox/sox.pyx":690
 *         if not self.effect:
 *             return None
 *         si = CSignalInfo()             # <<<<<<<<<<<<<<
 *         si.cset_signal(&self.effect.out_signal)
 *         return si
 */
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pysox_3sox_CSignalInfo)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_v_si));
  __pyx_v_si = ((struct __pyx_obj_5pysox_3sox_CSignalInfo *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pysox/sox.pyx":691
 *             return None
 *         si = CSignalInfo()
 *         si.cset_signal(&self.effect.out_signal)             # <<<<<<<<<<<<<<
 *         return si
 *     def set_out_signal(self):
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_5pysox_3sox_CSignalInfo *)__pyx_v_si->__pyx_vtab)->cset_signal(__pyx_v_si, (&((struct __pyx_obj_5pysox_3sox_CEffect *)__pyx_v_self)->effect->out_signal)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pysox/sox.pyx":692
 *         si = CSignalInfo()
 *         si.cset_signal(&self.effect.out_signal)
 *         return si             # <<<<<<<<<<<<<<
 *     def set_out_signal(self):
 *         pass
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_si));
  __pyx_r = ((PyObject *)__pyx_v_si);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysox.sox.CEffect.get_out_signal");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_si);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":693
 *         si.cset_signal(&self.effect.out_signal)
 *         return si
 *     def set_out_signal(self):             # <<<<<<<<<<<<<<
 *         pass
 * # CHECK: encoding is const in here???
 */

static PyObject *__pyx_pf_5pysox_3sox_7CEffect_6set_out_signal(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_5pysox_3sox_7CEffect_6set_out_signal(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannySetupContext("set_out_signal");

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":696
 *         pass
 * # CHECK: encoding is const in here???
 *     def get_in_encoding(self):             # <<<<<<<<<<<<<<
 *         """retrieve the CEncodingInfo object representation of this streams in_encoding"""
 *         if not self.effect:
 */

static PyObject *__pyx_pf_5pysox_3sox_7CEffect_7get_in_encoding(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pysox_3sox_7CEffect_7get_in_encoding[] = "retrieve the CEncodingInfo object representation of this streams in_encoding";
static PyObject *__pyx_pf_5pysox_3sox_7CEffect_7get_in_encoding(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  struct __pyx_obj_5pysox_3sox_CEncodingInfo *__pyx_v_si;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("get_in_encoding");
  __pyx_v_si = ((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)Py_None); __Pyx_INCREF(Py_None);

  /* "pysox/sox.pyx":698
 *     def get_in_encoding(self):
 *         """retrieve the CEncodingInfo object representation of this streams in_encoding"""
 *         if not self.effect:             # <<<<<<<<<<<<<<
 *             return None
 *         si = CEncodingInfo()
 */
  __pyx_t_1 = (!(((struct __pyx_obj_5pysox_3sox_CEffect *)__pyx_v_self)->effect != 0));
  if (__pyx_t_1) {

    /* "pysox/sox.pyx":699
 *         """retrieve the CEncodingInfo object representation of this streams in_encoding"""
 *         if not self.effect:
 *             return None             # <<<<<<<<<<<<<<
 *         si = CEncodingInfo()
 *         si.cset_encoding(<csox.sox_encodinginfo_t *>self.effect.in_encoding) #discard const by casting
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pysox/sox.pyx":700
 *         if not self.effect:
 *             return None
 *         si = CEncodingInfo()             # <<<<<<<<<<<<<<
 *         si.cset_encoding(<csox.sox_encodinginfo_t *>self.effect.in_encoding) #discard const by casting
 *         return si
 */
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pysox_3sox_CEncodingInfo)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_v_si));
  __pyx_v_si = ((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pysox/sox.pyx":701
 *             return None
 *         si = CEncodingInfo()
 *         si.cset_encoding(<csox.sox_encodinginfo_t *>self.effect.in_encoding) #discard const by casting             # <<<<<<<<<<<<<<
 *         return si
 * #    def set_in_encoding(self):
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_5pysox_3sox_CEncodingInfo *)__pyx_v_si->__pyx_vtab)->cset_encoding(__pyx_v_si, ((sox_encodinginfo_t *)((struct __pyx_obj_5pysox_3sox_CEffect *)__pyx_v_self)->effect->in_encoding)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pysox/sox.pyx":702
 *         si = CEncodingInfo()
 *         si.cset_encoding(<csox.sox_encodinginfo_t *>self.effect.in_encoding) #discard const by casting
 *         return si             # <<<<<<<<<<<<<<
 * #    def set_in_encoding(self):
 * #        pass
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_si));
  __pyx_r = ((PyObject *)__pyx_v_si);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysox.sox.CEffect.get_in_encoding");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_si);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":705
 * #    def set_in_encoding(self):
 * #        pass
 *     def get_out_encoding(self):             # <<<<<<<<<<<<<<
 *         """retrieve the CEncodingInfo object representation of this streams in_encoding"""
 *         if not self.effect:
 */

static PyObject *__pyx_pf_5pysox_3sox_7CEffect_8get_out_encoding(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pysox_3sox_7CEffect_8get_out_encoding[] = "retrieve the CEncodingInfo object representation of this streams in_encoding";
static PyObject *__pyx_pf_5pysox_3sox_7CEffect_8get_out_encoding(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  struct __pyx_obj_5pysox_3sox_CEncodingInfo *__pyx_v_si;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("get_out_encoding");
  __pyx_v_si = ((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)Py_None); __Pyx_INCREF(Py_None);

  /* "pysox/sox.pyx":707
 *     def get_out_encoding(self):
 *         """retrieve the CEncodingInfo object representation of this streams in_encoding"""
 *         if not self.effect:             # <<<<<<<<<<<<<<
 *             return None
 *         si = CEncodingInfo()
 */
  __pyx_t_1 = (!(((struct __pyx_obj_5pysox_3sox_CEffect *)__pyx_v_self)->effect != 0));
  if (__pyx_t_1) {

    /* "pysox/sox.pyx":708
 *         """retrieve the CEncodingInfo object representation of this streams in_encoding"""
 *         if not self.effect:
 *             return None             # <<<<<<<<<<<<<<
 *         si = CEncodingInfo()
 *         si.cset_encoding(<csox.sox_encodinginfo_t *>self.effect.out_encoding) #discard const by casting
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pysox/sox.pyx":709
 *         if not self.effect:
 *             return None
 *         si = CEncodingInfo()             # <<<<<<<<<<<<<<
 *         si.cset_encoding(<csox.sox_encodinginfo_t *>self.effect.out_encoding) #discard const by casting
 *         return si
 */
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pysox_3sox_CEncodingInfo)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_v_si));
  __pyx_v_si = ((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pysox/sox.pyx":710
 *             return None
 *         si = CEncodingInfo()
 *         si.cset_encoding(<csox.sox_encodinginfo_t *>self.effect.out_encoding) #discard const by casting             # <<<<<<<<<<<<<<
 *         return si
 * #    def set_out_encoding(self):
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_5pysox_3sox_CEncodingInfo *)__pyx_v_si->__pyx_vtab)->cset_encoding(__pyx_v_si, ((sox_encodinginfo_t *)((struct __pyx_obj_5pysox_3sox_CEffect *)__pyx_v_self)->effect->out_encoding)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pysox/sox.pyx":711
 *         si = CEncodingInfo()
 *         si.cset_encoding(<csox.sox_encodinginfo_t *>self.effect.out_encoding) #discard const by casting
 *         return si             # <<<<<<<<<<<<<<
 * #    def set_out_encoding(self):
 * #        pass
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_si));
  __pyx_r = ((PyObject *)__pyx_v_si);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysox.sox.CEffect.get_out_encoding");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_si);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":738
 *     cdef object effects #pre-store CEffect objects
 * 
 *     def __init__(self, CSoxStream istream=None, CSoxStream ostream=None):             # <<<<<<<<<<<<<<
 *         """Create an effect chain
 * 
 */

static int __pyx_pf_5pysox_3sox_13CEffectsChain___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pysox_3sox_13CEffectsChain___init__[] = "Create an effect chain\n        \n        Kwargs:\n            istream: :class:`CSoxStream` input stream object\n            \n            ostream: :class:`CSoxStream` output stream object\n            \n        ";
struct wrapperbase __pyx_wrapperbase_5pysox_3sox_13CEffectsChain___init__;
static int __pyx_pf_5pysox_3sox_13CEffectsChain___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_5pysox_3sox_CSoxStream *__pyx_v_istream = 0;
  struct __pyx_obj_5pysox_3sox_CSoxStream *__pyx_v_ostream = 0;
  int __pyx_r;
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__istream,&__pyx_n_s__ostream,0};
  __Pyx_RefNannySetupContext("__init__");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[2] = {0,0};
    values[0] = (PyObject *)((struct __pyx_obj_5pysox_3sox_CSoxStream *)Py_None);
    values[1] = (PyObject *)((struct __pyx_obj_5pysox_3sox_CSoxStream *)Py_None);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__istream);
        if (value) { values[0] = value; kw_args--; }
      }
      case  1:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ostream);
        if (value) { values[1] = value; kw_args--; }
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_istream = ((struct __pyx_obj_5pysox_3sox_CSoxStream *)values[0]);
    __pyx_v_ostream = ((struct __pyx_obj_5pysox_3sox_CSoxStream *)values[1]);
  } else {
    __pyx_v_istream = ((struct __pyx_obj_5pysox_3sox_CSoxStream *)Py_None);
    __pyx_v_ostream = ((struct __pyx_obj_5pysox_3sox_CSoxStream *)Py_None);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  2: __pyx_v_ostream = ((struct __pyx_obj_5pysox_3sox_CSoxStream *)PyTuple_GET_ITEM(__pyx_args, 1));
      case  1: __pyx_v_istream = ((struct __pyx_obj_5pysox_3sox_CSoxStream *)PyTuple_GET_ITEM(__pyx_args, 0));
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysox.sox.CEffectsChain.__init__");
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_istream), __pyx_ptype_5pysox_3sox_CSoxStream, 1, "istream", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ostream), __pyx_ptype_5pysox_3sox_CSoxStream, 1, "ostream", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pysox/sox.pyx":747
 * 
 *         """
 *         self.effects = []             # <<<<<<<<<<<<<<
 *         self.haveInputEffect = False
 *         self.haveOutputEffect = False
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __Pyx_GOTREF(((struct __pyx_obj_5pysox_3sox_CEffectsChain *)__pyx_v_self)->effects);
  __Pyx_DECREF(((struct __pyx_obj_5pysox_3sox_CEffectsChain *)__pyx_v_self)->effects);
  ((struct __pyx_obj_5pysox_3sox_CEffectsChain *)__pyx_v_self)->effects = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pysox/sox.pyx":748
 *         """
 *         self.effects = []
 *         self.haveInputEffect = False             # <<<<<<<<<<<<<<
 *         self.haveOutputEffect = False
 *         self.inencoding = None
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(((struct __pyx_obj_5pysox_3sox_CEffectsChain *)__pyx_v_self)->haveInputEffect);
  __Pyx_DECREF(((struct __pyx_obj_5pysox_3sox_CEffectsChain *)__pyx_v_self)->haveInputEffect);
  ((struct __pyx_obj_5pysox_3sox_CEffectsChain *)__pyx_v_self)->haveInputEffect = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pysox/sox.pyx":749
 *         self.effects = []
 *         self.haveInputEffect = False
 *         self.haveOutputEffect = False             # <<<<<<<<<<<<<<
 *         self.inencoding = None
 *         self.outencoding = None
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(((struct __pyx_obj_5pysox_3sox_CEffectsChain *)__pyx_v_self)->haveOutputEffect);
  __Pyx_DECREF(((struct __pyx_obj_5pysox_3sox_CEffectsChain *)__pyx_v_self)->haveOutputEffect);
  ((struct __pyx_obj_5pysox_3sox_CEffectsChain *)__pyx_v_self)->haveOutputEffect = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pysox/sox.pyx":750
 *         self.haveInputEffect = False
 *         self.haveOutputEffect = False
 *         self.inencoding = None             # <<<<<<<<<<<<<<
 *         self.outencoding = None
 *         self.insignal = None
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(((struct __pyx_obj_5pysox_3sox_CEffectsChain *)__pyx_v_self)->inencoding);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_5pysox_3sox_CEffectsChain *)__pyx_v_self)->inencoding));
  ((struct __pyx_obj_5pysox_3sox_CEffectsChain *)__pyx_v_self)->inencoding = ((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)Py_None);

  /* "pysox/sox.pyx":751
 *         self.haveOutputEffect = False
 *         self.inencoding = None
 *         self.outencoding = None             # <<<<<<<<<<<<<<
 *         self.insignal = None
 *         self.outsignal = None
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(((struct __pyx_obj_5pysox_3sox_CEffectsChain *)__pyx_v_self)->outencoding);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_5pysox_3sox_CEffectsChain *)__pyx_v_self)->outencoding));
  ((struct __pyx_obj_5pysox_3sox_CEffectsChain *)__pyx_v_self)->outencoding = ((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)Py_None);

  /* "pysox/sox.pyx":752
 *         self.inencoding = None
 *         self.outencoding = None
 *         self.insignal = None             # <<<<<<<<<<<<<<
 *         self.outsignal = None
 *         self.chain = NULL
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(((struct __pyx_obj_5pysox_3sox_CEffectsChain *)__pyx_v_self)->insignal);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_5pysox_3sox_CEffectsChain *)__pyx_v_self)->insignal));
  ((struct __pyx_obj_5pysox_3sox_CEffectsChain *)__pyx_v_self)->insignal = ((struct __pyx_obj_5pysox_3sox_CSignalInfo *)Py_None);

  /* "pysox/sox.pyx":753
 *         self.outencoding = None
 *         self.insignal = None
 *         self.outsignal = None             # <<<<<<<<<<<<<<
 *         self.chain = NULL
 *         if istream:
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(((struct __pyx_obj_5pysox_3sox_CEffectsChain *)__pyx_v_self)->outsignal);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_5pysox_3sox_CEffectsChain *)__pyx_v_self)->outsignal));
  ((struct __pyx_obj_5pysox_3sox_CEffectsChain *)__pyx_v_self)->outsignal = ((struct __pyx_obj_5pysox_3sox_CSignalInfo *)Py_None);

  /* "pysox/sox.pyx":754
 *         self.insignal = None
 *         self.outsignal = None
 *         self.chain = NULL             # <<<<<<<<<<<<<<
 *         if istream:
 *             self.__setInput(istream)
 */
  ((struct __pyx_obj_5pysox_3sox_CEffectsChain *)__pyx_v_self)->chain = NULL;

  /* "pysox/sox.pyx":755
 *         self.outsignal = None
 *         self.chain = NULL
 *         if istream:             # <<<<<<<<<<<<<<
 *             self.__setInput(istream)
 *         if ostream:
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_istream)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {

    /* "pysox/sox.pyx":756
 *         self.chain = NULL
 *         if istream:
 *             self.__setInput(istream)             # <<<<<<<<<<<<<<
 *         if ostream:
 *             self.__setOutput(ostream)
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_5pysox_3sox_CEffectsChain *)((struct __pyx_obj_5pysox_3sox_CEffectsChain *)__pyx_v_self)->__pyx_vtab)->__setInput(((struct __pyx_obj_5pysox_3sox_CEffectsChain *)__pyx_v_self), __pyx_v_istream); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "pysox/sox.pyx":757
 *         if istream:
 *             self.__setInput(istream)
 *         if ostream:             # <<<<<<<<<<<<<<
 *             self.__setOutput(ostream)
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_ostream)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {

    /* "pysox/sox.pyx":758
 *             self.__setInput(istream)
 *         if ostream:
 *             self.__setOutput(ostream)             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_5pysox_3sox_CEffectsChain *)((struct __pyx_obj_5pysox_3sox_CEffectsChain *)__pyx_v_self)->__pyx_vtab)->__setOutput(((struct __pyx_obj_5pysox_3sox_CEffectsChain *)__pyx_v_self), __pyx_v_ostream); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L7;
  }
  __pyx_L7:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysox.sox.CEffectsChain.__init__");
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":760
 *             self.__setOutput(ostream)
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         self.__do_dealloc()
 * 
 */

static void __pyx_pf_5pysox_3sox_13CEffectsChain_1__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pf_5pysox_3sox_13CEffectsChain_1__dealloc__(PyObject *__pyx_v_self) {
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__dealloc__");

  /* "pysox/sox.pyx":761
 * 
 *     def __dealloc__(self):
 *         self.__do_dealloc()             # <<<<<<<<<<<<<<
 * 
 *     cdef __do_dealloc(self):
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pysox_3sox_CEffectsChain *)((struct __pyx_obj_5pysox_3sox_CEffectsChain *)__pyx_v_self)->__pyx_vtab)->__do_dealloc(((struct __pyx_obj_5pysox_3sox_CEffectsChain *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysox.sox.CEffectsChain.__dealloc__");
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pysox/sox.pyx":763
 *         self.__do_dealloc()
 * 
 *     cdef __do_dealloc(self):             # <<<<<<<<<<<<<<
 *         if not self.chain is NULL:
 *             csox.sox_delete_effects_chain(self.chain)
 */

static  PyObject *__pyx_f_5pysox_3sox_13CEffectsChain___do_dealloc(struct __pyx_obj_5pysox_3sox_CEffectsChain *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__do_dealloc");

  /* "pysox/sox.pyx":764
 * 
 *     cdef __do_dealloc(self):
 *         if not self.chain is NULL:             # <<<<<<<<<<<<<<
 *             csox.sox_delete_effects_chain(self.chain)
 *             self.chain = NULL
 */
  __pyx_t_1 = (!(__pyx_v_self->chain == NULL));
  if (__pyx_t_1) {

    /* "pysox/sox.pyx":765
 *     cdef __do_dealloc(self):
 *         if not self.chain is NULL:
 *             csox.sox_delete_effects_chain(self.chain)             # <<<<<<<<<<<<<<
 *             self.chain = NULL
 * 
 */
    sox_delete_effects_chain(__pyx_v_self->chain);

    /* "pysox/sox.pyx":766
 *         if not self.chain is NULL:
 *             csox.sox_delete_effects_chain(self.chain)
 *             self.chain = NULL             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
    __pyx_v_self->chain = NULL;
    goto __pyx_L3;
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":768
 *             self.chain = NULL
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return u'Ceffects_chain()'
 * 
 */

static PyObject *__pyx_pf_5pysox_3sox_13CEffectsChain_2__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_5pysox_3sox_13CEffectsChain_2__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannySetupContext("__repr__");

  /* "pysox/sox.pyx":769
 * 
 *     def __repr__(self):
 *         return u'Ceffects_chain()'             # <<<<<<<<<<<<<<
 * 
 *     cdef set_chain(self, csox.sox_effects_chain_t * chain):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_kp_u_25));
  __pyx_r = ((PyObject *)__pyx_kp_u_25);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":771
 *         return u'Ceffects_chain()'
 * 
 *     cdef set_chain(self, csox.sox_effects_chain_t * chain):             # <<<<<<<<<<<<<<
 *         self.chain = chain
 * 
 */

static  PyObject *__pyx_f_5pysox_3sox_13CEffectsChain_set_chain(struct __pyx_obj_5pysox_3sox_CEffectsChain *__pyx_v_self, sox_effects_chain_t *__pyx_v_chain) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannySetupContext("set_chain");

  /* "pysox/sox.pyx":772
 * 
 *     cdef set_chain(self, csox.sox_effects_chain_t * chain):
 *         self.chain = chain             # <<<<<<<<<<<<<<
 * 
 *     cdef csox.sox_effects_chain_t * get_chain(self):
 */
  __pyx_v_self->chain = __pyx_v_chain;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":774
 *         self.chain = chain
 * 
 *     cdef csox.sox_effects_chain_t * get_chain(self):             # <<<<<<<<<<<<<<
 *         return self.chain
 * 
 */

static  sox_effects_chain_t *__pyx_f_5pysox_3sox_13CEffectsChain_get_chain(struct __pyx_obj_5pysox_3sox_CEffectsChain *__pyx_v_self) {
  sox_effects_chain_t *__pyx_r;
  __Pyx_RefNannySetupContext("get_chain");

  /* "pysox/sox.pyx":775
 * 
 *     cdef csox.sox_effects_chain_t * get_chain(self):
 *         return self.chain             # <<<<<<<<<<<<<<
 * 
 *     cdef __create_effects_chain(self, CEncodingInfo inEncoding, CEncodingInfo outEncoding):
 */
  __pyx_r = __pyx_v_self->chain;
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":777
 *         return self.chain
 * 
 *     cdef __create_effects_chain(self, CEncodingInfo inEncoding, CEncodingInfo outEncoding):             # <<<<<<<<<<<<<<
 *         cdef csox.sox_encodinginfo_t * in_encoding = NULL
 *         cdef csox.sox_encodinginfo_t * out_encoding = NULL
 */

static  PyObject *__pyx_f_5pysox_3sox_13CEffectsChain___create_effects_chain(struct __pyx_obj_5pysox_3sox_CEffectsChain *__pyx_v_self, struct __pyx_obj_5pysox_3sox_CEncodingInfo *__pyx_v_inEncoding, struct __pyx_obj_5pysox_3sox_CEncodingInfo *__pyx_v_outEncoding) {
  sox_encodinginfo_t *__pyx_v_in_encoding;
  sox_encodinginfo_t *__pyx_v_out_encoding;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__create_effects_chain");

  /* "pysox/sox.pyx":778
 * 
 *     cdef __create_effects_chain(self, CEncodingInfo inEncoding, CEncodingInfo outEncoding):
 *         cdef csox.sox_encodinginfo_t * in_encoding = NULL             # <<<<<<<<<<<<<<
 *         cdef csox.sox_encodinginfo_t * out_encoding = NULL
 *         in_encoding = inEncoding.cget_encoding()
 */
  __pyx_v_in_encoding = NULL;

  /* "pysox/sox.pyx":779
 *     cdef __create_effects_chain(self, CEncodingInfo inEncoding, CEncodingInfo outEncoding):
 *         cdef csox.sox_encodinginfo_t * in_encoding = NULL
 *         cdef csox.sox_encodinginfo_t * out_encoding = NULL             # <<<<<<<<<<<<<<
 *         in_encoding = inEncoding.cget_encoding()
 *         if outEncoding:
 */
  __pyx_v_out_encoding = NULL;

  /* "pysox/sox.pyx":780
 *         cdef csox.sox_encodinginfo_t * in_encoding = NULL
 *         cdef csox.sox_encodinginfo_t * out_encoding = NULL
 *         in_encoding = inEncoding.cget_encoding()             # <<<<<<<<<<<<<<
 *         if outEncoding:
 *             out_encoding = outEncoding.cget_encoding()
 */
  __pyx_v_in_encoding = ((struct __pyx_vtabstruct_5pysox_3sox_CEncodingInfo *)__pyx_v_inEncoding->__pyx_vtab)->cget_encoding(__pyx_v_inEncoding);

  /* "pysox/sox.pyx":781
 *         cdef csox.sox_encodinginfo_t * out_encoding = NULL
 *         in_encoding = inEncoding.cget_encoding()
 *         if outEncoding:             # <<<<<<<<<<<<<<
 *             out_encoding = outEncoding.cget_encoding()
 *         else:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_outEncoding)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pysox/sox.pyx":782
 *         in_encoding = inEncoding.cget_encoding()
 *         if outEncoding:
 *             out_encoding = outEncoding.cget_encoding()             # <<<<<<<<<<<<<<
 *         else:
 *             out_encoding = in_encoding
 */
    __pyx_v_out_encoding = ((struct __pyx_vtabstruct_5pysox_3sox_CEncodingInfo *)__pyx_v_outEncoding->__pyx_vtab)->cget_encoding(__pyx_v_outEncoding);
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pysox/sox.pyx":784
 *             out_encoding = outEncoding.cget_encoding()
 *         else:
 *             out_encoding = in_encoding             # <<<<<<<<<<<<<<
 *         self.chain = csox.sox_create_effects_chain(in_encoding, out_encoding)
 * 
 */
    __pyx_v_out_encoding = __pyx_v_in_encoding;
  }
  __pyx_L3:;

  /* "pysox/sox.pyx":785
 *         else:
 *             out_encoding = in_encoding
 *         self.chain = csox.sox_create_effects_chain(in_encoding, out_encoding)             # <<<<<<<<<<<<<<
 * 
 *     cdef __setInput(self, CSoxStream istream):
 */
  __pyx_v_self->chain = sox_create_effects_chain(__pyx_v_in_encoding, __pyx_v_out_encoding);

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysox.sox.CEffectsChain.__create_effects_chain");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":787
 *         self.chain = csox.sox_create_effects_chain(in_encoding, out_encoding)
 * 
 *     cdef __setInput(self, CSoxStream istream):             # <<<<<<<<<<<<<<
 *         self.instream = istream
 *         self.inencoding = istream.get_encoding()
 */

static  PyObject *__pyx_f_5pysox_3sox_13CEffectsChain___setInput(struct __pyx_obj_5pysox_3sox_CEffectsChain *__pyx_v_self, struct __pyx_obj_5pysox_3sox_CSoxStream *__pyx_v_istream) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__setInput");

  /* "pysox/sox.pyx":788
 * 
 *     cdef __setInput(self, CSoxStream istream):
 *         self.instream = istream             # <<<<<<<<<<<<<<
 *         self.inencoding = istream.get_encoding()
 *         self.insignal = istream.get_signal() #get the object
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_istream));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_istream));
  __Pyx_GOTREF(__pyx_v_self->instream);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->instream));
  __pyx_v_self->instream = __pyx_v_istream;

  /* "pysox/sox.pyx":789
 *     cdef __setInput(self, CSoxStream istream):
 *         self.instream = istream
 *         self.inencoding = istream.get_encoding()             # <<<<<<<<<<<<<<
 *         self.insignal = istream.get_signal() #get the object
 * 
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_istream), __pyx_n_s__get_encoding); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5pysox_3sox_CEncodingInfo))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->inencoding);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->inencoding));
  __pyx_v_self->inencoding = ((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pysox/sox.pyx":790
 *         self.instream = istream
 *         self.inencoding = istream.get_encoding()
 *         self.insignal = istream.get_signal() #get the object             # <<<<<<<<<<<<<<
 * 
 *     cdef __setOutput(self, CSoxStream ostream):
 */
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_istream), __pyx_n_s__get_signal); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5pysox_3sox_CSignalInfo))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->insignal);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->insignal));
  __pyx_v_self->insignal = ((struct __pyx_obj_5pysox_3sox_CSignalInfo *)__pyx_t_1);
  __pyx_t_1 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysox.sox.CEffectsChain.__setInput");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":792
 *         self.insignal = istream.get_signal() #get the object
 * 
 *     cdef __setOutput(self, CSoxStream ostream):             # <<<<<<<<<<<<<<
 *         self.outstream = ostream
 *         self.outencoding = ostream.get_encoding()
 */

static  PyObject *__pyx_f_5pysox_3sox_13CEffectsChain___setOutput(struct __pyx_obj_5pysox_3sox_CEffectsChain *__pyx_v_self, struct __pyx_obj_5pysox_3sox_CSoxStream *__pyx_v_ostream) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__setOutput");

  /* "pysox/sox.pyx":793
 * 
 *     cdef __setOutput(self, CSoxStream ostream):
 *         self.outstream = ostream             # <<<<<<<<<<<<<<
 *         self.outencoding = ostream.get_encoding()
 *         self.outsignal = ostream.get_signal() #get the object
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_ostream));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_ostream));
  __Pyx_GOTREF(__pyx_v_self->outstream);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->outstream));
  __pyx_v_self->outstream = __pyx_v_ostream;

  /* "pysox/sox.pyx":794
 *     cdef __setOutput(self, CSoxStream ostream):
 *         self.outstream = ostream
 *         self.outencoding = ostream.get_encoding()             # <<<<<<<<<<<<<<
 *         self.outsignal = ostream.get_signal() #get the object
 * 
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_ostream), __pyx_n_s__get_encoding); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5pysox_3sox_CEncodingInfo))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->outencoding);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->outencoding));
  __pyx_v_self->outencoding = ((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pysox/sox.pyx":795
 *         self.outstream = ostream
 *         self.outencoding = ostream.get_encoding()
 *         self.outsignal = ostream.get_signal() #get the object             # <<<<<<<<<<<<<<
 * 
 *     cdef __calculate_signals(self):
 */
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_ostream), __pyx_n_s__get_signal); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5pysox_3sox_CSignalInfo))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->outsignal);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->outsignal));
  __pyx_v_self->outsignal = ((struct __pyx_obj_5pysox_3sox_CSignalInfo *)__pyx_t_1);
  __pyx_t_1 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysox.sox.CEffectsChain.__setOutput");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":797
 *         self.outsignal = ostream.get_signal() #get the object
 * 
 *     cdef __calculate_signals(self):             # <<<<<<<<<<<<<<
 *         """calculate the inputsignal parameters(sox.c combiner_signal)
 *         and retrieve the outputsignal parameters
 */

static  PyObject *__pyx_f_5pysox_3sox_13CEffectsChain___calculate_signals(struct __pyx_obj_5pysox_3sox_CEffectsChain *__pyx_v_self) {
  sox_effect_t *__pyx_v_effp;
  sox_signalinfo_t *__pyx_v_insignal;
  sox_signalinfo_t *__pyx_v_outsignal;
  int __pyx_v_inlength;
  int __pyx_v_outlength;
  struct __pyx_obj_5pysox_3sox_CEffect *__pyx_v_effect;
  PyObject *__pyx_r = NULL;
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  size_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("__calculate_signals");
  __pyx_v_effect = ((struct __pyx_obj_5pysox_3sox_CEffect *)Py_None); __Pyx_INCREF(Py_None);

  /* "pysox/sox.pyx":827
 *         cdef csox.sox_signalinfo_t * insignal
 *         cdef csox.sox_signalinfo_t * outsignal
 *         cdef int inlength = 0 #FIXME type?             # <<<<<<<<<<<<<<
 *         cdef int outlength = 0 #FIXME type?
 *         #fixme calc channels and rate
 */
  __pyx_v_inlength = 0;

  /* "pysox/sox.pyx":828
 *         cdef csox.sox_signalinfo_t * outsignal
 *         cdef int inlength = 0 #FIXME type?
 *         cdef int outlength = 0 #FIXME type?             # <<<<<<<<<<<<<<
 *         #fixme calc channels and rate
 *         cdef CEffect effect
 */
  __pyx_v_outlength = 0;

  /* "pysox/sox.pyx":831
 *         #fixme calc channels and rate
 *         cdef CEffect effect
 *         inlength = self.insignal.cget_signal().length             # <<<<<<<<<<<<<<
 *         outlength = self.outsignal.cget_signal().length
 * 
 */
  __pyx_v_inlength = ((struct __pyx_vtabstruct_5pysox_3sox_CSignalInfo *)__pyx_v_self->insignal->__pyx_vtab)->cget_signal(__pyx_v_self->insignal)->length;

  /* "pysox/sox.pyx":832
 *         cdef CEffect effect
 *         inlength = self.insignal.cget_signal().length
 *         outlength = self.outsignal.cget_signal().length             # <<<<<<<<<<<<<<
 * 
 *         for effect in self.effects:
 */
  __pyx_v_outlength = ((struct __pyx_vtabstruct_5pysox_3sox_CSignalInfo *)__pyx_v_self->outsignal->__pyx_vtab)->cget_signal(__pyx_v_self->outsignal)->length;

  /* "pysox/sox.pyx":834
 *         outlength = self.outsignal.cget_signal().length
 * 
 *         for effect in self.effects:             # <<<<<<<<<<<<<<
 *             effp = effect.get_effect()
 *             insignal = &effp.in_signal
 */
  if (PyList_CheckExact(__pyx_v_self->effects) || PyTuple_CheckExact(__pyx_v_self->effects)) {
    __pyx_t_1 = 0; __pyx_t_2 = __pyx_v_self->effects; __Pyx_INCREF(__pyx_t_2);
  } else {
    __pyx_t_1 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_self->effects); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
  }
  for (;;) {
    if (likely(PyList_CheckExact(__pyx_t_2))) {
      if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_2)) break;
      __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++;
    } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
      if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++;
    } else {
      __pyx_t_3 = PyIter_Next(__pyx_t_2);
      if (!__pyx_t_3) {
        if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5pysox_3sox_CEffect))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_v_effect));
    __pyx_v_effect = ((struct __pyx_obj_5pysox_3sox_CEffect *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "pysox/sox.pyx":835
 * 
 *         for effect in self.effects:
 *             effp = effect.get_effect()             # <<<<<<<<<<<<<<
 *             insignal = &effp.in_signal
 *             outsignal = &effp.out_signal
 */
    __pyx_v_effp = ((struct __pyx_vtabstruct_5pysox_3sox_CEffect *)__pyx_v_effect->__pyx_vtab)->get_effect(__pyx_v_effect);

    /* "pysox/sox.pyx":836
 *         for effect in self.effects:
 *             effp = effect.get_effect()
 *             insignal = &effp.in_signal             # <<<<<<<<<<<<<<
 *             outsignal = &effp.out_signal
 *             inlength = max(inlength, insignal.length)
 */
    __pyx_v_insignal = (&__pyx_v_effp->in_signal);

    /* "pysox/sox.pyx":837
 *             effp = effect.get_effect()
 *             insignal = &effp.in_signal
 *             outsignal = &effp.out_signal             # <<<<<<<<<<<<<<
 *             inlength = max(inlength, insignal.length)
 *             outlength = max(outlength, outsignal.length)
 */
    __pyx_v_outsignal = (&__pyx_v_effp->out_signal);

    /* "pysox/sox.pyx":838
 *             insignal = &effp.in_signal
 *             outsignal = &effp.out_signal
 *             inlength = max(inlength, insignal.length)             # <<<<<<<<<<<<<<
 *             outlength = max(outlength, outsignal.length)
 *             if effect.get_name()=='input':
 */
    __pyx_t_4 = __pyx_v_insignal->length;
    __pyx_t_5 = __pyx_v_inlength;
    if ((__pyx_t_4 > __pyx_t_5)) {
      __pyx_t_6 = __pyx_t_4;
    } else {
      __pyx_t_6 = __pyx_t_5;
    }
    __pyx_v_inlength = __pyx_t_6;

    /* "pysox/sox.pyx":839
 *             outsignal = &effp.out_signal
 *             inlength = max(inlength, insignal.length)
 *             outlength = max(outlength, outsignal.length)             # <<<<<<<<<<<<<<
 *             if effect.get_name()=='input':
 *                 inlength = max(inlength, outlength)
 */
    __pyx_t_6 = __pyx_v_outsignal->length;
    __pyx_t_5 = __pyx_v_outlength;
    if ((__pyx_t_6 > __pyx_t_5)) {
      __pyx_t_4 = __pyx_t_6;
    } else {
      __pyx_t_4 = __pyx_t_5;
    }
    __pyx_v_outlength = __pyx_t_4;

    /* "pysox/sox.pyx":840
 *             inlength = max(inlength, insignal.length)
 *             outlength = max(outlength, outsignal.length)
 *             if effect.get_name()=='input':             # <<<<<<<<<<<<<<
 *                 inlength = max(inlength, outlength)
 * 
 */
    __pyx_t_3 = ((struct __pyx_vtabstruct_5pysox_3sox_CEffect *)__pyx_v_effect->__pyx_vtab)->get_name(__pyx_v_effect, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = PyObject_RichCompare(__pyx_t_3, ((PyObject *)__pyx_n_s__input), Py_EQ); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (__pyx_t_8) {

      /* "pysox/sox.pyx":841
 *             outlength = max(outlength, outsignal.length)
 *             if effect.get_name()=='input':
 *                 inlength = max(inlength, outlength)             # <<<<<<<<<<<<<<
 * 
 *         if outlength==0:
 */
      __pyx_t_5 = __pyx_v_outlength;
      __pyx_t_9 = __pyx_v_inlength;
      if ((__pyx_t_5 > __pyx_t_9)) {
        __pyx_t_10 = __pyx_t_5;
      } else {
        __pyx_t_10 = __pyx_t_9;
      }
      __pyx_v_inlength = __pyx_t_10;
      goto __pyx_L5;
    }
    __pyx_L5:;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pysox/sox.pyx":843
 *                 inlength = max(inlength, outlength)
 * 
 *         if outlength==0:             # <<<<<<<<<<<<<<
 *             outlength=inlength
 *         # calculate ouput signal parameters
 */
  __pyx_t_8 = (__pyx_v_outlength == 0);
  if (__pyx_t_8) {

    /* "pysox/sox.pyx":844
 * 
 *         if outlength==0:
 *             outlength=inlength             # <<<<<<<<<<<<<<
 *         # calculate ouput signal parameters
 *         outsignal = self.outsignal.cget_signal()
 */
    __pyx_v_outlength = __pyx_v_inlength;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "pysox/sox.pyx":846
 *             outlength=inlength
 *         # calculate ouput signal parameters
 *         outsignal = self.outsignal.cget_signal()             # <<<<<<<<<<<<<<
 *         outsignal.length = outlength
 * 
 */
  __pyx_v_outsignal = ((struct __pyx_vtabstruct_5pysox_3sox_CSignalInfo *)__pyx_v_self->outsignal->__pyx_vtab)->cget_signal(__pyx_v_self->outsignal);

  /* "pysox/sox.pyx":847
 *         # calculate ouput signal parameters
 *         outsignal = self.outsignal.cget_signal()
 *         outsignal.length = outlength             # <<<<<<<<<<<<<<
 * 
 *     cdef void fixup_out_signal_length(self):
 */
  __pyx_v_outsignal->length = __pyx_v_outlength;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pysox.sox.CEffectsChain.__calculate_signals");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_effect);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":849
 *         outsignal.length = outlength
 * 
 *     cdef void fixup_out_signal_length(self):             # <<<<<<<<<<<<<<
 *         self.__calculate_signals()
 * 
 */

static  void __pyx_f_5pysox_3sox_13CEffectsChain_fixup_out_signal_length(struct __pyx_obj_5pysox_3sox_CEffectsChain *__pyx_v_self) {
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("fixup_out_signal_length");

  /* "pysox/sox.pyx":850
 * 
 *     cdef void fixup_out_signal_length(self):
 *         self.__calculate_signals()             # <<<<<<<<<<<<<<
 * 
 *     def add_effect(self, CEffect effect):
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pysox_3sox_CEffectsChain *)__pyx_v_self->__pyx_vtab)->__calculate_signals(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("pysox.sox.CEffectsChain.fixup_out_signal_length");
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pysox/sox.pyx":852
 *         self.__calculate_signals()
 * 
 *     def add_effect(self, CEffect effect):             # <<<<<<<<<<<<<<
 *         """Add an effect to the chain
 * 
 */

static PyObject *__pyx_pf_5pysox_3sox_13CEffectsChain_3add_effect(PyObject *__pyx_v_self, PyObject *__pyx_v_effect); /*proto*/
static char __pyx_doc_5pysox_3sox_13CEffectsChain_3add_effect[] = "Add an effect to the chain\n        \n        Args:\n            effect: CEffect object\n        ";
static PyObject *__pyx_pf_5pysox_3sox_13CEffectsChain_3add_effect(PyObject *__pyx_v_self, PyObject *__pyx_v_effect) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("add_effect");
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_effect), __pyx_ptype_5pysox_3sox_CEffect, 1, "effect", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pysox/sox.pyx":858
 *             effect: CEffect object
 *         """
 *         self.effects.append(effect)             # <<<<<<<<<<<<<<
 *         if effect.get_name() == 'input':
 *             self.haveInputEffect = True
 */
  __pyx_t_1 = __Pyx_PyObject_Append(((struct __pyx_obj_5pysox_3sox_CEffectsChain *)__pyx_v_self)->effects, __pyx_v_effect); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pysox/sox.pyx":859
 *         """
 *         self.effects.append(effect)
 *         if effect.get_name() == 'input':             # <<<<<<<<<<<<<<
 *             self.haveInputEffect = True
 *             self.inencoding = effect.get_in_encoding()
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pysox_3sox_CEffect *)((struct __pyx_obj_5pysox_3sox_CEffect *)__pyx_v_effect)->__pyx_vtab)->get_name(((struct __pyx_obj_5pysox_3sox_CEffect *)__pyx_v_effect), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, ((PyObject *)__pyx_n_s__input), Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pysox/sox.pyx":860
 *         self.effects.append(effect)
 *         if effect.get_name() == 'input':
 *             self.haveInputEffect = True             # <<<<<<<<<<<<<<
 *             self.inencoding = effect.get_in_encoding()
 *             self.insignal = effect.get_in_signal()
 */
    __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __Pyx_GOTREF(((struct __pyx_obj_5pysox_3sox_CEffectsChain *)__pyx_v_self)->haveInputEffect);
    __Pyx_DECREF(((struct __pyx_obj_5pysox_3sox_CEffectsChain *)__pyx_v_self)->haveInputEffect);
    ((struct __pyx_obj_5pysox_3sox_CEffectsChain *)__pyx_v_self)->haveInputEffect = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "pysox/sox.pyx":861
 *         if effect.get_name() == 'input':
 *             self.haveInputEffect = True
 *             self.inencoding = effect.get_in_encoding()             # <<<<<<<<<<<<<<
 *             self.insignal = effect.get_in_signal()
 *         if effect.get_name() == 'output':
 */
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_effect, __pyx_n_s__get_in_encoding); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5pysox_3sox_CEncodingInfo))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_GOTREF(((struct __pyx_obj_5pysox_3sox_CEffectsChain *)__pyx_v_self)->inencoding);
    __Pyx_DECREF(((PyObject *)((struct __pyx_obj_5pysox_3sox_CEffectsChain *)__pyx_v_self)->inencoding));
    ((struct __pyx_obj_5pysox_3sox_CEffectsChain *)__pyx_v_self)->inencoding = ((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "pysox/sox.pyx":862
 *             self.haveInputEffect = True
 *             self.inencoding = effect.get_in_encoding()
 *             self.insignal = effect.get_in_signal()             # <<<<<<<<<<<<<<
 *         if effect.get_name() == 'output':
 *             self.haveOutputEffect = True
 */
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_effect, __pyx_n_s__get_in_signal); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5pysox_3sox_CSignalInfo))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GIVEREF(__pyx_t_2);
    __Pyx_GOTREF(((struct __pyx_obj_5pysox_3sox_CEffectsChain *)__pyx_v_self)->insignal);
    __Pyx_DECREF(((PyObject *)((struct __pyx_obj_5pysox_3sox_CEffectsChain *)__pyx_v_self)->insignal));
    ((struct __pyx_obj_5pysox_3sox_CEffectsChain *)__pyx_v_self)->insignal = ((struct __pyx_obj_5pysox_3sox_CSignalInfo *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pysox/sox.pyx":863
 *             self.inencoding = effect.get_in_encoding()
 *             self.insignal = effect.get_in_signal()
 *         if effect.get_name() == 'output':             # <<<<<<<<<<<<<<
 *             self.haveOutputEffect = True
 *             self.outencoding = effect.get_out_encoding()
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_5pysox_3sox_CEffect *)((struct __pyx_obj_5pysox_3sox_CEffect *)__pyx_v_effect)->__pyx_vtab)->get_name(((struct __pyx_obj_5pysox_3sox_CEffect *)__pyx_v_effect), 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, ((PyObject *)__pyx_n_s__output), Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "pysox/sox.pyx":864
 *             self.insignal = effect.get_in_signal()
 *         if effect.get_name() == 'output':
 *             self.haveOutputEffect = True             # <<<<<<<<<<<<<<
 *             self.outencoding = effect.get_out_encoding()
 *             self.outsignal = effect.get_out_signal()
 */
    __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_GOTREF(((struct __pyx_obj_5pysox_3sox_CEffectsChain *)__pyx_v_self)->haveOutputEffect);
    __Pyx_DECREF(((struct __pyx_obj_5pysox_3sox_CEffectsChain *)__pyx_v_self)->haveOutputEffect);
    ((struct __pyx_obj_5pysox_3sox_CEffectsChain *)__pyx_v_self)->haveOutputEffect = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "pysox/sox.pyx":865
 *         if effect.get_name() == 'output':
 *             self.haveOutputEffect = True
 *             self.outencoding = effect.get_out_encoding()             # <<<<<<<<<<<<<<
 *             self.outsignal = effect.get_out_signal()
 * 
 */
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_effect, __pyx_n_s__get_out_encoding); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5pysox_3sox_CEncodingInfo))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GIVEREF(__pyx_t_2);
    __Pyx_GOTREF(((struct __pyx_obj_5pysox_3sox_CEffectsChain *)__pyx_v_self)->outencoding);
    __Pyx_DECREF(((PyObject *)((struct __pyx_obj_5pysox_3sox_CEffectsChain *)__pyx_v_self)->outencoding));
    ((struct __pyx_obj_5pysox_3sox_CEffectsChain *)__pyx_v_self)->outencoding = ((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pysox/sox.pyx":866
 *             self.haveOutputEffect = True
 *             self.outencoding = effect.get_out_encoding()
 *             self.outsignal = effect.get_out_signal()             # <<<<<<<<<<<<<<
 * 
 *     cdef int __init_effects(self) except -1:
 */
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_effect, __pyx_n_s__get_out_signal); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5pysox_3sox_CSignalInfo))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_GOTREF(((struct __pyx_obj_5pysox_3sox_CEffectsChain *)__pyx_v_self)->outsignal);
    __Pyx_DECREF(((PyObject *)((struct __pyx_obj_5pysox_3sox_CEffectsChain *)__pyx_v_self)->outsignal));
    ((struct __pyx_obj_5pysox_3sox_CEffectsChain *)__pyx_v_self)->outsignal = ((struct __pyx_obj_5pysox_3sox_CSignalInfo *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysox.sox.CEffectsChain.add_effect");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":868
 *             self.outsignal = effect.get_out_signal()
 * 
 *     cdef int __init_effects(self) except -1:             # <<<<<<<<<<<<<<
 *         """
 * static int process(void)
 */

static  int __pyx_f_5pysox_3sox_13CEffectsChain___init_effects(struct __pyx_obj_5pysox_3sox_CEffectsChain *__pyx_v_self) {
  struct __pyx_obj_5pysox_3sox_CEffect *__pyx_v_eff;
  struct __pyx_obj_5pysox_3sox_CEffect *__pyx_v_inputeffect;
  struct __pyx_obj_5pysox_3sox_CEffect *__pyx_v_outputeffect;
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("__init_effects");
  __pyx_v_eff = ((struct __pyx_obj_5pysox_3sox_CEffect *)Py_None); __Pyx_INCREF(Py_None);
  __pyx_v_inputeffect = ((struct __pyx_obj_5pysox_3sox_CEffect *)Py_None); __Pyx_INCREF(Py_None);
  __pyx_v_outputeffect = ((struct __pyx_obj_5pysox_3sox_CEffect *)Py_None); __Pyx_INCREF(Py_None);

  /* "pysox/sox.pyx":883
 *         """
 *         cdef CEffect eff
 *         if not self.haveInputEffect:             # <<<<<<<<<<<<<<
 *             if not self.instream:
 *                 raise PysoxError("neither instream nor an inputeffect are configured")
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->haveInputEffect); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = (!__pyx_t_1);
  if (__pyx_t_2) {

    /* "pysox/sox.pyx":884
 *         cdef CEffect eff
 *         if not self.haveInputEffect:
 *             if not self.instream:             # <<<<<<<<<<<<<<
 *                 raise PysoxError("neither instream nor an inputeffect are configured")
 *             inputeffect = CEffect("input", [self.instream])
 */
    __pyx_t_2 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->instream)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = (!__pyx_t_2);
    if (__pyx_t_1) {

      /* "pysox/sox.pyx":885
 *         if not self.haveInputEffect:
 *             if not self.instream:
 *                 raise PysoxError("neither instream nor an inputeffect are configured")             # <<<<<<<<<<<<<<
 *             inputeffect = CEffect("input", [self.instream])
 *             self.effects.insert(0, inputeffect)
 */
      __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__PysoxError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_27), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_Raise(__pyx_t_4, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L4;
    }
    __pyx_L4:;

    /* "pysox/sox.pyx":886
 *             if not self.instream:
 *                 raise PysoxError("neither instream nor an inputeffect are configured")
 *             inputeffect = CEffect("input", [self.instream])             # <<<<<<<<<<<<<<
 *             self.effects.insert(0, inputeffect)
 *             self.haveInputEffect = True
 */
    __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __Pyx_INCREF(((PyObject *)__pyx_v_self->instream));
    PyList_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self->instream));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self->instream));
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __Pyx_INCREF(((PyObject *)__pyx_n_s__input));
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_n_s__input));
    __Pyx_GIVEREF(((PyObject *)__pyx_n_s__input));
    PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_t_4));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
    __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pysox_3sox_CEffect)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_v_inputeffect));
    __pyx_v_inputeffect = ((struct __pyx_obj_5pysox_3sox_CEffect *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "pysox/sox.pyx":887
 *                 raise PysoxError("neither instream nor an inputeffect are configured")
 *             inputeffect = CEffect("input", [self.instream])
 *             self.effects.insert(0, inputeffect)             # <<<<<<<<<<<<<<
 *             self.haveInputEffect = True
 *         if not self.haveOutputEffect:
 */
    __pyx_t_4 = PyObject_GetAttr(__pyx_v_self->effects, __pyx_n_s__insert); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __Pyx_INCREF(__pyx_int_0);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_int_0);
    __Pyx_GIVEREF(__pyx_int_0);
    __Pyx_INCREF(((PyObject *)__pyx_v_inputeffect));
    PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_inputeffect));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_inputeffect));
    __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "pysox/sox.pyx":888
 *             inputeffect = CEffect("input", [self.instream])
 *             self.effects.insert(0, inputeffect)
 *             self.haveInputEffect = True             # <<<<<<<<<<<<<<
 *         if not self.haveOutputEffect:
 *             if not self.outstream:
 */
    __pyx_t_5 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __Pyx_GOTREF(__pyx_v_self->haveInputEffect);
    __Pyx_DECREF(__pyx_v_self->haveInputEffect);
    __pyx_v_self->haveInputEffect = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pysox/sox.pyx":889
 *             self.effects.insert(0, inputeffect)
 *             self.haveInputEffect = True
 *         if not self.haveOutputEffect:             # <<<<<<<<<<<<<<
 *             if not self.outstream:
 *                 raise PysoxError("neither outstream nor an outputeffect are configured")
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->haveOutputEffect); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = (!__pyx_t_1);
  if (__pyx_t_2) {

    /* "pysox/sox.pyx":890
 *             self.haveInputEffect = True
 *         if not self.haveOutputEffect:
 *             if not self.outstream:             # <<<<<<<<<<<<<<
 *                 raise PysoxError("neither outstream nor an outputeffect are configured")
 *             outputeffect = CEffect("output", [self.outstream])
 */
    __pyx_t_2 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->outstream)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = (!__pyx_t_2);
    if (__pyx_t_1) {

      /* "pysox/sox.pyx":891
 *         if not self.haveOutputEffect:
 *             if not self.outstream:
 *                 raise PysoxError("neither outstream nor an outputeffect are configured")             # <<<<<<<<<<<<<<
 *             outputeffect = CEffect("output", [self.outstream])
 *             self.effects.append(outputeffect)
 */
      __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__PysoxError); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_29), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_Raise(__pyx_t_3, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "pysox/sox.pyx":892
 *             if not self.outstream:
 *                 raise PysoxError("neither outstream nor an outputeffect are configured")
 *             outputeffect = CEffect("output", [self.outstream])             # <<<<<<<<<<<<<<
 *             self.effects.append(outputeffect)
 *             self.haveOutputEffect = True
 */
    __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __Pyx_INCREF(((PyObject *)__pyx_v_self->outstream));
    PyList_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self->outstream));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self->outstream));
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
    __Pyx_INCREF(((PyObject *)__pyx_n_s__output));
    PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_n_s__output));
    __Pyx_GIVEREF(((PyObject *)__pyx_n_s__output));
    PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_t_3));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
    __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pysox_3sox_CEffect)), ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_v_outputeffect));
    __pyx_v_outputeffect = ((struct __pyx_obj_5pysox_3sox_CEffect *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "pysox/sox.pyx":893
 *                 raise PysoxError("neither outstream nor an outputeffect are configured")
 *             outputeffect = CEffect("output", [self.outstream])
 *             self.effects.append(outputeffect)             # <<<<<<<<<<<<<<
 *             self.haveOutputEffect = True
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_Append(__pyx_v_self->effects, ((PyObject *)__pyx_v_outputeffect)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "pysox/sox.pyx":894
 *             outputeffect = CEffect("output", [self.outstream])
 *             self.effects.append(outputeffect)
 *             self.haveOutputEffect = True             # <<<<<<<<<<<<<<
 * 
 *         self.__calculate_signals()
 */
    __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __Pyx_GOTREF(__pyx_v_self->haveOutputEffect);
    __Pyx_DECREF(__pyx_v_self->haveOutputEffect);
    __pyx_v_self->haveOutputEffect = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pysox/sox.pyx":896
 *             self.haveOutputEffect = True
 * 
 *         self.__calculate_signals()             # <<<<<<<<<<<<<<
 * 
 *         self.__create_effects_chain(self.inencoding, self.outencoding)
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_5pysox_3sox_CEffectsChain *)__pyx_v_self->__pyx_vtab)->__calculate_signals(__pyx_v_self); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pysox/sox.pyx":898
 *         self.__calculate_signals()
 * 
 *         self.__create_effects_chain(self.inencoding, self.outencoding)             # <<<<<<<<<<<<<<
 *         for eff in self.effects:
 *             self.__init_effect(eff)
 */
  __pyx_t_3 = ((PyObject *)__pyx_v_self->inencoding);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_5 = ((PyObject *)__pyx_v_self->outencoding);
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_4 = ((struct __pyx_vtabstruct_5pysox_3sox_CEffectsChain *)__pyx_v_self->__pyx_vtab)->__create_effects_chain(__pyx_v_self, ((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)__pyx_t_3), ((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pysox/sox.pyx":899
 * 
 *         self.__create_effects_chain(self.inencoding, self.outencoding)
 *         for eff in self.effects:             # <<<<<<<<<<<<<<
 *             self.__init_effect(eff)
 *         return 0
 */
  if (PyList_CheckExact(__pyx_v_self->effects) || PyTuple_CheckExact(__pyx_v_self->effects)) {
    __pyx_t_6 = 0; __pyx_t_4 = __pyx_v_self->effects; __Pyx_INCREF(__pyx_t_4);
  } else {
    __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_self->effects); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
  }
  for (;;) {
    if (likely(PyList_CheckExact(__pyx_t_4))) {
      if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_4)) break;
      __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++;
    } else if (likely(PyTuple_CheckExact(__pyx_t_4))) {
      if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
      __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++;
    } else {
      __pyx_t_5 = PyIter_Next(__pyx_t_4);
      if (!__pyx_t_5) {
        if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5pysox_3sox_CEffect))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_v_eff));
    __pyx_v_eff = ((struct __pyx_obj_5pysox_3sox_CEffect *)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "pysox/sox.pyx":900
 *         self.__create_effects_chain(self.inencoding, self.outencoding)
 *         for eff in self.effects:
 *             self.__init_effect(eff)             # <<<<<<<<<<<<<<
 *         return 0
 * 
 */
    __pyx_t_7 = ((struct __pyx_vtabstruct_5pysox_3sox_CEffectsChain *)__pyx_v_self->__pyx_vtab)->__init_effect(__pyx_v_self, __pyx_v_eff); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pysox/sox.pyx":901
 *         for eff in self.effects:
 *             self.__init_effect(eff)
 *         return 0             # <<<<<<<<<<<<<<
 * 
 *     cdef int __init_effect(self, CEffect effect) except -1:
 */
  __pyx_r = 0;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pysox.sox.CEffectsChain.__init_effects");
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_eff);
  __Pyx_DECREF((PyObject *)__pyx_v_inputeffect);
  __Pyx_DECREF((PyObject *)__pyx_v_outputeffect);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":903
 *         return 0
 * 
 *     cdef int __init_effect(self, CEffect effect) except -1:             # <<<<<<<<<<<<<<
 *         cdef csox.sox_effect_t *effp
 *         effp = effect.get_effect()
 */

static  int __pyx_f_5pysox_3sox_13CEffectsChain___init_effect(struct __pyx_obj_5pysox_3sox_CEffectsChain *__pyx_v_self, struct __pyx_obj_5pysox_3sox_CEffect *__pyx_v_effect) {
  sox_effect_t *__pyx_v_effp;
  sox_signalinfo_t *__pyx_v_insignal;
  sox_signalinfo_t *__pyx_v_outsignal;
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__init_effect");

  /* "pysox/sox.pyx":905
 *     cdef int __init_effect(self, CEffect effect) except -1:
 *         cdef csox.sox_effect_t *effp
 *         effp = effect.get_effect()             # <<<<<<<<<<<<<<
 *         cdef csox.sox_signalinfo_t * insignal
 *         cdef csox.sox_signalinfo_t * outsignal
 */
  __pyx_v_effp = ((struct __pyx_vtabstruct_5pysox_3sox_CEffect *)__pyx_v_effect->__pyx_vtab)->get_effect(__pyx_v_effect);

  /* "pysox/sox.pyx":909
 *         cdef csox.sox_signalinfo_t * outsignal
 * 
 *         if not self.instream and not self.insignal:             # <<<<<<<<<<<<<<
 *             raise PysoxError("neither instream nor insignal are configured")
 *         insignal = self.insignal.cget_signal() #get struct
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->instream)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = (!__pyx_t_1);
  if (__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->insignal)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_3 = (!__pyx_t_1);
    __pyx_t_1 = __pyx_t_3;
  } else {
    __pyx_t_1 = __pyx_t_2;
  }
  if (__pyx_t_1) {

    /* "pysox/sox.pyx":910
 * 
 *         if not self.instream and not self.insignal:
 *             raise PysoxError("neither instream nor insignal are configured")             # <<<<<<<<<<<<<<
 *         insignal = self.insignal.cget_signal() #get struct
 *         if not self.outstream and not self.outsignal:
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__PysoxError); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_32), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pysox/sox.pyx":911
 *         if not self.instream and not self.insignal:
 *             raise PysoxError("neither instream nor insignal are configured")
 *         insignal = self.insignal.cget_signal() #get struct             # <<<<<<<<<<<<<<
 *         if not self.outstream and not self.outsignal:
 *             raise PysoxError("neither outstream nor outsignal are configured")
 */
  __pyx_v_insignal = ((struct __pyx_vtabstruct_5pysox_3sox_CSignalInfo *)__pyx_v_self->insignal->__pyx_vtab)->cget_signal(__pyx_v_self->insignal);

  /* "pysox/sox.pyx":912
 *             raise PysoxError("neither instream nor insignal are configured")
 *         insignal = self.insignal.cget_signal() #get struct
 *         if not self.outstream and not self.outsignal:             # <<<<<<<<<<<<<<
 *             raise PysoxError("neither outstream nor outsignal are configured")
 *         outsignal = self.outsignal.cget_signal() #get struct
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->outstream)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = (!__pyx_t_1);
  if (__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->outsignal)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_3 = (!__pyx_t_1);
    __pyx_t_1 = __pyx_t_3;
  } else {
    __pyx_t_1 = __pyx_t_2;
  }
  if (__pyx_t_1) {

    /* "pysox/sox.pyx":913
 *         insignal = self.insignal.cget_signal() #get struct
 *         if not self.outstream and not self.outsignal:
 *             raise PysoxError("neither outstream nor outsignal are configured")             # <<<<<<<<<<<<<<
 *         outsignal = self.outsignal.cget_signal() #get struct
 * 
 */
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__PysoxError); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_34), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pysox/sox.pyx":914
 *         if not self.outstream and not self.outsignal:
 *             raise PysoxError("neither outstream nor outsignal are configured")
 *         outsignal = self.outsignal.cget_signal() #get struct             # <<<<<<<<<<<<<<
 * 
 * #        print("adding effect with",effect.get_name() ,self.insignal, self.outsignal)
 */
  __pyx_v_outsignal = ((struct __pyx_vtabstruct_5pysox_3sox_CSignalInfo *)__pyx_v_self->outsignal->__pyx_vtab)->cget_signal(__pyx_v_self->outsignal);

  /* "pysox/sox.pyx":918
 * #        print("adding effect with",effect.get_name() ,self.insignal, self.outsignal)
 * #        print outsignal.length
 *         csox.sox_add_effect(self.chain, effp, insignal, outsignal)             # <<<<<<<<<<<<<<
 * #        print effp.in_signal.length, effp.out_signal.length
 *         return 0
 */
  sox_add_effect(__pyx_v_self->chain, __pyx_v_effp, __pyx_v_insignal, __pyx_v_outsignal);

  /* "pysox/sox.pyx":920
 *         csox.sox_add_effect(self.chain, effp, insignal, outsignal)
 * #        print effp.in_signal.length, effp.out_signal.length
 *         return 0             # <<<<<<<<<<<<<<
 * 
 *     cpdef int flow_effects(self, optimize_trim=True) except -1:
 */
  __pyx_r = 0;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pysox.sox.CEffectsChain.__init_effect");
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":922
 *         return 0
 * 
 *     cpdef int flow_effects(self, optimize_trim=True) except -1:             # <<<<<<<<<<<<<<
 *         """Flow samples through the effects processing chain until EOF is reached.
 * 
 */

static PyObject *__pyx_pf_5pysox_3sox_13CEffectsChain_4flow_effects(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static  int __pyx_f_5pysox_3sox_13CEffectsChain_flow_effects(struct __pyx_obj_5pysox_3sox_CEffectsChain *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_5pysox_3sox_13CEffectsChain_flow_effects *__pyx_optional_args) {
  PyObject *__pyx_v_optimize_trim = __pyx_k_35;
  int __pyx_r;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("flow_effects");
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_optimize_trim = __pyx_optional_args->optimize_trim;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__flow_effects); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_5pysox_3sox_13CEffectsChain_4flow_effects)) {
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __Pyx_INCREF(__pyx_v_optimize_trim);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_optimize_trim);
      __Pyx_GIVEREF(__pyx_v_optimize_trim);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_4;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pysox/sox.pyx":931
 *                 or chain is not valid anymore
 *         """
 *         self.__init_effects()             # <<<<<<<<<<<<<<
 *         if not self.chain:
 *             raise PysoxError('chain not valid')
 */
  __pyx_t_4 = ((struct __pyx_vtabstruct_5pysox_3sox_CEffectsChain *)__pyx_v_self->__pyx_vtab)->__init_effects(__pyx_v_self); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pysox/sox.pyx":932
 *         """
 *         self.__init_effects()
 *         if not self.chain:             # <<<<<<<<<<<<<<
 *             raise PysoxError('chain not valid')
 *         if optimize_trim:
 */
  __pyx_t_5 = (!(__pyx_v_self->chain != 0));
  if (__pyx_t_5) {

    /* "pysox/sox.pyx":933
 *         self.__init_effects()
 *         if not self.chain:
 *             raise PysoxError('chain not valid')             # <<<<<<<<<<<<<<
 *         if optimize_trim:
 *             self.__optimize_trim()
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__PysoxError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_37), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pysox/sox.pyx":934
 *         if not self.chain:
 *             raise PysoxError('chain not valid')
 *         if optimize_trim:             # <<<<<<<<<<<<<<
 *             self.__optimize_trim()
 *         csox.sox_flow_effects(self.chain, NULL, NULL)
 */
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_optimize_trim); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_5) {

    /* "pysox/sox.pyx":935
 *             raise PysoxError('chain not valid')
 *         if optimize_trim:
 *             self.__optimize_trim()             # <<<<<<<<<<<<<<
 *         csox.sox_flow_effects(self.chain, NULL, NULL)
 * #        print("flow done")
 */
    ((struct __pyx_vtabstruct_5pysox_3sox_CEffectsChain *)__pyx_v_self->__pyx_vtab)->__optimize_trim(__pyx_v_self);
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pysox/sox.pyx":936
 *         if optimize_trim:
 *             self.__optimize_trim()
 *         csox.sox_flow_effects(self.chain, NULL, NULL)             # <<<<<<<<<<<<<<
 * #        print("flow done")
 *         self.fixup_out_signal_length()
 */
  sox_flow_effects(__pyx_v_self->chain, NULL, NULL);

  /* "pysox/sox.pyx":938
 *         csox.sox_flow_effects(self.chain, NULL, NULL)
 * #        print("flow done")
 *         self.fixup_out_signal_length()             # <<<<<<<<<<<<<<
 *         self.__do_dealloc()
 *         return 0
 */
  ((struct __pyx_vtabstruct_5pysox_3sox_CEffectsChain *)__pyx_v_self->__pyx_vtab)->fixup_out_signal_length(__pyx_v_self);

  /* "pysox/sox.pyx":939
 * #        print("flow done")
 *         self.fixup_out_signal_length()
 *         self.__do_dealloc()             # <<<<<<<<<<<<<<
 *         return 0
 * 
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_5pysox_3sox_CEffectsChain *)__pyx_v_self->__pyx_vtab)->__do_dealloc(__pyx_v_self); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pysox/sox.pyx":940
 *         self.fixup_out_signal_length()
 *         self.__do_dealloc()
 *         return 0             # <<<<<<<<<<<<<<
 * 
 *     cdef int __optimize_trim(self):
 */
  __pyx_r = 0;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysox.sox.CEffectsChain.flow_effects");
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":922
 *         return 0
 * 
 *     cpdef int flow_effects(self, optimize_trim=True) except -1:             # <<<<<<<<<<<<<<
 *         """Flow samples through the effects processing chain until EOF is reached.
 * 
 */

static PyObject *__pyx_pf_5pysox_3sox_13CEffectsChain_4flow_effects(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pysox_3sox_13CEffectsChain_4flow_effects[] = "Flow samples through the effects processing chain until EOF is reached.\n        \n        Kwargs:\n            optimize_trim: boolean, default True\n        Raises:\n            PysoxError if configuration of chain is inconsistent\n                or chain is not valid anymore\n        ";
static PyObject *__pyx_pf_5pysox_3sox_13CEffectsChain_4flow_effects(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_optimize_trim = 0;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  struct __pyx_opt_args_5pysox_3sox_13CEffectsChain_flow_effects __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__optimize_trim,0};
  __Pyx_RefNannySetupContext("flow_effects");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[1] = {0};
    values[0] = __pyx_k_35;
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__optimize_trim);
        if (value) { values[0] = value; kw_args--; }
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "flow_effects") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_optimize_trim = values[0];
  } else {
    __pyx_v_optimize_trim = __pyx_k_35;
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  1: __pyx_v_optimize_trim = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("flow_effects", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysox.sox.CEffectsChain.flow_effects");
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.optimize_trim = __pyx_v_optimize_trim;
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pysox_3sox_CEffectsChain *)((struct __pyx_obj_5pysox_3sox_CEffectsChain *)__pyx_v_self)->__pyx_vtab)->flow_effects(((struct __pyx_obj_5pysox_3sox_CEffectsChain *)__pyx_v_self), 1, &__pyx_t_2); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysox.sox.CEffectsChain.flow_effects");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":942
 *         return 0
 * 
 *     cdef int __optimize_trim(self):             # <<<<<<<<<<<<<<
 *         """
 * if (input_count == 1 && effects_chain->length > 1 && strcmp(effects_chain->effects[1][0].handler.name, "trim") == 0) {
 */

static  int __pyx_f_5pysox_3sox_13CEffectsChain___optimize_trim(struct __pyx_obj_5pysox_3sox_CEffectsChain *__pyx_v_self) {
  uint64_t __pyx_v_offset;
  sox_format_t *__pyx_v_ft;
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("__optimize_trim");

  /* "pysox/sox.pyx":961
 *         cdef uint64_t offset
 *         cdef csox.sox_format_t * ft
 *         if not self.instream: #or not self.instream.is_seekable():             # <<<<<<<<<<<<<<
 *             return -1
 * 	# if we have a combiner as input, we won't have an instream??? FIXME
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->instream)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = (!__pyx_t_1);
  if (__pyx_t_2) {

    /* "pysox/sox.pyx":962
 *         cdef csox.sox_format_t * ft
 *         if not self.instream: #or not self.instream.is_seekable():
 *             return -1             # <<<<<<<<<<<<<<
 * 	# if we have a combiner as input, we won't have an instream??? FIXME
 * 	# check the number of input files on the instream FIXME
 */
    __pyx_r = -1;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pysox/sox.pyx":966
 * 	# check the number of input files on the instream FIXME
 * 
 *         ft = self.instream.get_ft()             # <<<<<<<<<<<<<<
 *         if self.chain.length > 1 and self.chain.effects[1][0].handler.name == b'trim' and \
 *             ft.handler.seek and ft.seekable:
 */
  __pyx_v_ft = ((struct __pyx_vtabstruct_5pysox_3sox_CSoxStream *)__pyx_v_self->instream->__pyx_vtab)->get_ft(__pyx_v_self->instream);

  /* "pysox/sox.pyx":967
 * 
 *         ft = self.instream.get_ft()
 *         if self.chain.length > 1 and self.chain.effects[1][0].handler.name == b'trim' and \             # <<<<<<<<<<<<<<
 *             ft.handler.seek and ft.seekable:
 *             offset = csox.sox_trim_get_start(&self.chain.effects[1][0])
 */
  __pyx_t_2 = (__pyx_v_self->chain->length > 1);
  if (__pyx_t_2) {
    __pyx_t_3 = PyBytes_FromString(((__pyx_v_self->chain->effects[1])[0]).handler.name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_4 = PyObject_RichCompare(((PyObject *)__pyx_t_3), ((PyObject *)__pyx_n_b__trim), Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_1) {

      /* "pysox/sox.pyx":968
 *         ft = self.instream.get_ft()
 *         if self.chain.length > 1 and self.chain.effects[1][0].handler.name == b'trim' and \
 *             ft.handler.seek and ft.seekable:             # <<<<<<<<<<<<<<
 *             offset = csox.sox_trim_get_start(&self.chain.effects[1][0])
 *             #seek
 */
      if ((__pyx_v_ft->handler.seek != 0)) {
        __pyx_t_5 = __pyx_v_ft->seekable;
      } else {
        __pyx_t_5 = (__pyx_v_ft->handler.seek != 0);
      }
      __pyx_t_6 = __pyx_t_5;
    } else {
      __pyx_t_6 = __pyx_t_1;
    }
    __pyx_t_1 = __pyx_t_6;
  } else {
    __pyx_t_1 = __pyx_t_2;
  }
  if (__pyx_t_1) {

    /* "pysox/sox.pyx":969
 *         if self.chain.length > 1 and self.chain.effects[1][0].handler.name == b'trim' and \
 *             ft.handler.seek and ft.seekable:
 *             offset = csox.sox_trim_get_start(&self.chain.effects[1][0])             # <<<<<<<<<<<<<<
 *             #seek
 *             if offset and csox.sox_seek(ft, offset, SOX_SEEK_SET) == SOX_SUCCESS:
 */
    __pyx_v_offset = sox_trim_get_start((&((__pyx_v_self->chain->effects[1])[0])));

    /* "pysox/sox.pyx":971
 *             offset = csox.sox_trim_get_start(&self.chain.effects[1][0])
 *             #seek
 *             if offset and csox.sox_seek(ft, offset, SOX_SEEK_SET) == SOX_SUCCESS:             # <<<<<<<<<<<<<<
 *                 csox.sox_trim_clear_start(&self.chain.effects[1][0]);
 *                 #print("__optimize_trim successful")
 */
    if (__pyx_v_offset) {
      __pyx_t_1 = (sox_seek(__pyx_v_ft, __pyx_v_offset, 0) == 0);
      __pyx_t_2 = __pyx_t_1;
    } else {
      __pyx_t_2 = __pyx_v_offset;
    }
    if (__pyx_t_2) {

      /* "pysox/sox.pyx":972
 *             #seek
 *             if offset and csox.sox_seek(ft, offset, SOX_SEEK_SET) == SOX_SUCCESS:
 *                 csox.sox_trim_clear_start(&self.chain.effects[1][0]);             # <<<<<<<<<<<<<<
 *                 #print("__optimize_trim successful")
 *                 return 0
 */
      sox_trim_clear_start((&((__pyx_v_self->chain->effects[1])[0])));

      /* "pysox/sox.pyx":974
 *                 csox.sox_trim_clear_start(&self.chain.effects[1][0]);
 *                 #print("__optimize_trim successful")
 *                 return 0             # <<<<<<<<<<<<<<
 *         return -1
 * 
 */
      __pyx_r = 0;
      goto __pyx_L0;
      goto __pyx_L5;
    }
    __pyx_L5:;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pysox/sox.pyx":975
 *                 #print("__optimize_trim successful")
 *                 return 0
 *         return -1             # <<<<<<<<<<<<<<
 * 
 * ################################################################################################
 */
  __pyx_r = -1;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("pysox.sox.CEffectsChain.__optimize_trim");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":1008
 *         TypeError if data is not bytes or an array
 *     """
 *     def __init__(self, data=None):             # <<<<<<<<<<<<<<
 *         """
 *         Raises:
 */

static int __pyx_pf_5pysox_3sox_15SoxSampleBuffer___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pysox_3sox_15SoxSampleBuffer___init__[] = "\n        Raises:\n            TypeError if data is not bytes or an array\n        ";
struct wrapperbase __pyx_wrapperbase_5pysox_3sox_15SoxSampleBuffer___init__;
static int __pyx_pf_5pysox_3sox_15SoxSampleBuffer___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_data = 0;
  int __pyx_r;
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__data,0};
  __Pyx_RefNannySetupContext("__init__");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_None);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__data);
        if (value) { values[0] = value; kw_args--; }
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_data = values[0];
  } else {
    __pyx_v_data = ((PyObject *)Py_None);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  1: __pyx_v_data = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysox.sox.SoxSampleBuffer.__init__");
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;

  /* "pysox/sox.pyx":1013
 *             TypeError if data is not bytes or an array
 *         """
 *         self.viewcount = 0             # <<<<<<<<<<<<<<
 *         # data must be factor of self.itemsize
 * 
 */
  ((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->viewcount = 0;

  /* "pysox/sox.pyx":1018
 *         # It is important not to store references to data after the constructor
 *         # as refcounting is checked on object buffers.
 *         self.buffer = NULL             # <<<<<<<<<<<<<<
 *         self.strides = NULL
 *         self.shape = NULL
 */
  ((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->buffer = NULL;

  /* "pysox/sox.pyx":1019
 *         # as refcounting is checked on object buffers.
 *         self.buffer = NULL
 *         self.strides = NULL             # <<<<<<<<<<<<<<
 *         self.shape = NULL
 *         self.release_ok = True
 */
  ((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->strides = NULL;

  /* "pysox/sox.pyx":1020
 *         self.buffer = NULL
 *         self.strides = NULL
 *         self.shape = NULL             # <<<<<<<<<<<<<<
 *         self.release_ok = True
 *         self.read_only = 0
 */
  ((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->shape = NULL;

  /* "pysox/sox.pyx":1021
 *         self.strides = NULL
 *         self.shape = NULL
 *         self.release_ok = True             # <<<<<<<<<<<<<<
 *         self.read_only = 0
 *         self.offset = 0
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->release_ok);
  __Pyx_DECREF(((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->release_ok);
  ((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->release_ok = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pysox/sox.pyx":1022
 *         self.shape = NULL
 *         self.release_ok = True
 *         self.read_only = 0             # <<<<<<<<<<<<<<
 *         self.offset = 0
 *         self.itemsize = sizeof(csox.sox_sample_t)
 */
  ((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->read_only = 0;

  /* "pysox/sox.pyx":1023
 *         self.release_ok = True
 *         self.read_only = 0
 *         self.offset = 0             # <<<<<<<<<<<<<<
 *         self.itemsize = sizeof(csox.sox_sample_t)
 *         self.format = self.get_default_format()
 */
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  __Pyx_GOTREF(((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->offset);
  __Pyx_DECREF(((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->offset);
  ((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->offset = __pyx_int_0;

  /* "pysox/sox.pyx":1024
 *         self.read_only = 0
 *         self.offset = 0
 *         self.itemsize = sizeof(csox.sox_sample_t)             # <<<<<<<<<<<<<<
 *         self.format = self.get_default_format()
 *         self.ndim = 1
 */
  ((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->itemsize = (sizeof(__pyx_t_5pysox_4csox_sox_sample_t));

  /* "pysox/sox.pyx":1025
 *         self.offset = 0
 *         self.itemsize = sizeof(csox.sox_sample_t)
 *         self.format = self.get_default_format()             # <<<<<<<<<<<<<<
 *         self.ndim = 1
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pysox_3sox_SoxSampleBuffer *)((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->__pyx_vtab)->get_default_format(((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->format);
  __Pyx_DECREF(((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->format);
  ((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->format = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pysox/sox.pyx":1026
 *         self.itemsize = sizeof(csox.sox_sample_t)
 *         self.format = self.get_default_format()
 *         self.ndim = 1             # <<<<<<<<<<<<<<
 * 
 *         if data:
 */
  ((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->ndim = 1;

  /* "pysox/sox.pyx":1028
 *         self.ndim = 1
 * 
 *         if data:             # <<<<<<<<<<<<<<
 *             self.__create_buffer(data), len(data)
 *         else:
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_data); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {

    /* "pysox/sox.pyx":1029
 * 
 *         if data:
 *             self.__create_buffer(data), len(data)             # <<<<<<<<<<<<<<
 *         else:
 *             self.set_buffer(NULL, 0)
 */
    __pyx_t_3 = ((struct __pyx_vtabstruct_5pysox_3sox_SoxSampleBuffer *)((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->__pyx_vtab)->__create_buffer(((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self), __pyx_v_data); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = PyInt_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_6));
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_1 = 0;
    __pyx_t_5 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pysox/sox.pyx":1031
 *             self.__create_buffer(data), len(data)
 *         else:
 *             self.set_buffer(NULL, 0)             # <<<<<<<<<<<<<<
 * 
 *         #self.buffer = self.create_buffer(data)
 */
    ((struct __pyx_vtabstruct_5pysox_3sox_SoxSampleBuffer *)((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->__pyx_vtab)->set_buffer(((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self), NULL, 0);
  }
  __pyx_L6:;

  /* "pysox/sox.pyx":1034
 * 
 *         #self.buffer = self.create_buffer(data)
 *         self.suboffsets = NULL             # <<<<<<<<<<<<<<
 * 
 *     cdef void set_buffer(self, csox.sox_sample_t* buffer, size_t lsamp):
 */
  ((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->suboffsets = NULL;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pysox.sox.SoxSampleBuffer.__init__");
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":1036
 *         self.suboffsets = NULL
 * 
 *     cdef void set_buffer(self, csox.sox_sample_t* buffer, size_t lsamp):             # <<<<<<<<<<<<<<
 *         """Set our buffer, len, ndim and shape.
 * 
 */

static  void __pyx_f_5pysox_3sox_15SoxSampleBuffer_set_buffer(struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *__pyx_v_self, __pyx_t_5pysox_4csox_sox_sample_t *__pyx_v_buffer, size_t __pyx_v_lsamp) {
  PyObject *__pyx_v_shape;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("set_buffer");
  __pyx_v_shape = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);

  /* "pysox/sox.pyx":1046
 *             size_t lsamp: number of samples
 *         """
 *         self.__do_dealloc_if()             # <<<<<<<<<<<<<<
 *         self.buffer = buffer
 *         self.must_dealloc_buffer = 0
 */
  ((struct __pyx_vtabstruct_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self->__pyx_vtab)->__do_dealloc_if(__pyx_v_self);

  /* "pysox/sox.pyx":1047
 *         """
 *         self.__do_dealloc_if()
 *         self.buffer = buffer             # <<<<<<<<<<<<<<
 *         self.must_dealloc_buffer = 0
 *         self.len = lsamp * self.itemsize
 */
  __pyx_v_self->buffer = __pyx_v_buffer;

  /* "pysox/sox.pyx":1048
 *         self.__do_dealloc_if()
 *         self.buffer = buffer
 *         self.must_dealloc_buffer = 0             # <<<<<<<<<<<<<<
 *         self.len = lsamp * self.itemsize
 *         self.datalen = self.len
 */
  __pyx_v_self->must_dealloc_buffer = 0;

  /* "pysox/sox.pyx":1049
 *         self.buffer = buffer
 *         self.must_dealloc_buffer = 0
 *         self.len = lsamp * self.itemsize             # <<<<<<<<<<<<<<
 *         self.datalen = self.len
 *         shape = (lsamp, )
 */
  __pyx_v_self->len = (__pyx_v_lsamp * __pyx_v_self->itemsize);

  /* "pysox/sox.pyx":1050
 *         self.must_dealloc_buffer = 0
 *         self.len = lsamp * self.itemsize
 *         self.datalen = self.len             # <<<<<<<<<<<<<<
 *         shape = (lsamp, )
 *         self.shape = self.list_to_sizebuf(shape)
 */
  __pyx_v_self->datalen = __pyx_v_self->len;

  /* "pysox/sox.pyx":1051
 *         self.len = lsamp * self.itemsize
 *         self.datalen = self.len
 *         shape = (lsamp, )             # <<<<<<<<<<<<<<
 *         self.shape = self.list_to_sizebuf(shape)
 *         self.strides = self.list_to_sizebuf([self.itemsize])
 */
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_lsamp); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_v_shape));
  __pyx_v_shape = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pysox/sox.pyx":1052
 *         self.datalen = self.len
 *         shape = (lsamp, )
 *         self.shape = self.list_to_sizebuf(shape)             # <<<<<<<<<<<<<<
 *         self.strides = self.list_to_sizebuf([self.itemsize])
 * 
 */
  __pyx_v_self->shape = ((struct __pyx_vtabstruct_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self->__pyx_vtab)->list_to_sizebuf(__pyx_v_self, ((PyObject *)__pyx_v_shape));

  /* "pysox/sox.pyx":1053
 *         shape = (lsamp, )
 *         self.shape = self.list_to_sizebuf(shape)
 *         self.strides = self.list_to_sizebuf([self.itemsize])             # <<<<<<<<<<<<<<
 * 
 *     cdef int __create_buffer(self, data) except -1:
 */
  __pyx_t_2 = PyInt_FromLong(__pyx_v_self->itemsize); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_v_self->strides = ((struct __pyx_vtabstruct_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self->__pyx_vtab)->list_to_sizebuf(__pyx_v_self, ((PyObject *)__pyx_t_1));
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("pysox.sox.SoxSampleBuffer.set_buffer");
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_shape);
  __Pyx_RefNannyFinishContext();
}

/* "pysox/sox.pyx":1055
 *         self.strides = self.list_to_sizebuf([self.itemsize])
 * 
 *     cdef int __create_buffer(self, data) except -1:             # <<<<<<<<<<<<<<
 *         """create our buffer from data
 *         Args:
 */

static  int __pyx_f_5pysox_3sox_15SoxSampleBuffer___create_buffer(struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *__pyx_v_self, PyObject *__pyx_v_data) {
  int __pyx_r;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("__create_buffer");

  /* "pysox/sox.pyx":1063
 *             TypeError
 *         """
 *         if data is None:             # <<<<<<<<<<<<<<
 *             self.must_dealloc_buffer = 0
 *         elif type(data) == type(bytearray()):
 */
  __pyx_t_1 = (__pyx_v_data == Py_None);
  if (__pyx_t_1) {

    /* "pysox/sox.pyx":1064
 *         """
 *         if data is None:
 *             self.must_dealloc_buffer = 0             # <<<<<<<<<<<<<<
 *         elif type(data) == type(bytearray()):
 *             self.frombytes(bytes(data))
 */
    __pyx_v_self->must_dealloc_buffer = 0;
    goto __pyx_L3;
  }

  /* "pysox/sox.pyx":1065
 *         if data is None:
 *             self.must_dealloc_buffer = 0
 *         elif type(data) == type(bytearray()):             # <<<<<<<<<<<<<<
 *             self.frombytes(bytes(data))
 *         elif not PY3 and type(data) == type(''):
 */
  __pyx_t_2 = PyObject_Call(__pyx_builtin_bytearray, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_data)), ((PyObject *)Py_TYPE(__pyx_t_2)), Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_1) {

    /* "pysox/sox.pyx":1066
 *             self.must_dealloc_buffer = 0
 *         elif type(data) == type(bytearray()):
 *             self.frombytes(bytes(data))             # <<<<<<<<<<<<<<
 *         elif not PY3 and type(data) == type(''):
 *             self.frombytes(bytes(data))
 */
    __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__frombytes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __Pyx_INCREF(__pyx_v_data);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_data);
    __Pyx_GIVEREF(__pyx_v_data);
    __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)(&PyBytes_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L3;
  }

  /* "pysox/sox.pyx":1067
 *         elif type(data) == type(bytearray()):
 *             self.frombytes(bytes(data))
 *         elif not PY3 and type(data) == type(''):             # <<<<<<<<<<<<<<
 *             self.frombytes(bytes(data))
 *         elif type(data) == type(b''):
 */
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__PY3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_5 = (!__pyx_t_1);
  if (__pyx_t_5) {
    __pyx_t_4 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_data)), ((PyObject *)Py_TYPE(((PyObject *)__pyx_kp_s_5))), Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = __pyx_t_1;
  } else {
    __pyx_t_6 = __pyx_t_5;
  }
  if (__pyx_t_6) {

    /* "pysox/sox.pyx":1068
 *             self.frombytes(bytes(data))
 *         elif not PY3 and type(data) == type(''):
 *             self.frombytes(bytes(data))             # <<<<<<<<<<<<<<
 *         elif type(data) == type(b''):
 *             self.frombytes(data)
 */
    __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__frombytes); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __Pyx_INCREF(__pyx_v_data);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_data);
    __Pyx_GIVEREF(__pyx_v_data);
    __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PyBytes_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L3;
  }

  /* "pysox/sox.pyx":1069
 *         elif not PY3 and type(data) == type(''):
 *             self.frombytes(bytes(data))
 *         elif type(data) == type(b''):             # <<<<<<<<<<<<<<
 *             self.frombytes(data)
 * # not 2.6
 */
  __pyx_t_3 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_data)), ((PyObject *)Py_TYPE(((PyObject *)__pyx_kp_b_5))), Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_6) {

    /* "pysox/sox.pyx":1070
 *             self.frombytes(bytes(data))
 *         elif type(data) == type(b''):
 *             self.frombytes(data)             # <<<<<<<<<<<<<<
 * # not 2.6
 * #        elif type(data) == type(memoryview(b'')):
 */
    __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__frombytes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __Pyx_INCREF(__pyx_v_data);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_data);
    __Pyx_GIVEREF(__pyx_v_data);
    __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L3;
  }

  /* "pysox/sox.pyx":1074
 * #        elif type(data) == type(memoryview(b'')):
 * #            self.frombytes(data.tobytes())
 *         elif type(data) == type([]):             # <<<<<<<<<<<<<<
 *             self.fromlist(data)
 *         else:
 */
  __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __pyx_t_2 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_data)), ((PyObject *)Py_TYPE(((PyObject *)__pyx_t_4))), Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_6) {

    /* "pysox/sox.pyx":1075
 * #            self.frombytes(data.tobytes())
 *         elif type(data) == type([]):
 *             self.fromlist(data)             # <<<<<<<<<<<<<<
 *         else:
 *             raise TypeError("need bytes, bytearray, memoryview or list of integers")
 */
    __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__fromlist); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __Pyx_INCREF(__pyx_v_data);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_data);
    __Pyx_GIVEREF(__pyx_v_data);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pysox/sox.pyx":1077
 *             self.fromlist(data)
 *         else:
 *             raise TypeError("need bytes, bytearray, memoryview or list of integers")             # <<<<<<<<<<<<<<
 *         return 0
 * 
 */
    __pyx_t_3 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_40), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  /* "pysox/sox.pyx":1078
 *         else:
 *             raise TypeError("need bytes, bytearray, memoryview or list of integers")
 *         return 0             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __pyx_r = 0;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pysox.sox.SoxSampleBuffer.__create_buffer");
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":1080
 *         return 0
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         self.__do_dealloc_if()
 * 
 */

static void __pyx_pf_5pysox_3sox_15SoxSampleBuffer_1__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pf_5pysox_3sox_15SoxSampleBuffer_1__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannySetupContext("__dealloc__");

  /* "pysox/sox.pyx":1081
 * 
 *     def __dealloc__(self):
 *         self.__do_dealloc_if()             # <<<<<<<<<<<<<<
 * 
 *     cdef void __do_dealloc_if(self):
 */
  ((struct __pyx_vtabstruct_5pysox_3sox_SoxSampleBuffer *)((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->__pyx_vtab)->__do_dealloc_if(((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self));

  __Pyx_RefNannyFinishContext();
}

/* "pysox/sox.pyx":1083
 *         self.__do_dealloc_if()
 * 
 *     cdef void __do_dealloc_if(self):             # <<<<<<<<<<<<<<
 *         if self.viewcount > 0:
 *             #somebody holds a reference, we must not change our state
 */

static  void __pyx_f_5pysox_3sox_15SoxSampleBuffer___do_dealloc_if(struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *__pyx_v_self) {
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__do_dealloc_if");

  /* "pysox/sox.pyx":1084
 * 
 *     cdef void __do_dealloc_if(self):
 *         if self.viewcount > 0:             # <<<<<<<<<<<<<<
 *             #somebody holds a reference, we must not change our state
 *             return
 */
  __pyx_t_1 = (__pyx_v_self->viewcount > 0);
  if (__pyx_t_1) {

    /* "pysox/sox.pyx":1086
 *         if self.viewcount > 0:
 *             #somebody holds a reference, we must not change our state
 *             return             # <<<<<<<<<<<<<<
 *         if self.strides:
 *             stdlib.free(self.strides)
 */
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pysox/sox.pyx":1087
 *             #somebody holds a reference, we must not change our state
 *             return
 *         if self.strides:             # <<<<<<<<<<<<<<
 *             stdlib.free(self.strides)
 *             self.strides = NULL
 */
  __pyx_t_1 = (__pyx_v_self->strides != 0);
  if (__pyx_t_1) {

    /* "pysox/sox.pyx":1088
 *             return
 *         if self.strides:
 *             stdlib.free(self.strides)             # <<<<<<<<<<<<<<
 *             self.strides = NULL
 *         if self.shape:
 */
    free(__pyx_v_self->strides);

    /* "pysox/sox.pyx":1089
 *         if self.strides:
 *             stdlib.free(self.strides)
 *             self.strides = NULL             # <<<<<<<<<<<<<<
 *         if self.shape:
 *             stdlib.free(self.shape)
 */
    __pyx_v_self->strides = NULL;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pysox/sox.pyx":1090
 *             stdlib.free(self.strides)
 *             self.strides = NULL
 *         if self.shape:             # <<<<<<<<<<<<<<
 *             stdlib.free(self.shape)
 *             self.shape = NULL
 */
  __pyx_t_1 = (__pyx_v_self->shape != 0);
  if (__pyx_t_1) {

    /* "pysox/sox.pyx":1091
 *             self.strides = NULL
 *         if self.shape:
 *             stdlib.free(self.shape)             # <<<<<<<<<<<<<<
 *             self.shape = NULL
 *         if self.buffer and self.must_dealloc_buffer:
 */
    free(__pyx_v_self->shape);

    /* "pysox/sox.pyx":1092
 *         if self.shape:
 *             stdlib.free(self.shape)
 *             self.shape = NULL             # <<<<<<<<<<<<<<
 *         if self.buffer and self.must_dealloc_buffer:
 *             stdlib.free(self.buffer)
 */
    __pyx_v_self->shape = NULL;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pysox/sox.pyx":1093
 *             stdlib.free(self.shape)
 *             self.shape = NULL
 *         if self.buffer and self.must_dealloc_buffer:             # <<<<<<<<<<<<<<
 *             stdlib.free(self.buffer)
 *             self.buffer = NULL
 */
  if ((__pyx_v_self->buffer != 0)) {
    __pyx_t_1 = __pyx_v_self->must_dealloc_buffer;
  } else {
    __pyx_t_1 = (__pyx_v_self->buffer != 0);
  }
  if (__pyx_t_1) {

    /* "pysox/sox.pyx":1094
 *             self.shape = NULL
 *         if self.buffer and self.must_dealloc_buffer:
 *             stdlib.free(self.buffer)             # <<<<<<<<<<<<<<
 *             self.buffer = NULL
 *             self.must_dealloc_buffer = 0
 */
    free(__pyx_v_self->buffer);

    /* "pysox/sox.pyx":1095
 *         if self.buffer and self.must_dealloc_buffer:
 *             stdlib.free(self.buffer)
 *             self.buffer = NULL             # <<<<<<<<<<<<<<
 *             self.must_dealloc_buffer = 0
 * 
 */
    __pyx_v_self->buffer = NULL;

    /* "pysox/sox.pyx":1096
 *             stdlib.free(self.buffer)
 *             self.buffer = NULL
 *             self.must_dealloc_buffer = 0             # <<<<<<<<<<<<<<
 * 
 *     cdef int write(self, csox.sox_sample_t* buf, object value) except -1:
 */
    __pyx_v_self->must_dealloc_buffer = 0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pysox/sox.pyx":1098
 *             self.must_dealloc_buffer = 0
 * 
 *     cdef int write(self, csox.sox_sample_t* buf, object value) except -1:             # <<<<<<<<<<<<<<
 *         (<csox.sox_sample_t*>buf)[0] = <csox.sox_sample_t>value
 *         return 0
 */

static  int __pyx_f_5pysox_3sox_15SoxSampleBuffer_write(struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *__pyx_v_self, __pyx_t_5pysox_4csox_sox_sample_t *__pyx_v_buf, PyObject *__pyx_v_value) {
  int __pyx_r;
  __pyx_t_5pysox_4csox_sox_sample_t __pyx_t_1;
  __Pyx_RefNannySetupContext("write");

  /* "pysox/sox.pyx":1099
 * 
 *     cdef int write(self, csox.sox_sample_t* buf, object value) except -1:
 *         (<csox.sox_sample_t*>buf)[0] = <csox.sox_sample_t>value             # <<<<<<<<<<<<<<
 *         return 0
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_from_py_int32_t(__pyx_v_value); if (unlikely((__pyx_t_1 == (int32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  (((__pyx_t_5pysox_4csox_sox_sample_t *)__pyx_v_buf)[0]) = __pyx_t_1;

  /* "pysox/sox.pyx":1100
 *     cdef int write(self, csox.sox_sample_t* buf, object value) except -1:
 *         (<csox.sox_sample_t*>buf)[0] = <csox.sox_sample_t>value
 *         return 0             # <<<<<<<<<<<<<<
 * 
 *     cdef get_default_format(self): return b"@i"
 */
  __pyx_r = 0;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysox.sox.SoxSampleBuffer.write");
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":1102
 *         return 0
 * 
 *     cdef get_default_format(self): return b"@i"             # <<<<<<<<<<<<<<
 * 
 *     cdef Py_ssize_t* list_to_sizebuf(self, l):
 */

static  PyObject *__pyx_f_5pysox_3sox_15SoxSampleBuffer_get_default_format(struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannySetupContext("get_default_format");
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_kp_b_41));
  __pyx_r = ((PyObject *)__pyx_kp_b_41);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":1104
 *     cdef get_default_format(self): return b"@i"
 * 
 *     cdef Py_ssize_t* list_to_sizebuf(self, l):             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t* buf = <Py_ssize_t*>stdlib.malloc(len(l) * sizeof(Py_ssize_t))
 *         for i, x in enumerate(l):
 */

static  Py_ssize_t *__pyx_f_5pysox_3sox_15SoxSampleBuffer_list_to_sizebuf(struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *__pyx_v_self, PyObject *__pyx_v_l) {
  Py_ssize_t *__pyx_v_buf;
  PyObject *__pyx_v_i;
  PyObject *__pyx_v_x;
  Py_ssize_t *__pyx_r;
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  __Pyx_RefNannySetupContext("list_to_sizebuf");
  __pyx_v_i = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_x = Py_None; __Pyx_INCREF(Py_None);

  /* "pysox/sox.pyx":1105
 * 
 *     cdef Py_ssize_t* list_to_sizebuf(self, l):
 *         cdef Py_ssize_t* buf = <Py_ssize_t*>stdlib.malloc(len(l) * sizeof(Py_ssize_t))             # <<<<<<<<<<<<<<
 *         for i, x in enumerate(l):
 *             buf[i] = x
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_l); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_buf = ((Py_ssize_t *)malloc((__pyx_t_1 * (sizeof(Py_ssize_t)))));

  /* "pysox/sox.pyx":1106
 *     cdef Py_ssize_t* list_to_sizebuf(self, l):
 *         cdef Py_ssize_t* buf = <Py_ssize_t*>stdlib.malloc(len(l) * sizeof(Py_ssize_t))
 *         for i, x in enumerate(l):             # <<<<<<<<<<<<<<
 *             buf[i] = x
 *         return buf
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_t_2 = __pyx_int_0;
  if (PyList_CheckExact(__pyx_v_l) || PyTuple_CheckExact(__pyx_v_l)) {
    __pyx_t_1 = 0; __pyx_t_3 = __pyx_v_l; __Pyx_INCREF(__pyx_t_3);
  } else {
    __pyx_t_1 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_l); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
  }
  for (;;) {
    if (likely(PyList_CheckExact(__pyx_t_3))) {
      if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_3)) break;
      __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_4); __pyx_t_1++;
    } else if (likely(PyTuple_CheckExact(__pyx_t_3))) {
      if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
      __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_4); __pyx_t_1++;
    } else {
      __pyx_t_4 = PyIter_Next(__pyx_t_3);
      if (!__pyx_t_4) {
        if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_DECREF(__pyx_v_x);
    __pyx_v_x = __pyx_t_4;
    __pyx_t_4 = 0;
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_v_i);
    __pyx_v_i = __pyx_t_2;
    __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2);
    __pyx_t_2 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "pysox/sox.pyx":1107
 *         cdef Py_ssize_t* buf = <Py_ssize_t*>stdlib.malloc(len(l) * sizeof(Py_ssize_t))
 *         for i, x in enumerate(l):
 *             buf[i] = x             # <<<<<<<<<<<<<<
 *         return buf
 * 
 */
    __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_x); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    (__pyx_v_buf[__pyx_t_6]) = __pyx_t_5;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pysox/sox.pyx":1108
 *         for i, x in enumerate(l):
 *             buf[i] = x
 *         return buf             # <<<<<<<<<<<<<<
 * 
 *     #
 */
  __pyx_r = __pyx_v_buf;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("pysox.sox.SoxSampleBuffer.list_to_sizebuf");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_i);
  __Pyx_DECREF(__pyx_v_x);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":1116
 * #        print("getbuffer")
 *         cdef int value
 *         def testflag(flagname,flags):             # <<<<<<<<<<<<<<
 *             return flagname in received_flags
 *         received_flags = []
 */

static PyObject *__pyx_pf_5pysox_3sox_13__getbuffer___testflag(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5pysox_3sox_13__getbuffer___testflag = {__Pyx_NAMESTR("testflag"), (PyCFunction)__pyx_pf_5pysox_3sox_13__getbuffer___testflag, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_5pysox_3sox_13__getbuffer___testflag(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_5pysox_3sox___pyx_scope_struct____getbuffer__ *__pyx_cur_scope;
  struct __pyx_obj_5pysox_3sox___pyx_scope_struct____getbuffer__ *__pyx_outer_scope;
  PyObject *__pyx_v_flagname = 0;
  PyObject *__pyx_v_flags = 0;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__flagname,&__pyx_n_s__flags,0};
  __Pyx_RefNannySetupContext("testflag");
  __pyx_outer_scope = (struct __pyx_obj_5pysox_3sox___pyx_scope_struct____getbuffer__ *)__pyx_self;
  __pyx_cur_scope = __pyx_outer_scope;
  __pyx_self = __pyx_self;
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[2] = {0,0};
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__flagname);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__flags);
      if (likely(values[1])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("testflag", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "testflag") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_flagname = values[0];
    __pyx_v_flags = values[1];
  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
    goto __pyx_L5_argtuple_error;
  } else {
    __pyx_v_flagname = PyTuple_GET_ITEM(__pyx_args, 0);
    __pyx_v_flags = PyTuple_GET_ITEM(__pyx_args, 1);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("testflag", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysox.sox.__getbuffer__.testflag");
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "pysox/sox.pyx":1117
 *         cdef int value
 *         def testflag(flagname,flags):
 *             return flagname in received_flags             # <<<<<<<<<<<<<<
 *         received_flags = []
 *         for name, value in available_flags:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PySequence_Contains(__pyx_cur_scope->__pyx_v_received_flags, __pyx_v_flagname))); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysox.sox.__getbuffer__.testflag");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":1113
 *     # Buffer interface
 *     #
 *     def __getbuffer__(SoxSampleBuffer self, Py_buffer* buffer, int flags):             # <<<<<<<<<<<<<<
 * #        print("getbuffer")
 *         cdef int value
 */

static CYTHON_UNUSED int __pyx_pf_5pysox_3sox_15SoxSampleBuffer_2__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_buffer, int __pyx_v_flags); /*proto*/
static CYTHON_UNUSED int __pyx_pf_5pysox_3sox_15SoxSampleBuffer_2__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_buffer, int __pyx_v_flags) {
  struct __pyx_obj_5pysox_3sox___pyx_scope_struct____getbuffer__ *__pyx_cur_scope;
  int __pyx_v_value;
  PyObject *__pyx_v_testflag;
  PyObject *__pyx_v_name;
  int __pyx_r;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  char *__pyx_t_9;
  __Pyx_RefNannySetupContext("__getbuffer__");
  if (__pyx_v_buffer == NULL) return 0;
  __pyx_v_buffer->obj = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(__pyx_v_buffer->obj);
  __pyx_cur_scope = (struct __pyx_obj_5pysox_3sox___pyx_scope_struct____getbuffer__ *)__pyx_ptype_5pysox_3sox___pyx_scope_struct____getbuffer__->tp_new(__pyx_ptype_5pysox_3sox___pyx_scope_struct____getbuffer__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_GOTREF(__pyx_v_buffer->obj);
    __Pyx_DECREF(__pyx_v_buffer->obj); __pyx_v_buffer->obj = NULL;
    __Pyx_RefNannyFinishContext();
    return -1;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_v_testflag = Py_None; __Pyx_INCREF(Py_None);
  __pyx_cur_scope->__pyx_v_received_flags = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_name = Py_None; __Pyx_INCREF(Py_None);

  /* "pysox/sox.pyx":1116
 * #        print("getbuffer")
 *         cdef int value
 *         def testflag(flagname,flags):             # <<<<<<<<<<<<<<
 *             return flagname in received_flags
 *         received_flags = []
 */
  __pyx_t_1 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_5pysox_3sox_13__getbuffer___testflag, ((PyObject*)__pyx_cur_scope), __pyx_n_s_42); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_v_testflag);
  __pyx_v_testflag = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pysox/sox.pyx":1118
 *         def testflag(flagname,flags):
 *             return flagname in received_flags
 *         received_flags = []             # <<<<<<<<<<<<<<
 *         for name, value in available_flags:
 *             if (value & flags) == value:
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_DECREF(__pyx_cur_scope->__pyx_v_received_flags);
  __pyx_cur_scope->__pyx_v_received_flags = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pysox/sox.pyx":1119
 *             return flagname in received_flags
 *         received_flags = []
 *         for name, value in available_flags:             # <<<<<<<<<<<<<<
 *             if (value & flags) == value:
 *                 received_flags.append(name)
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__available_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = 0; __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3);
  } else {
    __pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(PyList_CheckExact(__pyx_t_3))) {
      if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break;
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++;
    } else if (likely(PyTuple_CheckExact(__pyx_t_3))) {
      if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++;
    } else {
      __pyx_t_1 = PyIter_Next(__pyx_t_3);
      if (!__pyx_t_1) {
        if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    if (PyTuple_CheckExact(__pyx_t_1) && likely(PyTuple_GET_SIZE(__pyx_t_1) == 2)) {
      PyObject* tuple = __pyx_t_1;
      __pyx_t_4 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_t_5); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_v_name);
      __pyx_v_name = __pyx_t_4;
      __pyx_t_4 = 0;
      __pyx_v_value = __pyx_t_6;
    } else {
      __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_4 = __Pyx_UnpackItem(__pyx_t_7, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_UnpackItem(__pyx_t_7, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_t_5); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__Pyx_EndUnpack(__pyx_t_7, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_v_name);
      __pyx_v_name = __pyx_t_4;
      __pyx_t_4 = 0;
      __pyx_v_value = __pyx_t_6;
    }

    /* "pysox/sox.pyx":1120
 *         received_flags = []
 *         for name, value in available_flags:
 *             if (value & flags) == value:             # <<<<<<<<<<<<<<
 *                 received_flags.append(name)
 * 
 */
    __pyx_t_8 = ((__pyx_v_value & __pyx_v_flags) == __pyx_v_value);
    if (__pyx_t_8) {

      /* "pysox/sox.pyx":1121
 *         for name, value in available_flags:
 *             if (value & flags) == value:
 *                 received_flags.append(name)             # <<<<<<<<<<<<<<
 * 
 *         self.viewcount += 1
 */
      __pyx_t_1 = __Pyx_PyObject_Append(__pyx_cur_scope->__pyx_v_received_flags, __pyx_v_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L7;
    }
    __pyx_L7:;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pysox/sox.pyx":1123
 *                 received_flags.append(name)
 * 
 *         self.viewcount += 1             # <<<<<<<<<<<<<<
 *         buffer.buf = <void*>(<char*>self.buffer + (<int>self.offset * self.itemsize))
 *         buffer.obj = self
 */
  ((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->viewcount = (((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->viewcount + 1);

  /* "pysox/sox.pyx":1124
 * 
 *         self.viewcount += 1
 *         buffer.buf = <void*>(<char*>self.buffer + (<int>self.offset * self.itemsize))             # <<<<<<<<<<<<<<
 *         buffer.obj = self
 *         buffer.len = self.datalen
 */
  __pyx_t_6 = __Pyx_PyInt_AsInt(((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->offset); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_buffer->buf = ((void *)(((char *)((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->buffer) + (__pyx_t_6 * ((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->itemsize)));

  /* "pysox/sox.pyx":1125
 *         self.viewcount += 1
 *         buffer.buf = <void*>(<char*>self.buffer + (<int>self.offset * self.itemsize))
 *         buffer.obj = self             # <<<<<<<<<<<<<<
 *         buffer.len = self.datalen
 *         buffer.readonly = self.read_only
 */
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  __Pyx_GOTREF(__pyx_v_buffer->obj);
  __Pyx_DECREF(__pyx_v_buffer->obj);
  __pyx_v_buffer->obj = __pyx_v_self;

  /* "pysox/sox.pyx":1126
 *         buffer.buf = <void*>(<char*>self.buffer + (<int>self.offset * self.itemsize))
 *         buffer.obj = self
 *         buffer.len = self.datalen             # <<<<<<<<<<<<<<
 *         buffer.readonly = self.read_only
 *         if testflag('FORMAT',flags):
 */
  __pyx_v_buffer->len = ((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->datalen;

  /* "pysox/sox.pyx":1127
 *         buffer.obj = self
 *         buffer.len = self.datalen
 *         buffer.readonly = self.read_only             # <<<<<<<<<<<<<<
 *         if testflag('FORMAT',flags):
 *             buffer.format = <char*>self.format
 */
  __pyx_v_buffer->readonly = ((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->read_only;

  /* "pysox/sox.pyx":1128
 *         buffer.len = self.datalen
 *         buffer.readonly = self.read_only
 *         if testflag('FORMAT',flags):             # <<<<<<<<<<<<<<
 *             buffer.format = <char*>self.format
 *         else:
 */
  __pyx_t_3 = PyInt_FromLong(__pyx_v_flags); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__FORMAT));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__FORMAT));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__FORMAT));
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_v_testflag, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_8) {

    /* "pysox/sox.pyx":1129
 *         buffer.readonly = self.read_only
 *         if testflag('FORMAT',flags):
 *             buffer.format = <char*>self.format             # <<<<<<<<<<<<<<
 *         else:
 *             buffer.format = NULL
 */
    __pyx_t_9 = PyBytes_AsString(((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->format); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_buffer->format = __pyx_t_9;
    goto __pyx_L8;
  }
  /*else*/ {

    /* "pysox/sox.pyx":1131
 *             buffer.format = <char*>self.format
 *         else:
 *             buffer.format = NULL             # <<<<<<<<<<<<<<
 *         buffer.ndim = self.ndim
 *         if testflag('ND',flags):
 */
    __pyx_v_buffer->format = NULL;
  }
  __pyx_L8:;

  /* "pysox/sox.pyx":1132
 *         else:
 *             buffer.format = NULL
 *         buffer.ndim = self.ndim             # <<<<<<<<<<<<<<
 *         if testflag('ND',flags):
 *             buffer.shape = self.shape
 */
  __pyx_v_buffer->ndim = ((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->ndim;

  /* "pysox/sox.pyx":1133
 *             buffer.format = NULL
 *         buffer.ndim = self.ndim
 *         if testflag('ND',flags):             # <<<<<<<<<<<<<<
 *             buffer.shape = self.shape
 *         else:
 */
  __pyx_t_3 = PyInt_FromLong(__pyx_v_flags); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__ND));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__ND));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ND));
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_v_testflag, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_8) {

    /* "pysox/sox.pyx":1134
 *         buffer.ndim = self.ndim
 *         if testflag('ND',flags):
 *             buffer.shape = self.shape             # <<<<<<<<<<<<<<
 *         else:
 *             buffer.shape = NULL
 */
    __pyx_v_buffer->shape = ((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->shape;
    goto __pyx_L9;
  }
  /*else*/ {

    /* "pysox/sox.pyx":1136
 *             buffer.shape = self.shape
 *         else:
 *             buffer.shape = NULL             # <<<<<<<<<<<<<<
 * 
 *         if testflag('STRIDES',flags):
 */
    __pyx_v_buffer->shape = NULL;
  }
  __pyx_L9:;

  /* "pysox/sox.pyx":1138
 *             buffer.shape = NULL
 * 
 *         if testflag('STRIDES',flags):             # <<<<<<<<<<<<<<
 *             buffer.strides = self.strides
 *         else:
 */
  __pyx_t_3 = PyInt_FromLong(__pyx_v_flags); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__STRIDES));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__STRIDES));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__STRIDES));
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_v_testflag, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_8) {

    /* "pysox/sox.pyx":1139
 * 
 *         if testflag('STRIDES',flags):
 *             buffer.strides = self.strides             # <<<<<<<<<<<<<<
 *         else:
 *             buffer.strides = NULL
 */
    __pyx_v_buffer->strides = ((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->strides;
    goto __pyx_L10;
  }
  /*else*/ {

    /* "pysox/sox.pyx":1141
 *             buffer.strides = self.strides
 *         else:
 *             buffer.strides = NULL             # <<<<<<<<<<<<<<
 *         buffer.suboffsets = self.suboffsets
 *         buffer.itemsize = self.itemsize
 */
    __pyx_v_buffer->strides = NULL;
  }
  __pyx_L10:;

  /* "pysox/sox.pyx":1142
 *         else:
 *             buffer.strides = NULL
 *         buffer.suboffsets = self.suboffsets             # <<<<<<<<<<<<<<
 *         buffer.itemsize = self.itemsize
 *         buffer.internal = NULL
 */
  __pyx_v_buffer->suboffsets = ((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->suboffsets;

  /* "pysox/sox.pyx":1143
 *             buffer.strides = NULL
 *         buffer.suboffsets = self.suboffsets
 *         buffer.itemsize = self.itemsize             # <<<<<<<<<<<<<<
 *         buffer.internal = NULL
 * 
 */
  __pyx_v_buffer->itemsize = ((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->itemsize;

  /* "pysox/sox.pyx":1144
 *         buffer.suboffsets = self.suboffsets
 *         buffer.itemsize = self.itemsize
 *         buffer.internal = NULL             # <<<<<<<<<<<<<<
 * 
 *     def __releasebuffer__(SoxSampleBuffer self, Py_buffer* buffer):
 */
  __pyx_v_buffer->internal = NULL;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pysox.sox.SoxSampleBuffer.__getbuffer__");
  __pyx_r = -1;
  __Pyx_GOTREF(__pyx_v_buffer->obj);
  __Pyx_DECREF(__pyx_v_buffer->obj); __pyx_v_buffer->obj = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  if (__pyx_v_buffer->obj == Py_None) {
    __Pyx_GOTREF(Py_None);
    __Pyx_DECREF(Py_None); __pyx_v_buffer->obj = NULL;
  }
  __pyx_L2:;
  __Pyx_DECREF(__pyx_v_testflag);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_received_flags);
  __Pyx_DECREF(__pyx_v_name);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":1146
 *         buffer.internal = NULL
 * 
 *     def __releasebuffer__(SoxSampleBuffer self, Py_buffer* buffer):             # <<<<<<<<<<<<<<
 * #        print("releasebuffer")
 *         self.viewcount -= 1
 */

static CYTHON_UNUSED void __pyx_pf_5pysox_3sox_15SoxSampleBuffer_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_buffer); /*proto*/
static CYTHON_UNUSED void __pyx_pf_5pysox_3sox_15SoxSampleBuffer_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_buffer) {
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__releasebuffer__");

  /* "pysox/sox.pyx":1148
 *     def __releasebuffer__(SoxSampleBuffer self, Py_buffer* buffer):
 * #        print("releasebuffer")
 *         self.viewcount -= 1             # <<<<<<<<<<<<<<
 *         if self.viewcount < 0:
 *             self.viewcount = 0
 */
  ((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->viewcount = (((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->viewcount - 1);

  /* "pysox/sox.pyx":1149
 * #        print("releasebuffer")
 *         self.viewcount -= 1
 *         if self.viewcount < 0:             # <<<<<<<<<<<<<<
 *             self.viewcount = 0
 *         if buffer.suboffsets != self.suboffsets:
 */
  __pyx_t_1 = (((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->viewcount < 0);
  if (__pyx_t_1) {

    /* "pysox/sox.pyx":1150
 *         self.viewcount -= 1
 *         if self.viewcount < 0:
 *             self.viewcount = 0             # <<<<<<<<<<<<<<
 *         if buffer.suboffsets != self.suboffsets:
 *             self.release_ok = False
 */
    ((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->viewcount = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pysox/sox.pyx":1151
 *         if self.viewcount < 0:
 *             self.viewcount = 0
 *         if buffer.suboffsets != self.suboffsets:             # <<<<<<<<<<<<<<
 *             self.release_ok = False
 * 
 */
  __pyx_t_1 = (__pyx_v_buffer->suboffsets != ((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->suboffsets);
  if (__pyx_t_1) {

    /* "pysox/sox.pyx":1152
 *             self.viewcount = 0
 *         if buffer.suboffsets != self.suboffsets:
 *             self.release_ok = False             # <<<<<<<<<<<<<<
 * 
 *     def set_datalen(self, nbytes):
 */
    __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __Pyx_GOTREF(((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->release_ok);
    __Pyx_DECREF(((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->release_ok);
    ((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->release_ok = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysox.sox.SoxSampleBuffer.__releasebuffer__");
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pysox/sox.pyx":1154
 *             self.release_ok = False
 * 
 *     def set_datalen(self, nbytes):             # <<<<<<<<<<<<<<
 *         if nbytes > self.len:
 *             raise IndexError('got more than i can chew')
 */

static PyObject *__pyx_pf_5pysox_3sox_15SoxSampleBuffer_4set_datalen(PyObject *__pyx_v_self, PyObject *__pyx_v_nbytes); /*proto*/
static PyObject *__pyx_pf_5pysox_3sox_15SoxSampleBuffer_4set_datalen(PyObject *__pyx_v_self, PyObject *__pyx_v_nbytes) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("set_datalen");

  /* "pysox/sox.pyx":1155
 * 
 *     def set_datalen(self, nbytes):
 *         if nbytes > self.len:             # <<<<<<<<<<<<<<
 *             raise IndexError('got more than i can chew')
 *         self.datalen = nbytes
 */
  __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->len); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_nbytes, __pyx_t_1, Py_GT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pysox/sox.pyx":1156
 *     def set_datalen(self, nbytes):
 *         if nbytes > self.len:
 *             raise IndexError('got more than i can chew')             # <<<<<<<<<<<<<<
 *         self.datalen = nbytes
 * 
 */
    __pyx_t_2 = PyObject_Call(__pyx_builtin_IndexError, ((PyObject *)__pyx_k_tuple_44), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pysox/sox.pyx":1157
 *         if nbytes > self.len:
 *             raise IndexError('got more than i can chew')
 *         self.datalen = nbytes             # <<<<<<<<<<<<<<
 * 
 *     def set_readonly(self):
 */
  __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_v_nbytes); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  ((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->datalen = __pyx_t_4;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysox.sox.SoxSampleBuffer.set_datalen");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":1159
 *         self.datalen = nbytes
 * 
 *     def set_readonly(self):             # <<<<<<<<<<<<<<
 *         self.read_only = 1
 *     #
 */

static PyObject *__pyx_pf_5pysox_3sox_15SoxSampleBuffer_5set_readonly(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_5pysox_3sox_15SoxSampleBuffer_5set_readonly(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannySetupContext("set_readonly");

  /* "pysox/sox.pyx":1160
 * 
 *     def set_readonly(self):
 *         self.read_only = 1             # <<<<<<<<<<<<<<
 *     #
 *     # Container type emulation
 */
  ((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->read_only = 1;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":1164
 *     # Container type emulation
 *     #
 *     def __getitem__(self, i):             # <<<<<<<<<<<<<<
 *         if type(i) == type(slice(1,2)):
 *             raise IndexError("Slices are not supported")
 */

static PyObject *__pyx_pf_5pysox_3sox_15SoxSampleBuffer_6__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/
static PyObject *__pyx_pf_5pysox_3sox_15SoxSampleBuffer_6__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i) {
  int __pyx_v_index;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("__getitem__");

  /* "pysox/sox.pyx":1165
 *     #
 *     def __getitem__(self, i):
 *         if type(i) == type(slice(1,2)):             # <<<<<<<<<<<<<<
 *             raise IndexError("Slices are not supported")
 *         cdef int index = i
 */
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), ((PyObject *)__pyx_k_tuple_45), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_i)), ((PyObject *)Py_TYPE(__pyx_t_1)), Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pysox/sox.pyx":1166
 *     def __getitem__(self, i):
 *         if type(i) == type(slice(1,2)):
 *             raise IndexError("Slices are not supported")             # <<<<<<<<<<<<<<
 *         cdef int index = i
 *         if index*self.itemsize >= self.datalen:
 */
    __pyx_t_2 = PyObject_Call(__pyx_builtin_IndexError, ((PyObject *)__pyx_k_tuple_47), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pysox/sox.pyx":1167
 *         if type(i) == type(slice(1,2)):
 *             raise IndexError("Slices are not supported")
 *         cdef int index = i             # <<<<<<<<<<<<<<
 *         if index*self.itemsize >= self.datalen:
 *             raise IndexError()
 */
  __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_v_i); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_index = __pyx_t_4;

  /* "pysox/sox.pyx":1168
 *             raise IndexError("Slices are not supported")
 *         cdef int index = i
 *         if index*self.itemsize >= self.datalen:             # <<<<<<<<<<<<<<
 *             raise IndexError()
 *         return deref(<csox.sox_sample_t *>self.buffer + <int>index)
 */
  __pyx_t_3 = ((__pyx_v_index * ((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->itemsize) >= ((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->datalen);
  if (__pyx_t_3) {

    /* "pysox/sox.pyx":1169
 *         cdef int index = i
 *         if index*self.itemsize >= self.datalen:
 *             raise IndexError()             # <<<<<<<<<<<<<<
 *         return deref(<csox.sox_sample_t *>self.buffer + <int>index)
 * 
 */
    __pyx_t_2 = PyObject_Call(__pyx_builtin_IndexError, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "pysox/sox.pyx":1170
 *         if index*self.itemsize >= self.datalen:
 *             raise IndexError()
 *         return deref(<csox.sox_sample_t *>self.buffer + <int>index)             # <<<<<<<<<<<<<<
 * 
 *     def __setitem__(self, i, val):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_to_py_int32_t((*(((__pyx_t_5pysox_4csox_sox_sample_t *)((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->buffer) + __pyx_v_index))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysox.sox.SoxSampleBuffer.__getitem__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":1172
 *         return deref(<csox.sox_sample_t *>self.buffer + <int>index)
 * 
 *     def __setitem__(self, i, val):             # <<<<<<<<<<<<<<
 *         cdef int index = i
 *         if index*self.itemsize >= self.datalen:
 */

static int __pyx_pf_5pysox_3sox_15SoxSampleBuffer_7__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_val); /*proto*/
static int __pyx_pf_5pysox_3sox_15SoxSampleBuffer_7__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_val) {
  int __pyx_v_index;
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__setitem__");

  /* "pysox/sox.pyx":1173
 * 
 *     def __setitem__(self, i, val):
 *         cdef int index = i             # <<<<<<<<<<<<<<
 *         if index*self.itemsize >= self.datalen:
 *             raise IndexError()
 */
  __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_i); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_index = __pyx_t_1;

  /* "pysox/sox.pyx":1174
 *     def __setitem__(self, i, val):
 *         cdef int index = i
 *         if index*self.itemsize >= self.datalen:             # <<<<<<<<<<<<<<
 *             raise IndexError()
 *         self.write((<csox.sox_sample_t *>self.buffer + <int>index), val)
 */
  __pyx_t_2 = ((__pyx_v_index * ((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->itemsize) >= ((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->datalen);
  if (__pyx_t_2) {

    /* "pysox/sox.pyx":1175
 *         cdef int index = i
 *         if index*self.itemsize >= self.datalen:
 *             raise IndexError()             # <<<<<<<<<<<<<<
 *         self.write((<csox.sox_sample_t *>self.buffer + <int>index), val)
 *         #(<csox.sox_sample_t *>self.buffer + <int>index)[0] = <csox.sox_sample_t>val
 */
    __pyx_t_3 = PyObject_Call(__pyx_builtin_IndexError, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pysox/sox.pyx":1176
 *         if index*self.itemsize >= self.datalen:
 *             raise IndexError()
 *         self.write((<csox.sox_sample_t *>self.buffer + <int>index), val)             # <<<<<<<<<<<<<<
 *         #(<csox.sox_sample_t *>self.buffer + <int>index)[0] = <csox.sox_sample_t>val
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pysox_3sox_SoxSampleBuffer *)((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->__pyx_vtab)->write(((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self), (((__pyx_t_5pysox_4csox_sox_sample_t *)((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->buffer) + __pyx_v_index), __pyx_v_val); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysox.sox.SoxSampleBuffer.__setitem__");
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":1179
 *         #(<csox.sox_sample_t *>self.buffer + <int>index)[0] = <csox.sox_sample_t>val
 * 
 *     def get_buffer_size(self):             # <<<<<<<<<<<<<<
 *         """return the size of this buffer in bytes.
 *         len(obj) defaults to this unless set_datalen has been called.
 */

static PyObject *__pyx_pf_5pysox_3sox_15SoxSampleBuffer_8get_buffer_size(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pysox_3sox_15SoxSampleBuffer_8get_buffer_size[] = "return the size of this buffer in bytes.\n        len(obj) defaults to this unless set_datalen has been called.\n        In that case, len(obj) returns the number of valid bytes, whereas this function still\n        returns the size of our buffer";
static PyObject *__pyx_pf_5pysox_3sox_15SoxSampleBuffer_8get_buffer_size(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("get_buffer_size");

  /* "pysox/sox.pyx":1184
 *         In that case, len(obj) returns the number of valid bytes, whereas this function still
 *         returns the size of our buffer"""
 *         return self.len             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->len); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysox.sox.SoxSampleBuffer.get_buffer_size");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":1186
 *         return self.len
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.datalen / self.itemsize
 * 
 */

static Py_ssize_t __pyx_pf_5pysox_3sox_15SoxSampleBuffer_9__len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_pf_5pysox_3sox_15SoxSampleBuffer_9__len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannySetupContext("__len__");

  /* "pysox/sox.pyx":1187
 * 
 *     def __len__(self):
 *         return self.datalen / self.itemsize             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  if (unlikely(((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->itemsize == 0)) {
    PyErr_Format(PyExc_ZeroDivisionError, "integer division or modulo by zero");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  else if (sizeof(int) == sizeof(long) && unlikely(((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->itemsize == -1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->datalen))) {
    PyErr_Format(PyExc_OverflowError, "value too large to perform division");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_r = __Pyx_div_int(((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->datalen, ((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->itemsize);
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysox.sox.SoxSampleBuffer.__len__");
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":1189
 *         return self.datalen / self.itemsize
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return SoxBufferIterator(self)
 * 
 */

static PyObject *__pyx_pf_5pysox_3sox_15SoxSampleBuffer_10__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_5pysox_3sox_15SoxSampleBuffer_10__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__iter__");

  /* "pysox/sox.pyx":1190
 * 
 *     def __iter__(self):
 *         return SoxBufferIterator(self)             # <<<<<<<<<<<<<<
 * 
 *     #
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pysox_3sox_SoxBufferIterator)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysox.sox.SoxSampleBuffer.__iter__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":1195
 *     # conversion helpers
 *     #
 *     def fromlist(self, data):             # <<<<<<<<<<<<<<
 *         """replace our buffer with the contents of the array of integers
 * 
 */

static PyObject *__pyx_pf_5pysox_3sox_15SoxSampleBuffer_11fromlist(PyObject *__pyx_v_self, PyObject *__pyx_v_data); /*proto*/
static char __pyx_doc_5pysox_3sox_15SoxSampleBuffer_11fromlist[] = "replace our buffer with the contents of the array of integers\n        \n        Args:\n            ba: array of integers e.g. [1,2,3,4]\n        \n        Raises:\n            BufferError if being held by a view\n        ";
static PyObject *__pyx_pf_5pysox_3sox_15SoxSampleBuffer_11fromlist(PyObject *__pyx_v_self, PyObject *__pyx_v_data) {
  char *__pyx_v_buf;
  char *__pyx_v_it;
  PyObject *__pyx_v_value;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("fromlist");
  __pyx_v_value = Py_None; __Pyx_INCREF(Py_None);

  /* "pysox/sox.pyx":1204
 *             BufferError if being held by a view
 *         """
 *         if self.viewcount > 0:             # <<<<<<<<<<<<<<
 *             raise BufferError('Cannot reallocate while being referenced')
 *         cdef char* buf = <char*>stdlib.malloc(len(data) * self.itemsize)
 */
  __pyx_t_1 = (((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->viewcount > 0);
  if (__pyx_t_1) {

    /* "pysox/sox.pyx":1205
 *         """
 *         if self.viewcount > 0:
 *             raise BufferError('Cannot reallocate while being referenced')             # <<<<<<<<<<<<<<
 *         cdef char* buf = <char*>stdlib.malloc(len(data) * self.itemsize)
 * 
 */
    __pyx_t_2 = PyObject_Call(__pyx_builtin_BufferError, ((PyObject *)__pyx_k_tuple_49), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pysox/sox.pyx":1206
 *         if self.viewcount > 0:
 *             raise BufferError('Cannot reallocate while being referenced')
 *         cdef char* buf = <char*>stdlib.malloc(len(data) * self.itemsize)             # <<<<<<<<<<<<<<
 * 
 *         cdef char* it = buf
 */
  __pyx_t_3 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_buf = ((char *)malloc((__pyx_t_3 * ((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->itemsize)));

  /* "pysox/sox.pyx":1208
 *         cdef char* buf = <char*>stdlib.malloc(len(data) * self.itemsize)
 * 
 *         cdef char* it = buf             # <<<<<<<<<<<<<<
 *         for value in data:
 *             self.write(<csox.sox_sample_t *>it, value)
 */
  __pyx_v_it = __pyx_v_buf;

  /* "pysox/sox.pyx":1209
 * 
 *         cdef char* it = buf
 *         for value in data:             # <<<<<<<<<<<<<<
 *             self.write(<csox.sox_sample_t *>it, value)
 *             it += self.itemsize
 */
  if (PyList_CheckExact(__pyx_v_data) || PyTuple_CheckExact(__pyx_v_data)) {
    __pyx_t_3 = 0; __pyx_t_2 = __pyx_v_data; __Pyx_INCREF(__pyx_t_2);
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_data); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
  }
  for (;;) {
    if (likely(PyList_CheckExact(__pyx_t_2))) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++;
    } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++;
    } else {
      __pyx_t_4 = PyIter_Next(__pyx_t_2);
      if (!__pyx_t_4) {
        if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_DECREF(__pyx_v_value);
    __pyx_v_value = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "pysox/sox.pyx":1210
 *         cdef char* it = buf
 *         for value in data:
 *             self.write(<csox.sox_sample_t *>it, value)             # <<<<<<<<<<<<<<
 *             it += self.itemsize
 *         self.set_buffer(<csox.sox_sample_t *>buf, len(data))
 */
    __pyx_t_5 = ((struct __pyx_vtabstruct_5pysox_3sox_SoxSampleBuffer *)((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->__pyx_vtab)->write(((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self), ((__pyx_t_5pysox_4csox_sox_sample_t *)__pyx_v_it), __pyx_v_value); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pysox/sox.pyx":1211
 *         for value in data:
 *             self.write(<csox.sox_sample_t *>it, value)
 *             it += self.itemsize             # <<<<<<<<<<<<<<
 *         self.set_buffer(<csox.sox_sample_t *>buf, len(data))
 *         self.must_dealloc_buffer = 1
 */
    __pyx_v_it = (__pyx_v_it + ((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->itemsize);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pysox/sox.pyx":1212
 *             self.write(<csox.sox_sample_t *>it, value)
 *             it += self.itemsize
 *         self.set_buffer(<csox.sox_sample_t *>buf, len(data))             # <<<<<<<<<<<<<<
 *         self.must_dealloc_buffer = 1
 * 
 */
  __pyx_t_3 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  ((struct __pyx_vtabstruct_5pysox_3sox_SoxSampleBuffer *)((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->__pyx_vtab)->set_buffer(((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self), ((__pyx_t_5pysox_4csox_sox_sample_t *)__pyx_v_buf), __pyx_t_3);

  /* "pysox/sox.pyx":1213
 *             it += self.itemsize
 *         self.set_buffer(<csox.sox_sample_t *>buf, len(data))
 *         self.must_dealloc_buffer = 1             # <<<<<<<<<<<<<<
 * 
 *     def writelist(self, data):
 */
  ((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->must_dealloc_buffer = 1;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pysox.sox.SoxSampleBuffer.fromlist");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":1215
 *         self.must_dealloc_buffer = 1
 * 
 *     def writelist(self, data):             # <<<<<<<<<<<<<<
 *         """fill our buffer with the contents of the array of integers
 * 
 */

static PyObject *__pyx_pf_5pysox_3sox_15SoxSampleBuffer_12writelist(PyObject *__pyx_v_self, PyObject *__pyx_v_data); /*proto*/
static char __pyx_doc_5pysox_3sox_15SoxSampleBuffer_12writelist[] = "fill our buffer with the contents of the array of integers\n        \n        Args:\n            ba: array of integers e.g. [1,2,3,4]\n\n        Raises:\n            IndexError if too much data is given\n        ";
static PyObject *__pyx_pf_5pysox_3sox_15SoxSampleBuffer_12writelist(PyObject *__pyx_v_self, PyObject *__pyx_v_data) {
  char *__pyx_v_it;
  int __pyx_v_lsamp;
  PyObject *__pyx_v_value;
  PyObject *__pyx_v_shape;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("writelist");
  __pyx_v_value = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_shape = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);

  /* "pysox/sox.pyx":1224
 *             IndexError if too much data is given
 *         """
 *         if type(data) != type([]):             # <<<<<<<<<<<<<<
 *             raise TypeError("only accepting list type")
 *         cdef char* it = <char *>self.buffer
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_2 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_data)), ((PyObject *)Py_TYPE(((PyObject *)__pyx_t_1))), Py_NE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pysox/sox.pyx":1225
 *         """
 *         if type(data) != type([]):
 *             raise TypeError("only accepting list type")             # <<<<<<<<<<<<<<
 *         cdef char* it = <char *>self.buffer
 *         cdef int lsamp
 */
    __pyx_t_2 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_51), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pysox/sox.pyx":1226
 *         if type(data) != type([]):
 *             raise TypeError("only accepting list type")
 *         cdef char* it = <char *>self.buffer             # <<<<<<<<<<<<<<
 *         cdef int lsamp
 *         lsamp = len(data)
 */
  __pyx_v_it = ((char *)((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->buffer);

  /* "pysox/sox.pyx":1228
 *         cdef char* it = <char *>self.buffer
 *         cdef int lsamp
 *         lsamp = len(data)             # <<<<<<<<<<<<<<
 *         if lsamp * self.itemsize > self.len:
 *             raise IndexError("Too much data, check get_buffer_size()")
 */
  __pyx_t_4 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_lsamp = __pyx_t_4;

  /* "pysox/sox.pyx":1229
 *         cdef int lsamp
 *         lsamp = len(data)
 *         if lsamp * self.itemsize > self.len:             # <<<<<<<<<<<<<<
 *             raise IndexError("Too much data, check get_buffer_size()")
 *         for value in data:
 */
  __pyx_t_3 = ((__pyx_v_lsamp * ((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->itemsize) > ((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->len);
  if (__pyx_t_3) {

    /* "pysox/sox.pyx":1230
 *         lsamp = len(data)
 *         if lsamp * self.itemsize > self.len:
 *             raise IndexError("Too much data, check get_buffer_size()")             # <<<<<<<<<<<<<<
 *         for value in data:
 *             self.write(<csox.sox_sample_t *>it, value)
 */
    __pyx_t_2 = PyObject_Call(__pyx_builtin_IndexError, ((PyObject *)__pyx_k_tuple_53), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "pysox/sox.pyx":1231
 *         if lsamp * self.itemsize > self.len:
 *             raise IndexError("Too much data, check get_buffer_size()")
 *         for value in data:             # <<<<<<<<<<<<<<
 *             self.write(<csox.sox_sample_t *>it, value)
 *             it += self.itemsize
 */
  if (PyList_CheckExact(__pyx_v_data) || PyTuple_CheckExact(__pyx_v_data)) {
    __pyx_t_4 = 0; __pyx_t_2 = __pyx_v_data; __Pyx_INCREF(__pyx_t_2);
  } else {
    __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_data); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
  }
  for (;;) {
    if (likely(PyList_CheckExact(__pyx_t_2))) {
      if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++;
    } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
      if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++;
    } else {
      __pyx_t_1 = PyIter_Next(__pyx_t_2);
      if (!__pyx_t_1) {
        if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_v_value);
    __pyx_v_value = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "pysox/sox.pyx":1232
 *             raise IndexError("Too much data, check get_buffer_size()")
 *         for value in data:
 *             self.write(<csox.sox_sample_t *>it, value)             # <<<<<<<<<<<<<<
 *             it += self.itemsize
 *         self.must_dealloc_buffer = 0
 */
    __pyx_t_5 = ((struct __pyx_vtabstruct_5pysox_3sox_SoxSampleBuffer *)((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->__pyx_vtab)->write(((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self), ((__pyx_t_5pysox_4csox_sox_sample_t *)__pyx_v_it), __pyx_v_value); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pysox/sox.pyx":1233
 *         for value in data:
 *             self.write(<csox.sox_sample_t *>it, value)
 *             it += self.itemsize             # <<<<<<<<<<<<<<
 *         self.must_dealloc_buffer = 0
 *         self.__do_dealloc_if()
 */
    __pyx_v_it = (__pyx_v_it + ((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->itemsize);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pysox/sox.pyx":1234
 *             self.write(<csox.sox_sample_t *>it, value)
 *             it += self.itemsize
 *         self.must_dealloc_buffer = 0             # <<<<<<<<<<<<<<
 *         self.__do_dealloc_if()
 *         self.datalen = lsamp * self.itemsize
 */
  ((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->must_dealloc_buffer = 0;

  /* "pysox/sox.pyx":1235
 *             it += self.itemsize
 *         self.must_dealloc_buffer = 0
 *         self.__do_dealloc_if()             # <<<<<<<<<<<<<<
 *         self.datalen = lsamp * self.itemsize
 *         shape = (lsamp, )
 */
  ((struct __pyx_vtabstruct_5pysox_3sox_SoxSampleBuffer *)((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->__pyx_vtab)->__do_dealloc_if(((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self));

  /* "pysox/sox.pyx":1236
 *         self.must_dealloc_buffer = 0
 *         self.__do_dealloc_if()
 *         self.datalen = lsamp * self.itemsize             # <<<<<<<<<<<<<<
 *         shape = (lsamp, )
 *         self.ndim = len(shape)
 */
  ((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->datalen = (__pyx_v_lsamp * ((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->itemsize);

  /* "pysox/sox.pyx":1237
 *         self.__do_dealloc_if()
 *         self.datalen = lsamp * self.itemsize
 *         shape = (lsamp, )             # <<<<<<<<<<<<<<
 *         self.ndim = len(shape)
 *         self.shape = self.list_to_sizebuf(shape)
 */
  __pyx_t_2 = PyInt_FromLong(__pyx_v_lsamp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_v_shape));
  __pyx_v_shape = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pysox/sox.pyx":1238
 *         self.datalen = lsamp * self.itemsize
 *         shape = (lsamp, )
 *         self.ndim = len(shape)             # <<<<<<<<<<<<<<
 *         self.shape = self.list_to_sizebuf(shape)
 *         self.strides = self.list_to_sizebuf([self.itemsize])
 */
  if (unlikely(__pyx_v_shape == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
  }
  __pyx_t_4 = PyTuple_GET_SIZE(((PyObject *)__pyx_v_shape)); 
  ((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->ndim = __pyx_t_4;

  /* "pysox/sox.pyx":1239
 *         shape = (lsamp, )
 *         self.ndim = len(shape)
 *         self.shape = self.list_to_sizebuf(shape)             # <<<<<<<<<<<<<<
 *         self.strides = self.list_to_sizebuf([self.itemsize])
 * 
 */
  ((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->shape = ((struct __pyx_vtabstruct_5pysox_3sox_SoxSampleBuffer *)((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->__pyx_vtab)->list_to_sizebuf(((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self), ((PyObject *)__pyx_v_shape));

  /* "pysox/sox.pyx":1240
 *         self.ndim = len(shape)
 *         self.shape = self.list_to_sizebuf(shape)
 *         self.strides = self.list_to_sizebuf([self.itemsize])             # <<<<<<<<<<<<<<
 * 
 *     def frombytes(self, ba):
 */
  __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->itemsize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  ((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->strides = ((struct __pyx_vtabstruct_5pysox_3sox_SoxSampleBuffer *)((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->__pyx_vtab)->list_to_sizebuf(((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self), ((PyObject *)__pyx_t_2));
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysox.sox.SoxSampleBuffer.writelist");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_value);
  __Pyx_DECREF(__pyx_v_shape);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":1242
 *         self.strides = self.list_to_sizebuf([self.itemsize])
 * 
 *     def frombytes(self, ba):             # <<<<<<<<<<<<<<
 *         """replace our buffer with the contents of the bytearray
 * 
 */

static PyObject *__pyx_pf_5pysox_3sox_15SoxSampleBuffer_13frombytes(PyObject *__pyx_v_self, PyObject *__pyx_v_ba); /*proto*/
static char __pyx_doc_5pysox_3sox_15SoxSampleBuffer_13frombytes[] = "replace our buffer with the contents of the bytearray\n        \n        Args:\n            ba: bytearray\n        \n        Raises:\n            BufferError if being held by a view\n        ";
static PyObject *__pyx_pf_5pysox_3sox_15SoxSampleBuffer_13frombytes(PyObject *__pyx_v_self, PyObject *__pyx_v_ba) {
  int __pyx_v_c;
  int __pyx_v_lsamp;
  char *__pyx_v_buffer;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  char *__pyx_t_6;
  __Pyx_RefNannySetupContext("frombytes");
  __Pyx_INCREF(__pyx_v_ba);

  /* "pysox/sox.pyx":1254
 *         cdef int lsamp
 *         cdef char * buffer
 *         if self.viewcount > 0:             # <<<<<<<<<<<<<<
 *             raise BufferError('Cannot reallocate while being referenced')
 *         lsamp = len(ba) / self.itemsize
 */
  __pyx_t_1 = (((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->viewcount > 0);
  if (__pyx_t_1) {

    /* "pysox/sox.pyx":1255
 *         cdef char * buffer
 *         if self.viewcount > 0:
 *             raise BufferError('Cannot reallocate while being referenced')             # <<<<<<<<<<<<<<
 *         lsamp = len(ba) / self.itemsize
 *         buffer = <char *>stdlib.malloc(len(ba))
 */
    __pyx_t_2 = PyObject_Call(__pyx_builtin_BufferError, ((PyObject *)__pyx_k_tuple_54), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pysox/sox.pyx":1256
 *         if self.viewcount > 0:
 *             raise BufferError('Cannot reallocate while being referenced')
 *         lsamp = len(ba) / self.itemsize             # <<<<<<<<<<<<<<
 *         buffer = <char *>stdlib.malloc(len(ba))
 * 
 */
  __pyx_t_3 = PyObject_Length(__pyx_v_ba); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->itemsize == 0)) {
    PyErr_Format(PyExc_ZeroDivisionError, "integer division or modulo by zero");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  else if (sizeof(Py_ssize_t) == sizeof(long) && unlikely(((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->itemsize == -1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_t_3))) {
    PyErr_Format(PyExc_OverflowError, "value too large to perform division");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_lsamp = __Pyx_div_Py_ssize_t(__pyx_t_3, ((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->itemsize);

  /* "pysox/sox.pyx":1257
 *             raise BufferError('Cannot reallocate while being referenced')
 *         lsamp = len(ba) / self.itemsize
 *         buffer = <char *>stdlib.malloc(len(ba))             # <<<<<<<<<<<<<<
 * 
 *         if type(ba) == type(bytearray()):
 */
  __pyx_t_3 = PyObject_Length(__pyx_v_ba); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_buffer = ((char *)malloc(__pyx_t_3));

  /* "pysox/sox.pyx":1259
 *         buffer = <char *>stdlib.malloc(len(ba))
 * 
 *         if type(ba) == type(bytearray()):             # <<<<<<<<<<<<<<
 *             ba = bytes(ba)
 * 
 */
  __pyx_t_2 = PyObject_Call(__pyx_builtin_bytearray, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_ba)), ((PyObject *)Py_TYPE(__pyx_t_2)), Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_1) {

    /* "pysox/sox.pyx":1260
 * 
 *         if type(ba) == type(bytearray()):
 *             ba = bytes(ba)             # <<<<<<<<<<<<<<
 * 
 *         for c in range(len(ba)):
 */
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __Pyx_INCREF(__pyx_v_ba);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_ba);
    __Pyx_GIVEREF(__pyx_v_ba);
    __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyBytes_Type))), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_v_ba);
    __pyx_v_ba = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "pysox/sox.pyx":1262
 *             ba = bytes(ba)
 * 
 *         for c in range(len(ba)):             # <<<<<<<<<<<<<<
 *             (<char *>buffer)[c] = <char>(<char *>ba)[c]
 *         self.set_buffer(<csox.sox_sample_t *>buffer, lsamp)
 */
  __pyx_t_3 = PyObject_Length(__pyx_v_ba); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) {
    __pyx_v_c = __pyx_t_5;

    /* "pysox/sox.pyx":1263
 * 
 *         for c in range(len(ba)):
 *             (<char *>buffer)[c] = <char>(<char *>ba)[c]             # <<<<<<<<<<<<<<
 *         self.set_buffer(<csox.sox_sample_t *>buffer, lsamp)
 *         self.must_dealloc_buffer = 1
 */
    __pyx_t_6 = PyBytes_AsString(__pyx_v_ba); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    (__pyx_v_buffer[__pyx_v_c]) = (__pyx_t_6[__pyx_v_c]);
  }

  /* "pysox/sox.pyx":1264
 *         for c in range(len(ba)):
 *             (<char *>buffer)[c] = <char>(<char *>ba)[c]
 *         self.set_buffer(<csox.sox_sample_t *>buffer, lsamp)             # <<<<<<<<<<<<<<
 *         self.must_dealloc_buffer = 1
 * 
 */
  ((struct __pyx_vtabstruct_5pysox_3sox_SoxSampleBuffer *)((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->__pyx_vtab)->set_buffer(((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self), ((__pyx_t_5pysox_4csox_sox_sample_t *)__pyx_v_buffer), __pyx_v_lsamp);

  /* "pysox/sox.pyx":1265
 *             (<char *>buffer)[c] = <char>(<char *>ba)[c]
 *         self.set_buffer(<csox.sox_sample_t *>buffer, lsamp)
 *         self.must_dealloc_buffer = 1             # <<<<<<<<<<<<<<
 * 
 *     def writebytes(self, ba):
 */
  ((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->must_dealloc_buffer = 1;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pysox.sox.SoxSampleBuffer.frombytes");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_ba);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":1267
 *         self.must_dealloc_buffer = 1
 * 
 *     def writebytes(self, ba):             # <<<<<<<<<<<<<<
 *         """fill our buffer with the contents of the bytearray
 * 
 */

static PyObject *__pyx_pf_5pysox_3sox_15SoxSampleBuffer_14writebytes(PyObject *__pyx_v_self, PyObject *__pyx_v_ba); /*proto*/
static char __pyx_doc_5pysox_3sox_15SoxSampleBuffer_14writebytes[] = "fill our buffer with the contents of the bytearray\n        \n        Args:\n            ba: bytearray\n        ";
static PyObject *__pyx_pf_5pysox_3sox_15SoxSampleBuffer_14writebytes(PyObject *__pyx_v_self, PyObject *__pyx_v_ba) {
  int __pyx_v_c;
  int __pyx_v_lsamp;
  char *__pyx_v_buffer;
  PyObject *__pyx_v_shape;
  PyObject *__pyx_r = NULL;
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  char *__pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("writebytes");
  __pyx_v_shape = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);

  /* "pysox/sox.pyx":1273
 *             ba: bytearray
 *         """
 *         if len(ba) > self.len:             # <<<<<<<<<<<<<<
 *             raise IndexError("Too much data, check get_buffer_size()")
 *         cdef int c, lsamp
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_ba); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = (__pyx_t_1 > ((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->len);
  if (__pyx_t_2) {

    /* "pysox/sox.pyx":1274
 *         """
 *         if len(ba) > self.len:
 *             raise IndexError("Too much data, check get_buffer_size()")             # <<<<<<<<<<<<<<
 *         cdef int c, lsamp
 *         cdef char * buffer = <char *>self.buffer
 */
    __pyx_t_3 = PyObject_Call(__pyx_builtin_IndexError, ((PyObject *)__pyx_k_tuple_55), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pysox/sox.pyx":1276
 *             raise IndexError("Too much data, check get_buffer_size()")
 *         cdef int c, lsamp
 *         cdef char * buffer = <char *>self.buffer             # <<<<<<<<<<<<<<
 *         for c in range(len(ba)):
 *             (<char *>buffer)[c] = (<char *>ba)[c]
 */
  __pyx_v_buffer = ((char *)((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->buffer);

  /* "pysox/sox.pyx":1277
 *         cdef int c, lsamp
 *         cdef char * buffer = <char *>self.buffer
 *         for c in range(len(ba)):             # <<<<<<<<<<<<<<
 *             (<char *>buffer)[c] = (<char *>ba)[c]
 *         self.must_dealloc_buffer = 0
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_ba); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_1; __pyx_t_4+=1) {
    __pyx_v_c = __pyx_t_4;

    /* "pysox/sox.pyx":1278
 *         cdef char * buffer = <char *>self.buffer
 *         for c in range(len(ba)):
 *             (<char *>buffer)[c] = (<char *>ba)[c]             # <<<<<<<<<<<<<<
 *         self.must_dealloc_buffer = 0
 *         self.__do_dealloc_if()
 */
    __pyx_t_5 = PyBytes_AsString(__pyx_v_ba); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    (__pyx_v_buffer[__pyx_v_c]) = (__pyx_t_5[__pyx_v_c]);
  }

  /* "pysox/sox.pyx":1279
 *         for c in range(len(ba)):
 *             (<char *>buffer)[c] = (<char *>ba)[c]
 *         self.must_dealloc_buffer = 0             # <<<<<<<<<<<<<<
 *         self.__do_dealloc_if()
 *         lsamp = len(ba) / self.itemsize
 */
  ((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->must_dealloc_buffer = 0;

  /* "pysox/sox.pyx":1280
 *             (<char *>buffer)[c] = (<char *>ba)[c]
 *         self.must_dealloc_buffer = 0
 *         self.__do_dealloc_if()             # <<<<<<<<<<<<<<
 *         lsamp = len(ba) / self.itemsize
 *         self.datalen = lsamp * self.itemsize
 */
  ((struct __pyx_vtabstruct_5pysox_3sox_SoxSampleBuffer *)((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->__pyx_vtab)->__do_dealloc_if(((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self));

  /* "pysox/sox.pyx":1281
 *         self.must_dealloc_buffer = 0
 *         self.__do_dealloc_if()
 *         lsamp = len(ba) / self.itemsize             # <<<<<<<<<<<<<<
 *         self.datalen = lsamp * self.itemsize
 *         shape = (lsamp, )
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_ba); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->itemsize == 0)) {
    PyErr_Format(PyExc_ZeroDivisionError, "integer division or modulo by zero");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  else if (sizeof(Py_ssize_t) == sizeof(long) && unlikely(((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->itemsize == -1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_t_1))) {
    PyErr_Format(PyExc_OverflowError, "value too large to perform division");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_lsamp = __Pyx_div_Py_ssize_t(__pyx_t_1, ((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->itemsize);

  /* "pysox/sox.pyx":1282
 *         self.__do_dealloc_if()
 *         lsamp = len(ba) / self.itemsize
 *         self.datalen = lsamp * self.itemsize             # <<<<<<<<<<<<<<
 *         shape = (lsamp, )
 *         self.ndim = len(shape)
 */
  ((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->datalen = (__pyx_v_lsamp * ((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->itemsize);

  /* "pysox/sox.pyx":1283
 *         lsamp = len(ba) / self.itemsize
 *         self.datalen = lsamp * self.itemsize
 *         shape = (lsamp, )             # <<<<<<<<<<<<<<
 *         self.ndim = len(shape)
 *         self.shape = self.list_to_sizebuf(shape)
 */
  __pyx_t_3 = PyInt_FromLong(__pyx_v_lsamp); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_v_shape));
  __pyx_v_shape = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "pysox/sox.pyx":1284
 *         self.datalen = lsamp * self.itemsize
 *         shape = (lsamp, )
 *         self.ndim = len(shape)             # <<<<<<<<<<<<<<
 *         self.shape = self.list_to_sizebuf(shape)
 *         self.strides = self.list_to_sizebuf([self.itemsize])
 */
  if (unlikely(__pyx_v_shape == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
  }
  __pyx_t_1 = PyTuple_GET_SIZE(((PyObject *)__pyx_v_shape)); 
  ((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->ndim = __pyx_t_1;

  /* "pysox/sox.pyx":1285
 *         shape = (lsamp, )
 *         self.ndim = len(shape)
 *         self.shape = self.list_to_sizebuf(shape)             # <<<<<<<<<<<<<<
 *         self.strides = self.list_to_sizebuf([self.itemsize])
 * 
 */
  ((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->shape = ((struct __pyx_vtabstruct_5pysox_3sox_SoxSampleBuffer *)((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->__pyx_vtab)->list_to_sizebuf(((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self), ((PyObject *)__pyx_v_shape));

  /* "pysox/sox.pyx":1286
 *         self.ndim = len(shape)
 *         self.shape = self.list_to_sizebuf(shape)
 *         self.strides = self.list_to_sizebuf([self.itemsize])             # <<<<<<<<<<<<<<
 * 
 *     def tobytearray(self):
 */
  __pyx_t_6 = PyInt_FromLong(((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->itemsize); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;
  ((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->strides = ((struct __pyx_vtabstruct_5pysox_3sox_SoxSampleBuffer *)((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->__pyx_vtab)->list_to_sizebuf(((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self), ((PyObject *)__pyx_t_3));
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pysox.sox.SoxSampleBuffer.writebytes");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_shape);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":1288
 *         self.strides = self.list_to_sizebuf([self.itemsize])
 * 
 *     def tobytearray(self):             # <<<<<<<<<<<<<<
 *         """return a bytearray object of the buffer.
 * 
 */

static PyObject *__pyx_pf_5pysox_3sox_15SoxSampleBuffer_15tobytearray(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pysox_3sox_15SoxSampleBuffer_15tobytearray[] = "return a bytearray object of the buffer.\n        \n        The bytearray is a copy. Modifications will not reflect into the sox buffer";
static PyObject *__pyx_pf_5pysox_3sox_15SoxSampleBuffer_15tobytearray(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("tobytearray");

  /* "pysox/sox.pyx":1292
 * 
 *         The bytearray is a copy. Modifications will not reflect into the sox buffer"""
 *         return bytearray(self)             # <<<<<<<<<<<<<<
 * 
 *     def tolist(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  __pyx_t_2 = PyObject_Call(__pyx_builtin_bytearray, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysox.sox.SoxSampleBuffer.tobytearray");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":1294
 *         return bytearray(self)
 * 
 *     def tolist(self):             # <<<<<<<<<<<<<<
 *         """Return a list of this buffers items.
 * 
 */

static PyObject *__pyx_pf_5pysox_3sox_15SoxSampleBuffer_16tolist(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pysox_3sox_15SoxSampleBuffer_16tolist[] = "Return a list of this buffers items.\n        \n        The list is a copy, changes will not reflect into the sox buffer";
static PyObject *__pyx_pf_5pysox_3sox_15SoxSampleBuffer_16tolist(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("tolist");

  /* "pysox/sox.pyx":1298
 * 
 *         The list is a copy, changes will not reflect into the sox buffer"""
 *         return list(self)             # <<<<<<<<<<<<<<
 *         #return [x for x in self]
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysox.sox.SoxSampleBuffer.tolist");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pxd":72
 *     cdef Py_ssize_t* shape
 *     cdef Py_ssize_t* suboffsets
 *     cdef readonly object recieved_flags, release_ok             # <<<<<<<<<<<<<<
 *     cdef bint must_dealloc_buffer, read_only
 *     cdef int viewcount
 */

static PyObject *__pyx_pf_5pysox_3sox_15SoxSampleBuffer_14recieved_flags___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_5pysox_3sox_15SoxSampleBuffer_14recieved_flags___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->recieved_flags);
  __pyx_r = ((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->recieved_flags;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pysox_3sox_15SoxSampleBuffer_10release_ok___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_5pysox_3sox_15SoxSampleBuffer_10release_ok___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->release_ok);
  __pyx_r = ((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)__pyx_v_self)->release_ok;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":1305
 *     cdef int i
 *     cdef int len
 *     def __init__(self, SoxSampleBuffer b):             # <<<<<<<<<<<<<<
 *         self.b = b
 *         self.len = len(b)
 */

static int __pyx_pf_5pysox_3sox_17SoxBufferIterator___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_5pysox_3sox_17SoxBufferIterator___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *__pyx_v_b = 0;
  int __pyx_r;
  Py_ssize_t __pyx_t_1;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__b,0};
  __Pyx_RefNannySetupContext("__init__");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[1] = {0};
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__b);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1305; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_b = ((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)values[0]);
  } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
    goto __pyx_L5_argtuple_error;
  } else {
    __pyx_v_b = ((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)PyTuple_GET_ITEM(__pyx_args, 0));
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1305; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysox.sox.SoxBufferIterator.__init__");
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_5pysox_3sox_SoxSampleBuffer, 1, "b", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pysox/sox.pyx":1306
 *     cdef int len
 *     def __init__(self, SoxSampleBuffer b):
 *         self.b = b             # <<<<<<<<<<<<<<
 *         self.len = len(b)
 *     def __iter__(self):
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_b));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_b));
  __Pyx_GOTREF(((struct __pyx_obj_5pysox_3sox_SoxBufferIterator *)__pyx_v_self)->b);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_5pysox_3sox_SoxBufferIterator *)__pyx_v_self)->b));
  ((struct __pyx_obj_5pysox_3sox_SoxBufferIterator *)__pyx_v_self)->b = __pyx_v_b;

  /* "pysox/sox.pyx":1307
 *     def __init__(self, SoxSampleBuffer b):
 *         self.b = b
 *         self.len = len(b)             # <<<<<<<<<<<<<<
 *     def __iter__(self):
 *         self.i=0
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_b)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  ((struct __pyx_obj_5pysox_3sox_SoxBufferIterator *)__pyx_v_self)->len = __pyx_t_1;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysox.sox.SoxBufferIterator.__init__");
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":1308
 *         self.b = b
 *         self.len = len(b)
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         self.i=0
 *         return self
 */

static PyObject *__pyx_pf_5pysox_3sox_17SoxBufferIterator_1__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_5pysox_3sox_17SoxBufferIterator_1__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannySetupContext("__iter__");

  /* "pysox/sox.pyx":1309
 *         self.len = len(b)
 *     def __iter__(self):
 *         self.i=0             # <<<<<<<<<<<<<<
 *         return self
 *     def __next__(self):
 */
  ((struct __pyx_obj_5pysox_3sox_SoxBufferIterator *)__pyx_v_self)->i = 0;

  /* "pysox/sox.pyx":1310
 *     def __iter__(self):
 *         self.i=0
 *         return self             # <<<<<<<<<<<<<<
 *     def __next__(self):
 *         if self.i >= self.len:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self);
  __pyx_r = __pyx_v_self;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":1311
 *         self.i=0
 *         return self
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         if self.i >= self.len:
 *             raise StopIteration
 */

static PyObject *__pyx_pf_5pysox_3sox_17SoxBufferIterator_2__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_5pysox_3sox_17SoxBufferIterator_2__next__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  long __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__next__");

  /* "pysox/sox.pyx":1312
 *         return self
 *     def __next__(self):
 *         if self.i >= self.len:             # <<<<<<<<<<<<<<
 *             raise StopIteration
 *         inc(self.i)
 */
  __pyx_t_1 = (((struct __pyx_obj_5pysox_3sox_SoxBufferIterator *)__pyx_v_self)->i >= ((struct __pyx_obj_5pysox_3sox_SoxBufferIterator *)__pyx_v_self)->len);
  if (__pyx_t_1) {

    /* "pysox/sox.pyx":1313
 *     def __next__(self):
 *         if self.i >= self.len:
 *             raise StopIteration             # <<<<<<<<<<<<<<
 *         inc(self.i)
 *         return self.b[self.i-1]
 */
    __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pysox/sox.pyx":1314
 *         if self.i >= self.len:
 *             raise StopIteration
 *         inc(self.i)             # <<<<<<<<<<<<<<
 *         return self.b[self.i-1]
 * 
 */
  (++((struct __pyx_obj_5pysox_3sox_SoxBufferIterator *)__pyx_v_self)->i);

  /* "pysox/sox.pyx":1315
 *             raise StopIteration
 *         inc(self.i)
 *         return self.b[self.i-1]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = (((struct __pyx_obj_5pysox_3sox_SoxBufferIterator *)__pyx_v_self)->i - 1);
  __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)((struct __pyx_obj_5pysox_3sox_SoxBufferIterator *)__pyx_v_self)->b), __pyx_t_2, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysox.sox.SoxBufferIterator.__next__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":1323
 * ################################################################################################
 * cdef class __CSox:
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         cdef int result
 *         result = csox.sox_init()
 */

static int __pyx_pf_5pysox_3sox_6__CSox___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_5pysox_3sox_6__CSox___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_result;
  int __pyx_r;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__cinit__");
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;

  /* "pysox/sox.pyx":1325
 *     def __cinit__(self):
 *         cdef int result
 *         result = csox.sox_init()             # <<<<<<<<<<<<<<
 *         if result != SOX_SUCCESS:
 *             raise ImportError("sox_init not successful")
 */
  __pyx_v_result = sox_init();

  /* "pysox/sox.pyx":1326
 *         cdef int result
 *         result = csox.sox_init()
 *         if result != SOX_SUCCESS:             # <<<<<<<<<<<<<<
 *             raise ImportError("sox_init not successful")
 * 
 */
  __pyx_t_1 = (__pyx_v_result != 0);
  if (__pyx_t_1) {

    /* "pysox/sox.pyx":1327
 *         result = csox.sox_init()
 *         if result != SOX_SUCCESS:
 *             raise ImportError("sox_init not successful")             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
    __pyx_t_2 = PyObject_Call(__pyx_builtin_ImportError, ((PyObject *)__pyx_k_tuple_57), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysox.sox.__CSox.__cinit__");
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pysox/sox.pyx":1329
 *             raise ImportError("sox_init not successful")
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         csox.sox_quit()
 * 
 */

static void __pyx_pf_5pysox_3sox_6__CSox_1__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pf_5pysox_3sox_6__CSox_1__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannySetupContext("__dealloc__");

  /* "pysox/sox.pyx":1330
 * 
 *     def __dealloc__(self):
 *         csox.sox_quit()             # <<<<<<<<<<<<<<
 * 
 * __sox_initializer = __CSox()
 */
  sox_quit();

  __Pyx_RefNannyFinishContext();
}
static struct __pyx_vtabstruct_5pysox_3sox_CEffect __pyx_vtable_5pysox_3sox_CEffect;

static PyObject *__pyx_tp_new_5pysox_3sox_CEffect(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_5pysox_3sox_CEffect *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_5pysox_3sox_CEffect *)o);
  p->__pyx_vtab = __pyx_vtabptr_5pysox_3sox_CEffect;
  p->name = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_5pysox_3sox_CEffect(PyObject *o) {
  struct __pyx_obj_5pysox_3sox_CEffect *p = (struct __pyx_obj_5pysox_3sox_CEffect *)o;
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pf_5pysox_3sox_7CEffect_1__dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_XDECREF(p->name);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_5pysox_3sox_CEffect(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5pysox_3sox_CEffect *p = (struct __pyx_obj_5pysox_3sox_CEffect *)o;
  if (p->name) {
    e = (*v)(p->name, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_5pysox_3sox_CEffect(PyObject *o) {
  struct __pyx_obj_5pysox_3sox_CEffect *p = (struct __pyx_obj_5pysox_3sox_CEffect *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->name);
  p->name = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_5pysox_3sox_CEffect[] = {
  {__Pyx_NAMESTR("get_name"), (PyCFunction)__pyx_pf_5pysox_3sox_7CEffect_3get_name, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pysox_3sox_7CEffect_3get_name)},
  {__Pyx_NAMESTR("get_in_signal"), (PyCFunction)__pyx_pf_5pysox_3sox_7CEffect_4get_in_signal, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pysox_3sox_7CEffect_4get_in_signal)},
  {__Pyx_NAMESTR("get_out_signal"), (PyCFunction)__pyx_pf_5pysox_3sox_7CEffect_5get_out_signal, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pysox_3sox_7CEffect_5get_out_signal)},
  {__Pyx_NAMESTR("set_out_signal"), (PyCFunction)__pyx_pf_5pysox_3sox_7CEffect_6set_out_signal, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("get_in_encoding"), (PyCFunction)__pyx_pf_5pysox_3sox_7CEffect_7get_in_encoding, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pysox_3sox_7CEffect_7get_in_encoding)},
  {__Pyx_NAMESTR("get_out_encoding"), (PyCFunction)__pyx_pf_5pysox_3sox_7CEffect_8get_out_encoding, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pysox_3sox_7CEffect_8get_out_encoding)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_CEffect = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_CEffect = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_CEffect = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_CEffect = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_5pysox_3sox_CEffect = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pysox.sox.CEffect"), /*tp_name*/
  sizeof(struct __pyx_obj_5pysox_3sox_CEffect), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5pysox_3sox_CEffect, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  __pyx_pf_5pysox_3sox_7CEffect_2__repr__, /*tp_repr*/
  &__pyx_tp_as_number_CEffect, /*tp_as_number*/
  &__pyx_tp_as_sequence_CEffect, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_CEffect, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_CEffect, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("CEffect(\"trim\", [ b'2', b'4'])\n    \n    Basic sox effect wraps all builtin effects.\n    It is also used to derive custom effects by inheriting and overloading the create method.\n    \n    Kwargs:\n        name: string of the effects name\n        \n        arguments: array of effect arguments containing byte strings\n    "), /*tp_doc*/
  __pyx_tp_traverse_5pysox_3sox_CEffect, /*tp_traverse*/
  __pyx_tp_clear_5pysox_3sox_CEffect, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5pysox_3sox_CEffect, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pf_5pysox_3sox_7CEffect___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5pysox_3sox_CEffect, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static struct __pyx_vtabstruct_5pysox_3sox_CSignalInfo __pyx_vtable_5pysox_3sox_CSignalInfo;

static PyObject *__pyx_tp_new_5pysox_3sox_CSignalInfo(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_5pysox_3sox_CSignalInfo *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_5pysox_3sox_CSignalInfo *)o);
  p->__pyx_vtab = __pyx_vtabptr_5pysox_3sox_CSignalInfo;
  return o;
}

static void __pyx_tp_dealloc_5pysox_3sox_CSignalInfo(PyObject *o) {
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_5pysox_3sox_CSignalInfo[] = {
  {__Pyx_NAMESTR("get_signalinfo"), (PyCFunction)__pyx_pf_5pysox_3sox_11CSignalInfo_2get_signalinfo, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pysox_3sox_11CSignalInfo_2get_signalinfo)},
  {__Pyx_NAMESTR("set_param"), (PyCFunction)__pyx_pf_5pysox_3sox_11CSignalInfo_3set_param, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pysox_3sox_11CSignalInfo_3set_param)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_CSignalInfo = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_CSignalInfo = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_CSignalInfo = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_CSignalInfo = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_5pysox_3sox_CSignalInfo = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pysox.sox.CSignalInfo"), /*tp_name*/
  sizeof(struct __pyx_obj_5pysox_3sox_CSignalInfo), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5pysox_3sox_CSignalInfo, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  __pyx_pf_5pysox_3sox_11CSignalInfo_1__repr__, /*tp_repr*/
  &__pyx_tp_as_number_CSignalInfo, /*tp_as_number*/
  &__pyx_tp_as_sequence_CSignalInfo, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_CSignalInfo, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_CSignalInfo, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  __Pyx_DOCSTR("Representation of struct sox_signalinfo_t"), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5pysox_3sox_CSignalInfo, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pf_5pysox_3sox_11CSignalInfo___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5pysox_3sox_CSignalInfo, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static struct __pyx_vtabstruct_5pysox_3sox_CEncodingInfo __pyx_vtable_5pysox_3sox_CEncodingInfo;

static PyObject *__pyx_tp_new_5pysox_3sox_CEncodingInfo(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_5pysox_3sox_CEncodingInfo *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)o);
  p->__pyx_vtab = __pyx_vtabptr_5pysox_3sox_CEncodingInfo;
  return o;
}

static void __pyx_tp_dealloc_5pysox_3sox_CEncodingInfo(PyObject *o) {
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_5pysox_3sox_CEncodingInfo[] = {
  {__Pyx_NAMESTR("get_encodinginfo"), (PyCFunction)__pyx_pf_5pysox_3sox_13CEncodingInfo_2get_encodinginfo, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pysox_3sox_13CEncodingInfo_2get_encodinginfo)},
  {__Pyx_NAMESTR("set_param"), (PyCFunction)__pyx_pf_5pysox_3sox_13CEncodingInfo_3set_param, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pysox_3sox_13CEncodingInfo_3set_param)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_CEncodingInfo = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_CEncodingInfo = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_CEncodingInfo = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_CEncodingInfo = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_5pysox_3sox_CEncodingInfo = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pysox.sox.CEncodingInfo"), /*tp_name*/
  sizeof(struct __pyx_obj_5pysox_3sox_CEncodingInfo), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5pysox_3sox_CEncodingInfo, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  __pyx_pf_5pysox_3sox_13CEncodingInfo_1__repr__, /*tp_repr*/
  &__pyx_tp_as_number_CEncodingInfo, /*tp_as_number*/
  &__pyx_tp_as_sequence_CEncodingInfo, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_CEncodingInfo, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_CEncodingInfo, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  __Pyx_DOCSTR("Representation of struct sox_encodinginfo_t"), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5pysox_3sox_CEncodingInfo, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pf_5pysox_3sox_13CEncodingInfo___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5pysox_3sox_CEncodingInfo, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static struct __pyx_vtabstruct_5pysox_3sox_CSoxStream __pyx_vtable_5pysox_3sox_CSoxStream;

static PyObject *__pyx_tp_new_5pysox_3sox_CSoxStream(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_5pysox_3sox_CSoxStream *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_5pysox_3sox_CSoxStream *)o);
  p->__pyx_vtab = __pyx_vtabptr_5pysox_3sox_CSoxStream;
  return o;
}

static void __pyx_tp_dealloc_5pysox_3sox_CSoxStream(PyObject *o) {
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pf_5pysox_3sox_10CSoxStream_1__dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_5pysox_3sox_CSoxStream[] = {
  {__Pyx_NAMESTR("open_read"), (PyCFunction)__pyx_pf_5pysox_3sox_10CSoxStream_4open_read, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pysox_3sox_10CSoxStream_4open_read)},
  {__Pyx_NAMESTR("open_write"), (PyCFunction)__pyx_pf_5pysox_3sox_10CSoxStream_5open_write, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pysox_3sox_10CSoxStream_5open_write)},
  {__Pyx_NAMESTR("close"), (PyCFunction)__pyx_pf_5pysox_3sox_10CSoxStream_6close, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pysox_3sox_10CSoxStream_6close)},
  {__Pyx_NAMESTR("get_signal"), (PyCFunction)__pyx_pf_5pysox_3sox_10CSoxStream_7get_signal, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pysox_3sox_10CSoxStream_7get_signal)},
  {__Pyx_NAMESTR("get_encoding"), (PyCFunction)__pyx_pf_5pysox_3sox_10CSoxStream_8get_encoding, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pysox_3sox_10CSoxStream_8get_encoding)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_CSoxStream = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_CSoxStream = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_CSoxStream = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_CSoxStream = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_5pysox_3sox_CSoxStream = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pysox.sox.CSoxStream"), /*tp_name*/
  sizeof(struct __pyx_obj_5pysox_3sox_CSoxStream), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5pysox_3sox_CSoxStream, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  __pyx_pf_5pysox_3sox_10CSoxStream_3__repr__, /*tp_repr*/
  &__pyx_tp_as_number_CSoxStream, /*tp_as_number*/
  &__pyx_tp_as_sequence_CSoxStream, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_CSoxStream, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pf_5pysox_3sox_10CSoxStream_2__str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_CSoxStream, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  __Pyx_DOCSTR("\n    Representation of struct sox_format_t\n    \n    This class also has the capability of opening audio files for reading and writing\n    and to retrieve their stream parameters such as encodinginfo and signalinfo.\n    \n    "), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5pysox_3sox_CSoxStream, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pf_5pysox_3sox_10CSoxStream___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5pysox_3sox_CSoxStream, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static struct __pyx_vtabstruct_5pysox_3sox_CPysoxPipeStream __pyx_vtable_5pysox_3sox_CPysoxPipeStream;

static PyObject *__pyx_tp_new_5pysox_3sox_CPysoxPipeStream(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_5pysox_3sox_CPysoxPipeStream *p;
  PyObject *o = __pyx_tp_new_5pysox_3sox_CSoxStream(t, a, k);
  if (!o) return 0;
  p = ((struct __pyx_obj_5pysox_3sox_CPysoxPipeStream *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5pysox_3sox_CSoxStream*)__pyx_vtabptr_5pysox_3sox_CPysoxPipeStream;
  p->channel = Py_None; Py_INCREF(Py_None);
  p->initialdata = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_5pysox_3sox_CPysoxPipeStream(PyObject *o) {
  struct __pyx_obj_5pysox_3sox_CPysoxPipeStream *p = (struct __pyx_obj_5pysox_3sox_CPysoxPipeStream *)o;
  Py_XDECREF(p->channel);
  Py_XDECREF(p->initialdata);
  __pyx_tp_dealloc_5pysox_3sox_CSoxStream(o);
}

static int __pyx_tp_traverse_5pysox_3sox_CPysoxPipeStream(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5pysox_3sox_CPysoxPipeStream *p = (struct __pyx_obj_5pysox_3sox_CPysoxPipeStream *)o;
  if (__pyx_ptype_5pysox_3sox_CSoxStream->tp_traverse) {
    e = __pyx_ptype_5pysox_3sox_CSoxStream->tp_traverse(o, v, a); if (e) return e;
  }
  if (p->channel) {
    e = (*v)(p->channel, a); if (e) return e;
  }
  if (p->initialdata) {
    e = (*v)(p->initialdata, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_5pysox_3sox_CPysoxPipeStream(PyObject *o) {
  struct __pyx_obj_5pysox_3sox_CPysoxPipeStream *p = (struct __pyx_obj_5pysox_3sox_CPysoxPipeStream *)o;
  PyObject* tmp;
  if (__pyx_ptype_5pysox_3sox_CSoxStream->tp_clear) {
    __pyx_ptype_5pysox_3sox_CSoxStream->tp_clear(o);
  }
  tmp = ((PyObject*)p->channel);
  p->channel = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->initialdata);
  p->initialdata = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_5pysox_3sox_CPysoxPipeStream[] = {
  {__Pyx_NAMESTR("open_read"), (PyCFunction)__pyx_pf_5pysox_3sox_16CPysoxPipeStream_3open_read, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("open_write"), (PyCFunction)__pyx_pf_5pysox_3sox_16CPysoxPipeStream_4open_write, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("close"), (PyCFunction)__pyx_pf_5pysox_3sox_16CPysoxPipeStream_5close, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pysox_3sox_16CPysoxPipeStream_5close)},
  {__Pyx_NAMESTR("start_read"), (PyCFunction)__pyx_pf_5pysox_3sox_16CPysoxPipeStream_6start_read, METH_NOARGS, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_CPysoxPipeStream = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_CPysoxPipeStream = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_CPysoxPipeStream = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_CPysoxPipeStream = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_5pysox_3sox_CPysoxPipeStream = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pysox.sox.CPysoxPipeStream"), /*tp_name*/
  sizeof(struct __pyx_obj_5pysox_3sox_CPysoxPipeStream), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5pysox_3sox_CPysoxPipeStream, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  __pyx_pf_5pysox_3sox_16CPysoxPipeStream_2__repr__, /*tp_repr*/
  &__pyx_tp_as_number_CPysoxPipeStream, /*tp_as_number*/
  &__pyx_tp_as_sequence_CPysoxPipeStream, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_CPysoxPipeStream, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pf_5pysox_3sox_16CPysoxPipeStream_1__str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_CPysoxPipeStream, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("Input stream analog to CSoxStream, but reading from a python:processes Pipe\n    \n    Kwargs:\n        path: multiprocessing.Pipe socket endpoint\n    "), /*tp_doc*/
  __pyx_tp_traverse_5pysox_3sox_CPysoxPipeStream, /*tp_traverse*/
  __pyx_tp_clear_5pysox_3sox_CPysoxPipeStream, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5pysox_3sox_CPysoxPipeStream, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pf_5pysox_3sox_16CPysoxPipeStream___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5pysox_3sox_CPysoxPipeStream, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static struct __pyx_vtabstruct_5pysox_3sox_SoxSampleBuffer __pyx_vtable_5pysox_3sox_SoxSampleBuffer;

static PyObject *__pyx_tp_new_5pysox_3sox_SoxSampleBuffer(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)o);
  p->__pyx_vtab = __pyx_vtabptr_5pysox_3sox_SoxSampleBuffer;
  p->format = Py_None; Py_INCREF(Py_None);
  p->offset = Py_None; Py_INCREF(Py_None);
  p->recieved_flags = Py_None; Py_INCREF(Py_None);
  p->release_ok = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_5pysox_3sox_SoxSampleBuffer(PyObject *o) {
  struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *p = (struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)o;
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pf_5pysox_3sox_15SoxSampleBuffer_1__dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_XDECREF(p->format);
  Py_XDECREF(p->offset);
  Py_XDECREF(p->recieved_flags);
  Py_XDECREF(p->release_ok);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_5pysox_3sox_SoxSampleBuffer(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *p = (struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)o;
  if (p->format) {
    e = (*v)(p->format, a); if (e) return e;
  }
  if (p->offset) {
    e = (*v)(p->offset, a); if (e) return e;
  }
  if (p->recieved_flags) {
    e = (*v)(p->recieved_flags, a); if (e) return e;
  }
  if (p->release_ok) {
    e = (*v)(p->release_ok, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_5pysox_3sox_SoxSampleBuffer(PyObject *o) {
  struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *p = (struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->format);
  p->format = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->offset);
  p->offset = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->recieved_flags);
  p->recieved_flags = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->release_ok);
  p->release_ok = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
static PyObject *__pyx_sq_item_5pysox_3sox_SoxSampleBuffer(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static int __pyx_mp_ass_subscript_5pysox_3sox_SoxSampleBuffer(PyObject *o, PyObject *i, PyObject *v) {
  if (v) {
    return __pyx_pf_5pysox_3sox_15SoxSampleBuffer_7__setitem__(o, i, v);
  }
  else {
    PyErr_Format(PyExc_NotImplementedError,
      "Subscript deletion not supported by %s", Py_TYPE(o)->tp_name);
    return -1;
  }
}

static PyObject *__pyx_getprop_5pysox_3sox_15SoxSampleBuffer_recieved_flags(PyObject *o, void *x) {
  return __pyx_pf_5pysox_3sox_15SoxSampleBuffer_14recieved_flags___get__(o);
}

static PyObject *__pyx_getprop_5pysox_3sox_15SoxSampleBuffer_release_ok(PyObject *o, void *x) {
  return __pyx_pf_5pysox_3sox_15SoxSampleBuffer_10release_ok___get__(o);
}

static PyMethodDef __pyx_methods_5pysox_3sox_SoxSampleBuffer[] = {
  {__Pyx_NAMESTR("set_datalen"), (PyCFunction)__pyx_pf_5pysox_3sox_15SoxSampleBuffer_4set_datalen, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("set_readonly"), (PyCFunction)__pyx_pf_5pysox_3sox_15SoxSampleBuffer_5set_readonly, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("get_buffer_size"), (PyCFunction)__pyx_pf_5pysox_3sox_15SoxSampleBuffer_8get_buffer_size, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pysox_3sox_15SoxSampleBuffer_8get_buffer_size)},
  {__Pyx_NAMESTR("fromlist"), (PyCFunction)__pyx_pf_5pysox_3sox_15SoxSampleBuffer_11fromlist, METH_O, __Pyx_DOCSTR(__pyx_doc_5pysox_3sox_15SoxSampleBuffer_11fromlist)},
  {__Pyx_NAMESTR("writelist"), (PyCFunction)__pyx_pf_5pysox_3sox_15SoxSampleBuffer_12writelist, METH_O, __Pyx_DOCSTR(__pyx_doc_5pysox_3sox_15SoxSampleBuffer_12writelist)},
  {__Pyx_NAMESTR("frombytes"), (PyCFunction)__pyx_pf_5pysox_3sox_15SoxSampleBuffer_13frombytes, METH_O, __Pyx_DOCSTR(__pyx_doc_5pysox_3sox_15SoxSampleBuffer_13frombytes)},
  {__Pyx_NAMESTR("writebytes"), (PyCFunction)__pyx_pf_5pysox_3sox_15SoxSampleBuffer_14writebytes, METH_O, __Pyx_DOCSTR(__pyx_doc_5pysox_3sox_15SoxSampleBuffer_14writebytes)},
  {__Pyx_NAMESTR("tobytearray"), (PyCFunction)__pyx_pf_5pysox_3sox_15SoxSampleBuffer_15tobytearray, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pysox_3sox_15SoxSampleBuffer_15tobytearray)},
  {__Pyx_NAMESTR("tolist"), (PyCFunction)__pyx_pf_5pysox_3sox_15SoxSampleBuffer_16tolist, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pysox_3sox_15SoxSampleBuffer_16tolist)},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_5pysox_3sox_SoxSampleBuffer[] = {
  {(char *)"recieved_flags", __pyx_getprop_5pysox_3sox_15SoxSampleBuffer_recieved_flags, 0, 0, 0},
  {(char *)"release_ok", __pyx_getprop_5pysox_3sox_15SoxSampleBuffer_release_ok, 0, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_SoxSampleBuffer = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_SoxSampleBuffer = {
  __pyx_pf_5pysox_3sox_15SoxSampleBuffer_9__len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_5pysox_3sox_SoxSampleBuffer, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_SoxSampleBuffer = {
  __pyx_pf_5pysox_3sox_15SoxSampleBuffer_9__len__, /*mp_length*/
  __pyx_pf_5pysox_3sox_15SoxSampleBuffer_6__getitem__, /*mp_subscript*/
  __pyx_mp_ass_subscript_5pysox_3sox_SoxSampleBuffer, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_SoxSampleBuffer = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  __pyx_pf_5pysox_3sox_15SoxSampleBuffer_2__getbuffer__, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  __pyx_pf_5pysox_3sox_15SoxSampleBuffer_3__releasebuffer__, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_5pysox_3sox_SoxSampleBuffer = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pysox.sox.SoxSampleBuffer"), /*tp_name*/
  sizeof(struct __pyx_obj_5pysox_3sox_SoxSampleBuffer), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5pysox_3sox_SoxSampleBuffer, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_SoxSampleBuffer, /*tp_as_number*/
  &__pyx_tp_as_sequence_SoxSampleBuffer, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_SoxSampleBuffer, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_SoxSampleBuffer, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("Python representation of a sox buffer memory area\n    \n    Supports the PEP-3118 buffer interface and can be used within a\n    memoryview object.\n    \n    Additionally, __getitem__ and __setitem__ and the iterator interface are\n    supported in order to access the buffer data using index operations\n\n    Kwargs:\n        data: default None, initialize the buffer with a bytarray, bytes or an array of integers.\n        The data is being copied.\n\n    Raises:\n        TypeError if data is not bytes or an array\n    "), /*tp_doc*/
  __pyx_tp_traverse_5pysox_3sox_SoxSampleBuffer, /*tp_traverse*/
  __pyx_tp_clear_5pysox_3sox_SoxSampleBuffer, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pf_5pysox_3sox_15SoxSampleBuffer_10__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5pysox_3sox_SoxSampleBuffer, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_5pysox_3sox_SoxSampleBuffer, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pf_5pysox_3sox_15SoxSampleBuffer___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5pysox_3sox_SoxSampleBuffer, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static struct __pyx_vtabstruct_5pysox_3sox_CNullFile __pyx_vtable_5pysox_3sox_CNullFile;

static PyObject *__pyx_tp_new_5pysox_3sox_CNullFile(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_5pysox_3sox_CNullFile *p;
  PyObject *o = __pyx_tp_new_5pysox_3sox_CSoxStream(t, a, k);
  if (!o) return 0;
  p = ((struct __pyx_obj_5pysox_3sox_CNullFile *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5pysox_3sox_CSoxStream*)__pyx_vtabptr_5pysox_3sox_CNullFile;
  return o;
}

static PyMethodDef __pyx_methods_5pysox_3sox_CNullFile[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_CNullFile = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_CNullFile = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_CNullFile = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_CNullFile = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_5pysox_3sox_CNullFile = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pysox.sox.CNullFile"), /*tp_name*/
  sizeof(struct __pyx_obj_5pysox_3sox_CNullFile), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5pysox_3sox_CSoxStream, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_CNullFile, /*tp_as_number*/
  &__pyx_tp_as_sequence_CNullFile, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_CNullFile, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_CNullFile, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  __Pyx_DOCSTR("nullstream = CNullFile()\n    \n    The null input file, which produces an infinite amount of silence\n    \n    Kwargs:\n        path: string\n        \n        mode: string\n        \n        signalInfo: CSignalInfo\n            if provided, these signal parameters are used.\n            Otherwise the signal will be 48000 rate, 2 channels, 32 bits\n        \n        encodingInfo: CEncodingInfo\n            if provided, use that encodingInfo,\n            otherwise we'll have 32bit signed integer PCM\n        \n        fileType: string\n    "), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5pysox_3sox_CNullFile, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pf_5pysox_3sox_9CNullFile___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5pysox_3sox_CNullFile, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static struct __pyx_vtabstruct_5pysox_3sox_CEffectsChain __pyx_vtable_5pysox_3sox_CEffectsChain;

static PyObject *__pyx_tp_new_5pysox_3sox_CEffectsChain(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_5pysox_3sox_CEffectsChain *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_5pysox_3sox_CEffectsChain *)o);
  p->__pyx_vtab = __pyx_vtabptr_5pysox_3sox_CEffectsChain;
  p->instream = ((struct __pyx_obj_5pysox_3sox_CSoxStream *)Py_None); Py_INCREF(Py_None);
  p->outstream = ((struct __pyx_obj_5pysox_3sox_CSoxStream *)Py_None); Py_INCREF(Py_None);
  p->inencoding = ((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)Py_None); Py_INCREF(Py_None);
  p->outencoding = ((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)Py_None); Py_INCREF(Py_None);
  p->insignal = ((struct __pyx_obj_5pysox_3sox_CSignalInfo *)Py_None); Py_INCREF(Py_None);
  p->outsignal = ((struct __pyx_obj_5pysox_3sox_CSignalInfo *)Py_None); Py_INCREF(Py_None);
  p->haveInputEffect = Py_None; Py_INCREF(Py_None);
  p->haveOutputEffect = Py_None; Py_INCREF(Py_None);
  p->effects = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_5pysox_3sox_CEffectsChain(PyObject *o) {
  struct __pyx_obj_5pysox_3sox_CEffectsChain *p = (struct __pyx_obj_5pysox_3sox_CEffectsChain *)o;
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pf_5pysox_3sox_13CEffectsChain_1__dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_XDECREF(((PyObject *)p->instream));
  Py_XDECREF(((PyObject *)p->outstream));
  Py_XDECREF(((PyObject *)p->inencoding));
  Py_XDECREF(((PyObject *)p->outencoding));
  Py_XDECREF(((PyObject *)p->insignal));
  Py_XDECREF(((PyObject *)p->outsignal));
  Py_XDECREF(p->haveInputEffect);
  Py_XDECREF(p->haveOutputEffect);
  Py_XDECREF(p->effects);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_5pysox_3sox_CEffectsChain(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5pysox_3sox_CEffectsChain *p = (struct __pyx_obj_5pysox_3sox_CEffectsChain *)o;
  if (p->instream) {
    e = (*v)(((PyObject*)p->instream), a); if (e) return e;
  }
  if (p->outstream) {
    e = (*v)(((PyObject*)p->outstream), a); if (e) return e;
  }
  if (p->inencoding) {
    e = (*v)(((PyObject*)p->inencoding), a); if (e) return e;
  }
  if (p->outencoding) {
    e = (*v)(((PyObject*)p->outencoding), a); if (e) return e;
  }
  if (p->insignal) {
    e = (*v)(((PyObject*)p->insignal), a); if (e) return e;
  }
  if (p->outsignal) {
    e = (*v)(((PyObject*)p->outsignal), a); if (e) return e;
  }
  if (p->haveInputEffect) {
    e = (*v)(p->haveInputEffect, a); if (e) return e;
  }
  if (p->haveOutputEffect) {
    e = (*v)(p->haveOutputEffect, a); if (e) return e;
  }
  if (p->effects) {
    e = (*v)(p->effects, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_5pysox_3sox_CEffectsChain(PyObject *o) {
  struct __pyx_obj_5pysox_3sox_CEffectsChain *p = (struct __pyx_obj_5pysox_3sox_CEffectsChain *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->instream);
  p->instream = ((struct __pyx_obj_5pysox_3sox_CSoxStream *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->outstream);
  p->outstream = ((struct __pyx_obj_5pysox_3sox_CSoxStream *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->inencoding);
  p->inencoding = ((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->outencoding);
  p->outencoding = ((struct __pyx_obj_5pysox_3sox_CEncodingInfo *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->insignal);
  p->insignal = ((struct __pyx_obj_5pysox_3sox_CSignalInfo *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->outsignal);
  p->outsignal = ((struct __pyx_obj_5pysox_3sox_CSignalInfo *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->haveInputEffect);
  p->haveInputEffect = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->haveOutputEffect);
  p->haveOutputEffect = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->effects);
  p->effects = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_5pysox_3sox_CEffectsChain[] = {
  {__Pyx_NAMESTR("add_effect"), (PyCFunction)__pyx_pf_5pysox_3sox_13CEffectsChain_3add_effect, METH_O, __Pyx_DOCSTR(__pyx_doc_5pysox_3sox_13CEffectsChain_3add_effect)},
  {__Pyx_NAMESTR("flow_effects"), (PyCFunction)__pyx_pf_5pysox_3sox_13CEffectsChain_4flow_effects, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pysox_3sox_13CEffectsChain_4flow_effects)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_CEffectsChain = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_CEffectsChain = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_CEffectsChain = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_CEffectsChain = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_5pysox_3sox_CEffectsChain = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pysox.sox.CEffectsChain"), /*tp_name*/
  sizeof(struct __pyx_obj_5pysox_3sox_CEffectsChain), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5pysox_3sox_CEffectsChain, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  __pyx_pf_5pysox_3sox_13CEffectsChain_2__repr__, /*tp_repr*/
  &__pyx_tp_as_number_CEffectsChain, /*tp_as_number*/
  &__pyx_tp_as_sequence_CEffectsChain, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_CEffectsChain, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_CEffectsChain, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("The effectschain is the primary instrument of processing audio data.\n    CEffectsChain is basically a wrapper around sox_effects_chain_t and provides\n    methods to add effects, to start the processing (flow) and to set parameters on\n    input and output.\n    \n    "), /*tp_doc*/
  __pyx_tp_traverse_5pysox_3sox_CEffectsChain, /*tp_traverse*/
  __pyx_tp_clear_5pysox_3sox_CEffectsChain, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5pysox_3sox_CEffectsChain, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pf_5pysox_3sox_13CEffectsChain___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5pysox_3sox_CEffectsChain, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_5pysox_3sox_SoxBufferIterator(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_5pysox_3sox_SoxBufferIterator *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_5pysox_3sox_SoxBufferIterator *)o);
  p->b = ((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_5pysox_3sox_SoxBufferIterator(PyObject *o) {
  struct __pyx_obj_5pysox_3sox_SoxBufferIterator *p = (struct __pyx_obj_5pysox_3sox_SoxBufferIterator *)o;
  Py_XDECREF(((PyObject *)p->b));
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_5pysox_3sox_SoxBufferIterator(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5pysox_3sox_SoxBufferIterator *p = (struct __pyx_obj_5pysox_3sox_SoxBufferIterator *)o;
  if (p->b) {
    e = (*v)(((PyObject*)p->b), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_5pysox_3sox_SoxBufferIterator(PyObject *o) {
  struct __pyx_obj_5pysox_3sox_SoxBufferIterator *p = (struct __pyx_obj_5pysox_3sox_SoxBufferIterator *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->b);
  p->b = ((struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_5pysox_3sox_SoxBufferIterator[] = {
  {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pf_5pysox_3sox_17SoxBufferIterator_2__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_SoxBufferIterator = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_SoxBufferIterator = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_SoxBufferIterator = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_SoxBufferIterator = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_5pysox_3sox_SoxBufferIterator = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pysox.sox.SoxBufferIterator"), /*tp_name*/
  sizeof(struct __pyx_obj_5pysox_3sox_SoxBufferIterator), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5pysox_3sox_SoxBufferIterator, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_SoxBufferIterator, /*tp_as_number*/
  &__pyx_tp_as_sequence_SoxBufferIterator, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_SoxBufferIterator, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_SoxBufferIterator, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_5pysox_3sox_SoxBufferIterator, /*tp_traverse*/
  __pyx_tp_clear_5pysox_3sox_SoxBufferIterator, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pf_5pysox_3sox_17SoxBufferIterator_1__iter__, /*tp_iter*/
  __pyx_pf_5pysox_3sox_17SoxBufferIterator_2__next__, /*tp_iternext*/
  __pyx_methods_5pysox_3sox_SoxBufferIterator, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pf_5pysox_3sox_17SoxBufferIterator___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5pysox_3sox_SoxBufferIterator, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_5pysox_3sox___CSox(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  if (__pyx_pf_5pysox_3sox_6__CSox___cinit__(o, __pyx_empty_tuple, NULL) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_5pysox_3sox___CSox(PyObject *o) {
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pf_5pysox_3sox_6__CSox_1__dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_5pysox_3sox___CSox[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number___CSox = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence___CSox = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping___CSox = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer___CSox = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_5pysox_3sox___CSox = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pysox.sox.__CSox"), /*tp_name*/
  sizeof(struct __pyx_obj_5pysox_3sox___CSox), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5pysox_3sox___CSox, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number___CSox, /*tp_as_number*/
  &__pyx_tp_as_sequence___CSox, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___CSox, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer___CSox, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5pysox_3sox___CSox, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5pysox_3sox___CSox, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_5pysox_3sox___pyx_scope_struct____getbuffer__(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_5pysox_3sox___pyx_scope_struct____getbuffer__ *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_5pysox_3sox___pyx_scope_struct____getbuffer__ *)o);
  p->__pyx_v_received_flags = 0;
  return o;
}

static void __pyx_tp_dealloc_5pysox_3sox___pyx_scope_struct____getbuffer__(PyObject *o) {
  struct __pyx_obj_5pysox_3sox___pyx_scope_struct____getbuffer__ *p = (struct __pyx_obj_5pysox_3sox___pyx_scope_struct____getbuffer__ *)o;
  Py_XDECREF(p->__pyx_v_received_flags);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_5pysox_3sox___pyx_scope_struct____getbuffer__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5pysox_3sox___pyx_scope_struct____getbuffer__ *p = (struct __pyx_obj_5pysox_3sox___pyx_scope_struct____getbuffer__ *)o;
  if (p->__pyx_v_received_flags) {
    e = (*v)(p->__pyx_v_received_flags, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_5pysox_3sox___pyx_scope_struct____getbuffer__(PyObject *o) {
  struct __pyx_obj_5pysox_3sox___pyx_scope_struct____getbuffer__ *p = (struct __pyx_obj_5pysox_3sox___pyx_scope_struct____getbuffer__ *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->__pyx_v_received_flags);
  p->__pyx_v_received_flags = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_5pysox_3sox___pyx_scope_struct____getbuffer__[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct____getbuffer__ = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct____getbuffer__ = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping___pyx_scope_struct____getbuffer__ = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct____getbuffer__ = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_5pysox_3sox___pyx_scope_struct____getbuffer__ = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pysox.sox.__pyx_scope_struct____getbuffer__"), /*tp_name*/
  sizeof(struct __pyx_obj_5pysox_3sox___pyx_scope_struct____getbuffer__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5pysox_3sox___pyx_scope_struct____getbuffer__, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number___pyx_scope_struct____getbuffer__, /*tp_as_number*/
  &__pyx_tp_as_sequence___pyx_scope_struct____getbuffer__, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___pyx_scope_struct____getbuffer__, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer___pyx_scope_struct____getbuffer__, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_5pysox_3sox___pyx_scope_struct____getbuffer__, /*tp_traverse*/
  __pyx_tp_clear_5pysox_3sox___pyx_scope_struct____getbuffer__, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5pysox_3sox___pyx_scope_struct____getbuffer__, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5pysox_3sox___pyx_scope_struct____getbuffer__, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};

#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef __pyx_moduledef = {
    PyModuleDef_HEAD_INIT,
    __Pyx_NAMESTR("sox"),
    0, /* m_doc */
    -1, /* m_size */
    __pyx_methods /* m_methods */,
    NULL, /* m_reload */
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0},
  {&__pyx_kp_s_10, __pyx_k_10, sizeof(__pyx_k_10), 0, 0, 1, 0},
  {&__pyx_kp_u_13, __pyx_k_13, sizeof(__pyx_k_13), 0, 1, 0, 0},
  {&__pyx_kp_u_14, __pyx_k_14, sizeof(__pyx_k_14), 0, 1, 0, 0},
  {&__pyx_kp_s_15, __pyx_k_15, sizeof(__pyx_k_15), 0, 0, 1, 0},
  {&__pyx_kp_s_17, __pyx_k_17, sizeof(__pyx_k_17), 0, 0, 1, 0},
  {&__pyx_kp_s_18, __pyx_k_18, sizeof(__pyx_k_18), 0, 0, 1, 0},
  {&__pyx_kp_s_19, __pyx_k_19, sizeof(__pyx_k_19), 0, 0, 1, 0},
  {&__pyx_kp_s_20, __pyx_k_20, sizeof(__pyx_k_20), 0, 0, 1, 0},
  {&__pyx_kp_s_21, __pyx_k_21, sizeof(__pyx_k_21), 0, 0, 1, 0},
  {&__pyx_kp_u_24, __pyx_k_24, sizeof(__pyx_k_24), 0, 1, 0, 0},
  {&__pyx_kp_u_25, __pyx_k_25, sizeof(__pyx_k_25), 0, 1, 0, 0},
  {&__pyx_kp_s_26, __pyx_k_26, sizeof(__pyx_k_26), 0, 0, 1, 0},
  {&__pyx_kp_s_28, __pyx_k_28, sizeof(__pyx_k_28), 0, 0, 1, 0},
  {&__pyx_kp_u_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 1, 0, 0},
  {&__pyx_n_s_30, __pyx_k_30, sizeof(__pyx_k_30), 0, 0, 1, 1},
  {&__pyx_kp_s_31, __pyx_k_31, sizeof(__pyx_k_31), 0, 0, 1, 0},
  {&__pyx_kp_s_33, __pyx_k_33, sizeof(__pyx_k_33), 0, 0, 1, 0},
  {&__pyx_kp_s_36, __pyx_k_36, sizeof(__pyx_k_36), 0, 0, 1, 0},
  {&__pyx_n_s_38, __pyx_k_38, sizeof(__pyx_k_38), 0, 0, 1, 1},
  {&__pyx_kp_s_39, __pyx_k_39, sizeof(__pyx_k_39), 0, 0, 1, 0},
  {&__pyx_kp_u_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 1, 0, 0},
  {&__pyx_kp_b_41, __pyx_k_41, sizeof(__pyx_k_41), 0, 0, 0, 0},
  {&__pyx_n_s_42, __pyx_k_42, sizeof(__pyx_k_42), 0, 0, 1, 1},
  {&__pyx_kp_s_43, __pyx_k_43, sizeof(__pyx_k_43), 0, 0, 1, 0},
  {&__pyx_kp_s_46, __pyx_k_46, sizeof(__pyx_k_46), 0, 0, 1, 0},
  {&__pyx_kp_s_48, __pyx_k_48, sizeof(__pyx_k_48), 0, 0, 1, 0},
  {&__pyx_kp_b_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 0, 0},
  {&__pyx_kp_s_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 1, 0},
  {&__pyx_kp_u_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 1, 0, 0},
  {&__pyx_kp_s_50, __pyx_k_50, sizeof(__pyx_k_50), 0, 0, 1, 0},
  {&__pyx_kp_s_52, __pyx_k_52, sizeof(__pyx_k_52), 0, 0, 1, 0},
  {&__pyx_kp_s_56, __pyx_k_56, sizeof(__pyx_k_56), 0, 0, 1, 0},
  {&__pyx_kp_s_58, __pyx_k_58, sizeof(__pyx_k_58), 0, 0, 1, 0},
  {&__pyx_kp_u_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 1, 0, 0},
  {&__pyx_kp_u_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 1, 0, 0},
  {&__pyx_kp_s_8, __pyx_k_8, sizeof(__pyx_k_8), 0, 0, 1, 0},
  {&__pyx_n_s__ALAW, __pyx_k__ALAW, sizeof(__pyx_k__ALAW), 0, 0, 1, 1},
  {&__pyx_n_s__AMR_NB, __pyx_k__AMR_NB, sizeof(__pyx_k__AMR_NB), 0, 0, 1, 1},
  {&__pyx_n_s__AMR_WB, __pyx_k__AMR_WB, sizeof(__pyx_k__AMR_WB), 0, 0, 1, 1},
  {&__pyx_n_s__BufferError, __pyx_k__BufferError, sizeof(__pyx_k__BufferError), 0, 0, 1, 1},
  {&__pyx_n_s__CL_ADPCM, __pyx_k__CL_ADPCM, sizeof(__pyx_k__CL_ADPCM), 0, 0, 1, 1},
  {&__pyx_n_s__CL_ADPCM16, __pyx_k__CL_ADPCM16, sizeof(__pyx_k__CL_ADPCM16), 0, 0, 1, 1},
  {&__pyx_n_s__CVSD, __pyx_k__CVSD, sizeof(__pyx_k__CVSD), 0, 0, 1, 1},
  {&__pyx_n_s__C_CONTIGUOUS, __pyx_k__C_CONTIGUOUS, sizeof(__pyx_k__C_CONTIGUOUS), 0, 0, 1, 1},
  {&__pyx_n_s__DPCM, __pyx_k__DPCM, sizeof(__pyx_k__DPCM), 0, 0, 1, 1},
  {&__pyx_n_s__DWVW, __pyx_k__DWVW, sizeof(__pyx_k__DWVW), 0, 0, 1, 1},
  {&__pyx_n_s__DWVWN, __pyx_k__DWVWN, sizeof(__pyx_k__DWVWN), 0, 0, 1, 1},
  {&__pyx_n_s__EOFError, __pyx_k__EOFError, sizeof(__pyx_k__EOFError), 0, 0, 1, 1},
  {&__pyx_n_s__Exception, __pyx_k__Exception, sizeof(__pyx_k__Exception), 0, 0, 1, 1},
  {&__pyx_n_s__FLAC, __pyx_k__FLAC, sizeof(__pyx_k__FLAC), 0, 0, 1, 1},
  {&__pyx_n_s__FLOAT, __pyx_k__FLOAT, sizeof(__pyx_k__FLOAT), 0, 0, 1, 1},
  {&__pyx_n_s__FLOAT_TEXT, __pyx_k__FLOAT_TEXT, sizeof(__pyx_k__FLOAT_TEXT), 0, 0, 1, 1},
  {&__pyx_n_s__FORMAT, __pyx_k__FORMAT, sizeof(__pyx_k__FORMAT), 0, 0, 1, 1},
  {&__pyx_n_s__F_CONTIGUOUS, __pyx_k__F_CONTIGUOUS, sizeof(__pyx_k__F_CONTIGUOUS), 0, 0, 1, 1},
  {&__pyx_n_s__G721, __pyx_k__G721, sizeof(__pyx_k__G721), 0, 0, 1, 1},
  {&__pyx_n_s__G723, __pyx_k__G723, sizeof(__pyx_k__G723), 0, 0, 1, 1},
  {&__pyx_n_s__GSM, __pyx_k__GSM, sizeof(__pyx_k__GSM), 0, 0, 1, 1},
  {&__pyx_n_s__HCOM, __pyx_k__HCOM, sizeof(__pyx_k__HCOM), 0, 0, 1, 1},
  {&__pyx_n_s__IMA_ADPCM, __pyx_k__IMA_ADPCM, sizeof(__pyx_k__IMA_ADPCM), 0, 0, 1, 1},
  {&__pyx_n_s__INDIRECT, __pyx_k__INDIRECT, sizeof(__pyx_k__INDIRECT), 0, 0, 1, 1},
  {&__pyx_n_s__IOError, __pyx_k__IOError, sizeof(__pyx_k__IOError), 0, 0, 1, 1},
  {&__pyx_n_s__ImportError, __pyx_k__ImportError, sizeof(__pyx_k__ImportError), 0, 0, 1, 1},
  {&__pyx_n_s__IndexError, __pyx_k__IndexError, sizeof(__pyx_k__IndexError), 0, 0, 1, 1},
  {&__pyx_n_s__LPC10, __pyx_k__LPC10, sizeof(__pyx_k__LPC10), 0, 0, 1, 1},
  {&__pyx_n_s__MP3, __pyx_k__MP3, sizeof(__pyx_k__MP3), 0, 0, 1, 1},
  {&__pyx_n_s__MS_ADPCM, __pyx_k__MS_ADPCM, sizeof(__pyx_k__MS_ADPCM), 0, 0, 1, 1},
  {&__pyx_n_s__ND, __pyx_k__ND, sizeof(__pyx_k__ND), 0, 0, 1, 1},
  {&__pyx_n_s__OKI_ADPCM, __pyx_k__OKI_ADPCM, sizeof(__pyx_k__OKI_ADPCM), 0, 0, 1, 1},
  {&__pyx_n_s__PY3, __pyx_k__PY3, sizeof(__pyx_k__PY3), 0, 0, 1, 1},
  {&__pyx_n_s__PysoxError, __pyx_k__PysoxError, sizeof(__pyx_k__PysoxError), 0, 0, 1, 1},
  {&__pyx_n_s__RuntimeError, __pyx_k__RuntimeError, sizeof(__pyx_k__RuntimeError), 0, 0, 1, 1},
  {&__pyx_n_s__SIGN2, __pyx_k__SIGN2, sizeof(__pyx_k__SIGN2), 0, 0, 1, 1},
  {&__pyx_n_s__SOX_EFF_ALPHA, __pyx_k__SOX_EFF_ALPHA, sizeof(__pyx_k__SOX_EFF_ALPHA), 0, 0, 1, 1},
  {&__pyx_n_s__SOX_EFF_CHAN, __pyx_k__SOX_EFF_CHAN, sizeof(__pyx_k__SOX_EFF_CHAN), 0, 0, 1, 1},
  {&__pyx_n_s__SOX_EFF_DEPRECATED, __pyx_k__SOX_EFF_DEPRECATED, sizeof(__pyx_k__SOX_EFF_DEPRECATED), 0, 0, 1, 1},
  {&__pyx_n_s__SOX_EFF_GAIN, __pyx_k__SOX_EFF_GAIN, sizeof(__pyx_k__SOX_EFF_GAIN), 0, 0, 1, 1},
  {&__pyx_n_s__SOX_EFF_INTERNAL, __pyx_k__SOX_EFF_INTERNAL, sizeof(__pyx_k__SOX_EFF_INTERNAL), 0, 0, 1, 1},
  {&__pyx_n_s__SOX_EFF_LENGTH, __pyx_k__SOX_EFF_LENGTH, sizeof(__pyx_k__SOX_EFF_LENGTH), 0, 0, 1, 1},
  {&__pyx_n_s__SOX_EFF_MCHAN, __pyx_k__SOX_EFF_MCHAN, sizeof(__pyx_k__SOX_EFF_MCHAN), 0, 0, 1, 1},
  {&__pyx_n_s__SOX_EFF_MODIFY, __pyx_k__SOX_EFF_MODIFY, sizeof(__pyx_k__SOX_EFF_MODIFY), 0, 0, 1, 1},
  {&__pyx_n_s__SOX_EFF_NULL, __pyx_k__SOX_EFF_NULL, sizeof(__pyx_k__SOX_EFF_NULL), 0, 0, 1, 1},
  {&__pyx_n_s__SOX_EFF_PREC, __pyx_k__SOX_EFF_PREC, sizeof(__pyx_k__SOX_EFF_PREC), 0, 0, 1, 1},
  {&__pyx_n_s__SOX_EFF_RATE, __pyx_k__SOX_EFF_RATE, sizeof(__pyx_k__SOX_EFF_RATE), 0, 0, 1, 1},
  {&__pyx_n_s__STRIDES, __pyx_k__STRIDES, sizeof(__pyx_k__STRIDES), 0, 0, 1, 1},
  {&__pyx_n_s__StopIteration, __pyx_k__StopIteration, sizeof(__pyx_k__StopIteration), 0, 0, 1, 1},
  {&__pyx_n_s__TypeError, __pyx_k__TypeError, sizeof(__pyx_k__TypeError), 0, 0, 1, 1},
  {&__pyx_n_s__ULAW, __pyx_k__ULAW, sizeof(__pyx_k__ULAW), 0, 0, 1, 1},
  {&__pyx_n_s__UNKNOWN, __pyx_k__UNKNOWN, sizeof(__pyx_k__UNKNOWN), 0, 0, 1, 1},
  {&__pyx_n_s__UNSIGNED, __pyx_k__UNSIGNED, sizeof(__pyx_k__UNSIGNED), 0, 0, 1, 1},
  {&__pyx_n_s__VORBIS, __pyx_k__VORBIS, sizeof(__pyx_k__VORBIS), 0, 0, 1, 1},
  {&__pyx_n_s__WAVPACK, __pyx_k__WAVPACK, sizeof(__pyx_k__WAVPACK), 0, 0, 1, 1},
  {&__pyx_n_s__WAVPACKF, __pyx_k__WAVPACKF, sizeof(__pyx_k__WAVPACKF), 0, 0, 1, 1},
  {&__pyx_n_s__WRITABLE, __pyx_k__WRITABLE, sizeof(__pyx_k__WRITABLE), 0, 0, 1, 1},
  {&__pyx_n_s__XXXXXXX, __pyx_k__XXXXXXX, sizeof(__pyx_k__XXXXXXX), 0, 0, 1, 1},
  {&__pyx_n_s__ZZZZZZZZZZ, __pyx_k__ZZZZZZZZZZ, sizeof(__pyx_k__ZZZZZZZZZZ), 0, 0, 1, 1},
  {&__pyx_n_s____calculate_signals, __pyx_k____calculate_signals, sizeof(__pyx_k____calculate_signals), 0, 0, 1, 1},
  {&__pyx_n_s____create_buffer, __pyx_k____create_buffer, sizeof(__pyx_k____create_buffer), 0, 0, 1, 1},
  {&__pyx_n_s____do_dealloc, __pyx_k____do_dealloc, sizeof(__pyx_k____do_dealloc), 0, 0, 1, 1},
  {&__pyx_n_s____do_dealloc_if, __pyx_k____do_dealloc_if, sizeof(__pyx_k____do_dealloc_if), 0, 0, 1, 1},
  {&__pyx_n_s____init__, __pyx_k____init__, sizeof(__pyx_k____init__), 0, 0, 1, 1},
  {&__pyx_n_s____init_effect, __pyx_k____init_effect, sizeof(__pyx_k____init_effect), 0, 0, 1, 1},
  {&__pyx_n_s____init_effects, __pyx_k____init_effects, sizeof(__pyx_k____init_effects), 0, 0, 1, 1},
  {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1},
  {&__pyx_n_s____optimize_trim, __pyx_k____optimize_trim, sizeof(__pyx_k____optimize_trim), 0, 0, 1, 1},
  {&__pyx_n_s____setInput, __pyx_k____setInput, sizeof(__pyx_k____setInput), 0, 0, 1, 1},
  {&__pyx_n_s____setOutput, __pyx_k____setOutput, sizeof(__pyx_k____setOutput), 0, 0, 1, 1},
  {&__pyx_n_s____sox_initializer, __pyx_k____sox_initializer, sizeof(__pyx_k____sox_initializer), 0, 0, 1, 1},
  {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1},
  {&__pyx_n_s__argc, __pyx_k__argc, sizeof(__pyx_k__argc), 0, 0, 1, 1},
  {&__pyx_n_s__argv, __pyx_k__argv, sizeof(__pyx_k__argv), 0, 0, 1, 1},
  {&__pyx_n_s__asCharP, __pyx_k__asCharP, sizeof(__pyx_k__asCharP), 0, 0, 1, 1},
  {&__pyx_n_s__available_flags, __pyx_k__available_flags, sizeof(__pyx_k__available_flags), 0, 0, 1, 1},
  {&__pyx_n_s__b, __pyx_k__b, sizeof(__pyx_k__b), 0, 0, 1, 1},
  {&__pyx_n_s__bits_per_sample, __pyx_k__bits_per_sample, sizeof(__pyx_k__bits_per_sample), 0, 0, 1, 1},
  {&__pyx_n_s__buf, __pyx_k__buf, sizeof(__pyx_k__buf), 0, 0, 1, 1},
  {&__pyx_n_s__buffer, __pyx_k__buffer, sizeof(__pyx_k__buffer), 0, 0, 1, 1},
  {&__pyx_n_s__bytearray, __pyx_k__bytearray, sizeof(__pyx_k__bytearray), 0, 0, 1, 1},
  {&__pyx_n_s__cget_encoding, __pyx_k__cget_encoding, sizeof(__pyx_k__cget_encoding), 0, 0, 1, 1},
  {&__pyx_n_s__cget_signal, __pyx_k__cget_signal, sizeof(__pyx_k__cget_signal), 0, 0, 1, 1},
  {&__pyx_n_s__chain, __pyx_k__chain, sizeof(__pyx_k__chain), 0, 0, 1, 1},
  {&__pyx_n_s__channel, __pyx_k__channel, sizeof(__pyx_k__channel), 0, 0, 1, 1},
  {&__pyx_n_s__channels, __pyx_k__channels, sizeof(__pyx_k__channels), 0, 0, 1, 1},
  {&__pyx_n_s__close, __pyx_k__close, sizeof(__pyx_k__close), 0, 0, 1, 1},
  {&__pyx_n_s__compression, __pyx_k__compression, sizeof(__pyx_k__compression), 0, 0, 1, 1},
  {&__pyx_n_s__create, __pyx_k__create, sizeof(__pyx_k__create), 0, 0, 1, 1},
  {&__pyx_n_s__cset_encoding, __pyx_k__cset_encoding, sizeof(__pyx_k__cset_encoding), 0, 0, 1, 1},
  {&__pyx_n_s__cset_signal, __pyx_k__cset_signal, sizeof(__pyx_k__cset_signal), 0, 0, 1, 1},
  {&__pyx_n_s__data, __pyx_k__data, sizeof(__pyx_k__data), 0, 0, 1, 1},
  {&__pyx_n_s__datalen, __pyx_k__datalen, sizeof(__pyx_k__datalen), 0, 0, 1, 1},
  {&__pyx_n_s__desc, __pyx_k__desc, sizeof(__pyx_k__desc), 0, 0, 1, 1},
  {&__pyx_n_s__description, __pyx_k__description, sizeof(__pyx_k__description), 0, 0, 1, 1},
  {&__pyx_n_s__effect, __pyx_k__effect, sizeof(__pyx_k__effect), 0, 0, 1, 1},
  {&__pyx_n_s__effects, __pyx_k__effects, sizeof(__pyx_k__effects), 0, 0, 1, 1},
  {&__pyx_n_s__encode, __pyx_k__encode, sizeof(__pyx_k__encode), 0, 0, 1, 1},
  {&__pyx_n_s__encoding, __pyx_k__encoding, sizeof(__pyx_k__encoding), 0, 0, 1, 1},
  {&__pyx_n_s__encodingInfo, __pyx_k__encodingInfo, sizeof(__pyx_k__encodingInfo), 0, 0, 1, 1},
  {&__pyx_n_s__enumerate, __pyx_k__enumerate, sizeof(__pyx_k__enumerate), 0, 0, 1, 1},
  {&__pyx_n_s__fileType, __pyx_k__fileType, sizeof(__pyx_k__fileType), 0, 0, 1, 1},
  {&__pyx_n_s__filename, __pyx_k__filename, sizeof(__pyx_k__filename), 0, 0, 1, 1},
  {&__pyx_n_s__filetype, __pyx_k__filetype, sizeof(__pyx_k__filetype), 0, 0, 1, 1},
  {&__pyx_n_s__flagname, __pyx_k__flagname, sizeof(__pyx_k__flagname), 0, 0, 1, 1},
  {&__pyx_n_s__flags, __pyx_k__flags, sizeof(__pyx_k__flags), 0, 0, 1, 1},
  {&__pyx_n_s__flow_effects, __pyx_k__flow_effects, sizeof(__pyx_k__flow_effects), 0, 0, 1, 1},
  {&__pyx_n_s__flush, __pyx_k__flush, sizeof(__pyx_k__flush), 0, 0, 1, 1},
  {&__pyx_n_s__format, __pyx_k__format, sizeof(__pyx_k__format), 0, 0, 1, 1},
  {&__pyx_n_s__frombytes, __pyx_k__frombytes, sizeof(__pyx_k__frombytes), 0, 0, 1, 1},
  {&__pyx_n_s__fromlist, __pyx_k__fromlist, sizeof(__pyx_k__fromlist), 0, 0, 1, 1},
  {&__pyx_n_s__ft, __pyx_k__ft, sizeof(__pyx_k__ft), 0, 0, 1, 1},
  {&__pyx_n_s__get_default_format, __pyx_k__get_default_format, sizeof(__pyx_k__get_default_format), 0, 0, 1, 1},
  {&__pyx_n_s__get_effect, __pyx_k__get_effect, sizeof(__pyx_k__get_effect), 0, 0, 1, 1},
  {&__pyx_n_s__get_encoding, __pyx_k__get_encoding, sizeof(__pyx_k__get_encoding), 0, 0, 1, 1},
  {&__pyx_n_s__get_ft, __pyx_k__get_ft, sizeof(__pyx_k__get_ft), 0, 0, 1, 1},
  {&__pyx_n_s__get_in_encoding, __pyx_k__get_in_encoding, sizeof(__pyx_k__get_in_encoding), 0, 0, 1, 1},
  {&__pyx_n_s__get_in_signal, __pyx_k__get_in_signal, sizeof(__pyx_k__get_in_signal), 0, 0, 1, 1},
  {&__pyx_n_s__get_name, __pyx_k__get_name, sizeof(__pyx_k__get_name), 0, 0, 1, 1},
  {&__pyx_n_s__get_out_encoding, __pyx_k__get_out_encoding, sizeof(__pyx_k__get_out_encoding), 0, 0, 1, 1},
  {&__pyx_n_s__get_out_signal, __pyx_k__get_out_signal, sizeof(__pyx_k__get_out_signal), 0, 0, 1, 1},
  {&__pyx_n_s__get_signal, __pyx_k__get_signal, sizeof(__pyx_k__get_signal), 0, 0, 1, 1},
  {&__pyx_n_s__handler, __pyx_k__handler, sizeof(__pyx_k__handler), 0, 0, 1, 1},
  {&__pyx_n_s__haveInputEffect, __pyx_k__haveInputEffect, sizeof(__pyx_k__haveInputEffect), 0, 0, 1, 1},
  {&__pyx_n_s__haveOutputEffect, __pyx_k__haveOutputEffect, sizeof(__pyx_k__haveOutputEffect), 0, 0, 1, 1},
  {&__pyx_n_s__i, __pyx_k__i, sizeof(__pyx_k__i), 0, 0, 1, 1},
  {&__pyx_n_s__in_encoding, __pyx_k__in_encoding, sizeof(__pyx_k__in_encoding), 0, 0, 1, 1},
  {&__pyx_n_s__in_signal, __pyx_k__in_signal, sizeof(__pyx_k__in_signal), 0, 0, 1, 1},
  {&__pyx_n_s__inencoding, __pyx_k__inencoding, sizeof(__pyx_k__inencoding), 0, 0, 1, 1},
  {&__pyx_n_s__initialdata, __pyx_k__initialdata, sizeof(__pyx_k__initialdata), 0, 0, 1, 1},
  {&__pyx_n_s__input, __pyx_k__input, sizeof(__pyx_k__input), 0, 0, 1, 1},
  {&__pyx_n_s__insert, __pyx_k__insert, sizeof(__pyx_k__insert), 0, 0, 1, 1},
  {&__pyx_n_s__insignal, __pyx_k__insignal, sizeof(__pyx_k__insignal), 0, 0, 1, 1},
  {&__pyx_n_s__instream, __pyx_k__instream, sizeof(__pyx_k__instream), 0, 0, 1, 1},
  {&__pyx_n_s__internal, __pyx_k__internal, sizeof(__pyx_k__internal), 0, 0, 1, 1},
  {&__pyx_n_s__istream, __pyx_k__istream, sizeof(__pyx_k__istream), 0, 0, 1, 1},
  {&__pyx_n_s__itemsize, __pyx_k__itemsize, sizeof(__pyx_k__itemsize), 0, 0, 1, 1},
  {&__pyx_n_s__len, __pyx_k__len, sizeof(__pyx_k__len), 0, 0, 1, 1},
  {&__pyx_n_s__length, __pyx_k__length, sizeof(__pyx_k__length), 0, 0, 1, 1},
  {&__pyx_n_s__list_to_sizebuf, __pyx_k__list_to_sizebuf, sizeof(__pyx_k__list_to_sizebuf), 0, 0, 1, 1},
  {&__pyx_n_s__mode, __pyx_k__mode, sizeof(__pyx_k__mode), 0, 0, 1, 1},
  {&__pyx_n_s__must_dealloc_buffer, __pyx_k__must_dealloc_buffer, sizeof(__pyx_k__must_dealloc_buffer), 0, 0, 1, 1},
  {&__pyx_n_s__name, __pyx_k__name, sizeof(__pyx_k__name), 0, 0, 1, 1},
  {&__pyx_n_s__ndim, __pyx_k__ndim, sizeof(__pyx_k__ndim), 0, 0, 1, 1},
  {&__pyx_n_u__null, __pyx_k__null, sizeof(__pyx_k__null), 0, 1, 0, 1},
  {&__pyx_n_s__obj, __pyx_k__obj, sizeof(__pyx_k__obj), 0, 0, 1, 1},
  {&__pyx_n_s__offset, __pyx_k__offset, sizeof(__pyx_k__offset), 0, 0, 1, 1},
  {&__pyx_n_s__open_read, __pyx_k__open_read, sizeof(__pyx_k__open_read), 0, 0, 1, 1},
  {&__pyx_n_s__open_write, __pyx_k__open_write, sizeof(__pyx_k__open_write), 0, 0, 1, 1},
  {&__pyx_n_s__optimize_trim, __pyx_k__optimize_trim, sizeof(__pyx_k__optimize_trim), 0, 0, 1, 1},
  {&__pyx_n_s__ostream, __pyx_k__ostream, sizeof(__pyx_k__ostream), 0, 0, 1, 1},
  {&__pyx_n_s__out_encoding, __pyx_k__out_encoding, sizeof(__pyx_k__out_encoding), 0, 0, 1, 1},
  {&__pyx_n_s__out_signal, __pyx_k__out_signal, sizeof(__pyx_k__out_signal), 0, 0, 1, 1},
  {&__pyx_n_s__outencoding, __pyx_k__outencoding, sizeof(__pyx_k__outencoding), 0, 0, 1, 1},
  {&__pyx_n_s__output, __pyx_k__output, sizeof(__pyx_k__output), 0, 0, 1, 1},
  {&__pyx_n_s__outsignal, __pyx_k__outsignal, sizeof(__pyx_k__outsignal), 0, 0, 1, 1},
  {&__pyx_n_s__outstream, __pyx_k__outstream, sizeof(__pyx_k__outstream), 0, 0, 1, 1},
  {&__pyx_n_s__path, __pyx_k__path, sizeof(__pyx_k__path), 0, 0, 1, 1},
  {&__pyx_n_s__precision, __pyx_k__precision, sizeof(__pyx_k__precision), 0, 0, 1, 1},
  {&__pyx_n_s__print_exc, __pyx_k__print_exc, sizeof(__pyx_k__print_exc), 0, 0, 1, 1},
  {&__pyx_n_s__r, __pyx_k__r, sizeof(__pyx_k__r), 0, 0, 1, 1},
  {&__pyx_n_u__r, __pyx_k__r, sizeof(__pyx_k__r), 0, 1, 0, 1},
  {&__pyx_n_s__range, __pyx_k__range, sizeof(__pyx_k__range), 0, 0, 1, 1},
  {&__pyx_n_s__rate, __pyx_k__rate, sizeof(__pyx_k__rate), 0, 0, 1, 1},
  {&__pyx_n_s__read_only, __pyx_k__read_only, sizeof(__pyx_k__read_only), 0, 0, 1, 1},
  {&__pyx_n_s__readonly, __pyx_k__readonly, sizeof(__pyx_k__readonly), 0, 0, 1, 1},
  {&__pyx_n_s__receive_header, __pyx_k__receive_header, sizeof(__pyx_k__receive_header), 0, 0, 1, 1},
  {&__pyx_n_s__recieved_flags, __pyx_k__recieved_flags, sizeof(__pyx_k__recieved_flags), 0, 0, 1, 1},
  {&__pyx_n_s__recv_bytes, __pyx_k__recv_bytes, sizeof(__pyx_k__recv_bytes), 0, 0, 1, 1},
  {&__pyx_n_s__release_ok, __pyx_k__release_ok, sizeof(__pyx_k__release_ok), 0, 0, 1, 1},
  {&__pyx_n_s__s_encoding, __pyx_k__s_encoding, sizeof(__pyx_k__s_encoding), 0, 0, 1, 1},
  {&__pyx_n_s__s_signal, __pyx_k__s_signal, sizeof(__pyx_k__s_signal), 0, 0, 1, 1},
  {&__pyx_n_s__seek, __pyx_k__seek, sizeof(__pyx_k__seek), 0, 0, 1, 1},
  {&__pyx_n_s__seekable, __pyx_k__seekable, sizeof(__pyx_k__seekable), 0, 0, 1, 1},
  {&__pyx_n_s__set_buffer, __pyx_k__set_buffer, sizeof(__pyx_k__set_buffer), 0, 0, 1, 1},
  {&__pyx_n_s__shape, __pyx_k__shape, sizeof(__pyx_k__shape), 0, 0, 1, 1},
  {&__pyx_n_s__signal, __pyx_k__signal, sizeof(__pyx_k__signal), 0, 0, 1, 1},
  {&__pyx_n_s__signalInfo, __pyx_k__signalInfo, sizeof(__pyx_k__signalInfo), 0, 0, 1, 1},
  {&__pyx_n_s__sox_read, __pyx_k__sox_read, sizeof(__pyx_k__sox_read), 0, 0, 1, 1},
  {&__pyx_n_s__sox_read_wide, __pyx_k__sox_read_wide, sizeof(__pyx_k__sox_read_wide), 0, 0, 1, 1},
  {&__pyx_n_s__stdout, __pyx_k__stdout, sizeof(__pyx_k__stdout), 0, 0, 1, 1},
  {&__pyx_n_s__strides, __pyx_k__strides, sizeof(__pyx_k__strides), 0, 0, 1, 1},
  {&__pyx_n_s__suboffsets, __pyx_k__suboffsets, sizeof(__pyx_k__suboffsets), 0, 0, 1, 1},
  {&__pyx_n_s__sys, __pyx_k__sys, sizeof(__pyx_k__sys), 0, 0, 1, 1},
  {&__pyx_n_s__traceback, __pyx_k__traceback, sizeof(__pyx_k__traceback), 0, 0, 1, 1},
  {&__pyx_n_b__trim, __pyx_k__trim, sizeof(__pyx_k__trim), 0, 0, 0, 1},
  {&__pyx_n_s__types, __pyx_k__types, sizeof(__pyx_k__types), 0, 0, 1, 1},
  {&__pyx_n_s__u, __pyx_k__u, sizeof(__pyx_k__u), 0, 0, 1, 1},
  {&__pyx_n_s__unicode_escape, __pyx_k__unicode_escape, sizeof(__pyx_k__unicode_escape), 0, 0, 1, 1},
  {&__pyx_n_s__viewcount, __pyx_k__viewcount, sizeof(__pyx_k__viewcount), 0, 0, 1, 1},
  {&__pyx_n_s__w, __pyx_k__w, sizeof(__pyx_k__w), 0, 0, 1, 1},
  {&__pyx_n_s__write, __pyx_k__write, sizeof(__pyx_k__write), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_Exception = __Pyx_GetName(__pyx_b, __pyx_n_s__Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_IOError = __Pyx_GetName(__pyx_b, __pyx_n_s__IOError); if (!__pyx_builtin_IOError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_TypeError = __Pyx_GetName(__pyx_b, __pyx_n_s__TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_n_s__RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_EOFError = __Pyx_GetName(__pyx_b, __pyx_n_s__EOFError); if (!__pyx_builtin_EOFError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_bytearray = __Pyx_GetName(__pyx_b, __pyx_n_s__bytearray); if (!__pyx_builtin_bytearray) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_enumerate = __Pyx_GetName(__pyx_b, __pyx_n_s__enumerate); if (!__pyx_builtin_enumerate) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_IndexError = __Pyx_GetName(__pyx_b, __pyx_n_s__IndexError); if (!__pyx_builtin_IndexError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_BufferError = __Pyx_GetName(__pyx_b, __pyx_n_s__BufferError); if (!__pyx_builtin_BufferError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_range = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_StopIteration = __Pyx_GetName(__pyx_b, __pyx_n_s__StopIteration); if (!__pyx_builtin_StopIteration) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_ImportError = __Pyx_GetName(__pyx_b, __pyx_n_s__ImportError); if (!__pyx_builtin_ImportError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  return 0;
  __pyx_L1_error:;
  return -1;
}

static int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants");

  /* "pysox/sox.pyx":30
 * if PY3:
 *     def b(s):
 *         return s.encode("utf-8")             # <<<<<<<<<<<<<<
 *     def u(s):
 *         return s
 */
  __pyx_k_tuple_2 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_2));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_1));
  PyTuple_SET_ITEM(__pyx_k_tuple_2, 0, ((PyObject *)__pyx_kp_s_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_2));

  /* "pysox/sox.pyx":371
 *         self.ft = csox.sox_open_read(cpath, signal , encoding,  cfiletype)
 *         if not self.ft:
 *             raise IOError("No such file")             # <<<<<<<<<<<<<<
 *         return 1
 * 
 */
  __pyx_k_tuple_9 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_9));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_8));
  PyTuple_SET_ITEM(__pyx_k_tuple_9, 0, ((PyObject *)__pyx_kp_s_8));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_8));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_9));

  /* "pysox/sox.pyx":402
 * 
 *         if not signalInfo:
 *             raise TypeError("signalInfo must be a CSignalInfo instance")             # <<<<<<<<<<<<<<
 * 
 *         cpath = toCharP(path)
 */
  __pyx_k_tuple_11 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_11));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_10));
  PyTuple_SET_ITEM(__pyx_k_tuple_11, 0, ((PyObject *)__pyx_kp_s_10));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_10));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_11));

  /* "pysox/sox.pyx":415
 *         self.ft = csox.sox_open_write(cpath, signal, encoding, cfiletype, NULL, NULL)
 *         if not self.ft:
 *             raise IOError("No such file")             # <<<<<<<<<<<<<<
 * 
 *     def close(self):
 */
  __pyx_k_tuple_12 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_12));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_8));
  PyTuple_SET_ITEM(__pyx_k_tuple_12, 0, ((PyObject *)__pyx_kp_s_8));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_8));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_12));

  /* "pysox/sox.pyx":475
 * 
 *     cdef int sox_read(self, csox.sox_sample_t * obuf, size_t max):
 *         raise RuntimeError('CPysoxPipeStream::sox_read not implemented')             # <<<<<<<<<<<<<<
 *         return 0
 * 
 */
  __pyx_k_tuple_16 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_16));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_15));
  PyTuple_SET_ITEM(__pyx_k_tuple_16, 0, ((PyObject *)__pyx_kp_s_15));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_15));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_16));

  /* "pysox/sox.pyx":566
 *         fileType = u'null'
 *         if not signalInfo:
 *             signalInfo = CSignalInfo(48000,2,32, 0)             # <<<<<<<<<<<<<<
 *         if not encodingInfo:
 *             encodingInfo = CEncodingInfo(1,32)
 */
  __pyx_k_tuple_22 = PyTuple_New(4); if (unlikely(!__pyx_k_tuple_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_22));
  __Pyx_INCREF(__pyx_int_48000);
  PyTuple_SET_ITEM(__pyx_k_tuple_22, 0, __pyx_int_48000);
  __Pyx_GIVEREF(__pyx_int_48000);
  __Pyx_INCREF(__pyx_int_2);
  PyTuple_SET_ITEM(__pyx_k_tuple_22, 1, __pyx_int_2);
  __Pyx_GIVEREF(__pyx_int_2);
  __Pyx_INCREF(__pyx_int_32);
  PyTuple_SET_ITEM(__pyx_k_tuple_22, 2, __pyx_int_32);
  __Pyx_GIVEREF(__pyx_int_32);
  __Pyx_INCREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_k_tuple_22, 3, __pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_22));

  /* "pysox/sox.pyx":568
 *             signalInfo = CSignalInfo(48000,2,32, 0)
 *         if not encodingInfo:
 *             encodingInfo = CEncodingInfo(1,32)             # <<<<<<<<<<<<<<
 *         CSoxStream.__init__(self, path, mode, signalInfo, encodingInfo, fileType)
 * 
 */
  __pyx_k_tuple_23 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_23));
  __Pyx_INCREF(__pyx_int_1);
  PyTuple_SET_ITEM(__pyx_k_tuple_23, 0, __pyx_int_1);
  __Pyx_GIVEREF(__pyx_int_1);
  __Pyx_INCREF(__pyx_int_32);
  PyTuple_SET_ITEM(__pyx_k_tuple_23, 1, __pyx_int_32);
  __Pyx_GIVEREF(__pyx_int_32);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_23));

  /* "pysox/sox.pyx":885
 *         if not self.haveInputEffect:
 *             if not self.instream:
 *                 raise PysoxError("neither instream nor an inputeffect are configured")             # <<<<<<<<<<<<<<
 *             inputeffect = CEffect("input", [self.instream])
 *             self.effects.insert(0, inputeffect)
 */
  __pyx_k_tuple_27 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_27));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_26));
  PyTuple_SET_ITEM(__pyx_k_tuple_27, 0, ((PyObject *)__pyx_kp_s_26));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_26));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_27));

  /* "pysox/sox.pyx":891
 *         if not self.haveOutputEffect:
 *             if not self.outstream:
 *                 raise PysoxError("neither outstream nor an outputeffect are configured")             # <<<<<<<<<<<<<<
 *             outputeffect = CEffect("output", [self.outstream])
 *             self.effects.append(outputeffect)
 */
  __pyx_k_tuple_29 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_29));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_28));
  PyTuple_SET_ITEM(__pyx_k_tuple_29, 0, ((PyObject *)__pyx_kp_s_28));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_28));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_29));

  /* "pysox/sox.pyx":910
 * 
 *         if not self.instream and not self.insignal:
 *             raise PysoxError("neither instream nor insignal are configured")             # <<<<<<<<<<<<<<
 *         insignal = self.insignal.cget_signal() #get struct
 *         if not self.outstream and not self.outsignal:
 */
  __pyx_k_tuple_32 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_32));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_31));
  PyTuple_SET_ITEM(__pyx_k_tuple_32, 0, ((PyObject *)__pyx_kp_s_31));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_31));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_32));

  /* "pysox/sox.pyx":913
 *         insignal = self.insignal.cget_signal() #get struct
 *         if not self.outstream and not self.outsignal:
 *             raise PysoxError("neither outstream nor outsignal are configured")             # <<<<<<<<<<<<<<
 *         outsignal = self.outsignal.cget_signal() #get struct
 * 
 */
  __pyx_k_tuple_34 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_34));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_33));
  PyTuple_SET_ITEM(__pyx_k_tuple_34, 0, ((PyObject *)__pyx_kp_s_33));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_33));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_34));

  /* "pysox/sox.pyx":933
 *         self.__init_effects()
 *         if not self.chain:
 *             raise PysoxError('chain not valid')             # <<<<<<<<<<<<<<
 *         if optimize_trim:
 *             self.__optimize_trim()
 */
  __pyx_k_tuple_37 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_37));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_36));
  PyTuple_SET_ITEM(__pyx_k_tuple_37, 0, ((PyObject *)__pyx_kp_s_36));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_36));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_37));

  /* "pysox/sox.pyx":1077
 *             self.fromlist(data)
 *         else:
 *             raise TypeError("need bytes, bytearray, memoryview or list of integers")             # <<<<<<<<<<<<<<
 *         return 0
 * 
 */
  __pyx_k_tuple_40 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_40));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_39));
  PyTuple_SET_ITEM(__pyx_k_tuple_40, 0, ((PyObject *)__pyx_kp_s_39));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_39));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_40));

  /* "pysox/sox.pyx":1156
 *     def set_datalen(self, nbytes):
 *         if nbytes > self.len:
 *             raise IndexError('got more than i can chew')             # <<<<<<<<<<<<<<
 *         self.datalen = nbytes
 * 
 */
  __pyx_k_tuple_44 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_44));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_43));
  PyTuple_SET_ITEM(__pyx_k_tuple_44, 0, ((PyObject *)__pyx_kp_s_43));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_43));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_44));

  /* "pysox/sox.pyx":1165
 *     #
 *     def __getitem__(self, i):
 *         if type(i) == type(slice(1,2)):             # <<<<<<<<<<<<<<
 *             raise IndexError("Slices are not supported")
 *         cdef int index = i
 */
  __pyx_k_tuple_45 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_45)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_45));
  __Pyx_INCREF(__pyx_int_1);
  PyTuple_SET_ITEM(__pyx_k_tuple_45, 0, __pyx_int_1);
  __Pyx_GIVEREF(__pyx_int_1);
  __Pyx_INCREF(__pyx_int_2);
  PyTuple_SET_ITEM(__pyx_k_tuple_45, 1, __pyx_int_2);
  __Pyx_GIVEREF(__pyx_int_2);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_45));

  /* "pysox/sox.pyx":1166
 *     def __getitem__(self, i):
 *         if type(i) == type(slice(1,2)):
 *             raise IndexError("Slices are not supported")             # <<<<<<<<<<<<<<
 *         cdef int index = i
 *         if index*self.itemsize >= self.datalen:
 */
  __pyx_k_tuple_47 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_47));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_46));
  PyTuple_SET_ITEM(__pyx_k_tuple_47, 0, ((PyObject *)__pyx_kp_s_46));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_46));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_47));

  /* "pysox/sox.pyx":1205
 *         """
 *         if self.viewcount > 0:
 *             raise BufferError('Cannot reallocate while being referenced')             # <<<<<<<<<<<<<<
 *         cdef char* buf = <char*>stdlib.malloc(len(data) * self.itemsize)
 * 
 */
  __pyx_k_tuple_49 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_49)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_49));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_48));
  PyTuple_SET_ITEM(__pyx_k_tuple_49, 0, ((PyObject *)__pyx_kp_s_48));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_48));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_49));

  /* "pysox/sox.pyx":1225
 *         """
 *         if type(data) != type([]):
 *             raise TypeError("only accepting list type")             # <<<<<<<<<<<<<<
 *         cdef char* it = <char *>self.buffer
 *         cdef int lsamp
 */
  __pyx_k_tuple_51 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_51)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_51));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_50));
  PyTuple_SET_ITEM(__pyx_k_tuple_51, 0, ((PyObject *)__pyx_kp_s_50));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_50));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_51));

  /* "pysox/sox.pyx":1230
 *         lsamp = len(data)
 *         if lsamp * self.itemsize > self.len:
 *             raise IndexError("Too much data, check get_buffer_size()")             # <<<<<<<<<<<<<<
 *         for value in data:
 *             self.write(<csox.sox_sample_t *>it, value)
 */
  __pyx_k_tuple_53 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_53)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_53));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_52));
  PyTuple_SET_ITEM(__pyx_k_tuple_53, 0, ((PyObject *)__pyx_kp_s_52));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_52));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_53));

  /* "pysox/sox.pyx":1255
 *         cdef char * buffer
 *         if self.viewcount > 0:
 *             raise BufferError('Cannot reallocate while being referenced')             # <<<<<<<<<<<<<<
 *         lsamp = len(ba) / self.itemsize
 *         buffer = <char *>stdlib.malloc(len(ba))
 */
  __pyx_k_tuple_54 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_54)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_54));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_48));
  PyTuple_SET_ITEM(__pyx_k_tuple_54, 0, ((PyObject *)__pyx_kp_s_48));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_48));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_54));

  /* "pysox/sox.pyx":1274
 *         """
 *         if len(ba) > self.len:
 *             raise IndexError("Too much data, check get_buffer_size()")             # <<<<<<<<<<<<<<
 *         cdef int c, lsamp
 *         cdef char * buffer = <char *>self.buffer
 */
  __pyx_k_tuple_55 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_55)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_55));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_52));
  PyTuple_SET_ITEM(__pyx_k_tuple_55, 0, ((PyObject *)__pyx_kp_s_52));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_52));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_55));

  /* "pysox/sox.pyx":1327
 *         result = csox.sox_init()
 *         if result != SOX_SUCCESS:
 *             raise ImportError("sox_init not successful")             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __pyx_k_tuple_57 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_57)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_57));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_56));
  PyTuple_SET_ITEM(__pyx_k_tuple_57, 0, ((PyObject *)__pyx_kp_s_56));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_56));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_57));
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_InitGlobals(void) {
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_6 = PyInt_FromLong(6); if (unlikely(!__pyx_int_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_7 = PyInt_FromLong(7); if (unlikely(!__pyx_int_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_9 = PyInt_FromLong(9); if (unlikely(!__pyx_int_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_11 = PyInt_FromLong(11); if (unlikely(!__pyx_int_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_12 = PyInt_FromLong(12); if (unlikely(!__pyx_int_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_13 = PyInt_FromLong(13); if (unlikely(!__pyx_int_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_14 = PyInt_FromLong(14); if (unlikely(!__pyx_int_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_16 = PyInt_FromLong(16); if (unlikely(!__pyx_int_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_17 = PyInt_FromLong(17); if (unlikely(!__pyx_int_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_18 = PyInt_FromLong(18); if (unlikely(!__pyx_int_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_19 = PyInt_FromLong(19); if (unlikely(!__pyx_int_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_20 = PyInt_FromLong(20); if (unlikely(!__pyx_int_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_21 = PyInt_FromLong(21); if (unlikely(!__pyx_int_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_22 = PyInt_FromLong(22); if (unlikely(!__pyx_int_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_23 = PyInt_FromLong(23); if (unlikely(!__pyx_int_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_24 = PyInt_FromLong(24); if (unlikely(!__pyx_int_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_25 = PyInt_FromLong(25); if (unlikely(!__pyx_int_25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_26 = PyInt_FromLong(26); if (unlikely(!__pyx_int_26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_27 = PyInt_FromLong(27); if (unlikely(!__pyx_int_27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_32 = PyInt_FromLong(32); if (unlikely(!__pyx_int_32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_64 = PyInt_FromLong(64); if (unlikely(!__pyx_int_64)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_128 = PyInt_FromLong(128); if (unlikely(!__pyx_int_128)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_256 = PyInt_FromLong(256); if (unlikely(!__pyx_int_256)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_512 = PyInt_FromLong(512); if (unlikely(!__pyx_int_512)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_1024 = PyInt_FromLong(1024); if (unlikely(!__pyx_int_1024)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_48000 = PyInt_FromLong(48000); if (unlikely(!__pyx_int_48000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  return 0;
  __pyx_L1_error:;
  return -1;
}

#if PY_MAJOR_VERSION < 3
PyMODINIT_FUNC initsox(void); /*proto*/
PyMODINIT_FUNC initsox(void)
#else
PyMODINIT_FUNC PyInit_sox(void); /*proto*/
PyMODINIT_FUNC PyInit_sox(void)
#endif
{
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  #if CYTHON_REFNANNY
  void* __pyx_refnanny = NULL;
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
  if (!__Pyx_RefNanny) {
      PyErr_Clear();
      __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
      if (!__Pyx_RefNanny)
          Py_FatalError("failed to import 'refnanny' module");
  }
  __pyx_refnanny = __Pyx_RefNanny->SetupContext("PyMODINIT_FUNC PyInit_sox(void)", __LINE__, __FILE__);
  #endif
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #ifdef __pyx_binding_PyCFunctionType_USED
  if (__pyx_binding_PyCFunctionType_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  #ifdef WITH_THREAD /* Python build with threading support? */
  PyEval_InitThreads();
  #endif
  #endif
  /*--- Module creation code ---*/
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4(__Pyx_NAMESTR("sox"), __pyx_methods, 0, 0, PYTHON_API_VERSION);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  #if PY_MAJOR_VERSION < 3
  Py_INCREF(__pyx_m);
  #endif
  __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME));
  if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  /*--- Initialize various global constants etc. ---*/
  if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_module_is_main_pysox__sox) {
    if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  }
  /*--- Builtin init code ---*/
  if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Constants init code ---*/
  if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Global init code ---*/
  /*--- Function export code ---*/
  if (__Pyx_ExportFunction("toCharP", (void (*)(void))__pyx_f_5pysox_3sox_toCharP, "char *(PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Type init code ---*/
  __pyx_vtabptr_5pysox_3sox_CEffect = &__pyx_vtable_5pysox_3sox_CEffect;
  __pyx_vtable_5pysox_3sox_CEffect.get_name = (PyObject *(*)(struct __pyx_obj_5pysox_3sox_CEffect *, int __pyx_skip_dispatch))__pyx_f_5pysox_3sox_7CEffect_get_name;
  __pyx_vtable_5pysox_3sox_CEffect.get_effect = (sox_effect_t *(*)(struct __pyx_obj_5pysox_3sox_CEffect *))__pyx_f_5pysox_3sox_7CEffect_get_effect;
  __pyx_vtable_5pysox_3sox_CEffect.create = (PyObject *(*)(struct __pyx_obj_5pysox_3sox_CEffect *, PyObject *, PyObject *))__pyx_f_5pysox_3sox_7CEffect_create;
  if (PyType_Ready(&__pyx_type_5pysox_3sox_CEffect) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_5pysox_3sox_CEffect, "__init__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_5pysox_3sox_7CEffect___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_5pysox_3sox_7CEffect___init__.doc = __pyx_doc_5pysox_3sox_7CEffect___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5pysox_3sox_7CEffect___init__;
    }
  }
  if (__Pyx_SetVtable(__pyx_type_5pysox_3sox_CEffect.tp_dict, __pyx_vtabptr_5pysox_3sox_CEffect) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "CEffect", (PyObject *)&__pyx_type_5pysox_3sox_CEffect) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5pysox_3sox_CEffect = &__pyx_type_5pysox_3sox_CEffect;
  __pyx_vtabptr_5pysox_3sox_CSignalInfo = &__pyx_vtable_5pysox_3sox_CSignalInfo;
  __pyx_vtable_5pysox_3sox_CSignalInfo.cset_signal = (PyObject *(*)(struct __pyx_obj_5pysox_3sox_CSignalInfo *, sox_signalinfo_t *))__pyx_f_5pysox_3sox_11CSignalInfo_cset_signal;
  __pyx_vtable_5pysox_3sox_CSignalInfo.cget_signal = (sox_signalinfo_t *(*)(struct __pyx_obj_5pysox_3sox_CSignalInfo *))__pyx_f_5pysox_3sox_11CSignalInfo_cget_signal;
  if (PyType_Ready(&__pyx_type_5pysox_3sox_CSignalInfo) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_5pysox_3sox_CSignalInfo, "__init__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_5pysox_3sox_11CSignalInfo___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_5pysox_3sox_11CSignalInfo___init__.doc = __pyx_doc_5pysox_3sox_11CSignalInfo___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5pysox_3sox_11CSignalInfo___init__;
    }
  }
  if (__Pyx_SetVtable(__pyx_type_5pysox_3sox_CSignalInfo.tp_dict, __pyx_vtabptr_5pysox_3sox_CSignalInfo) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "CSignalInfo", (PyObject *)&__pyx_type_5pysox_3sox_CSignalInfo) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5pysox_3sox_CSignalInfo = &__pyx_type_5pysox_3sox_CSignalInfo;
  __pyx_vtabptr_5pysox_3sox_CEncodingInfo = &__pyx_vtable_5pysox_3sox_CEncodingInfo;
  __pyx_vtable_5pysox_3sox_CEncodingInfo.cset_encoding = (PyObject *(*)(struct __pyx_obj_5pysox_3sox_CEncodingInfo *, sox_encodinginfo_t *))__pyx_f_5pysox_3sox_13CEncodingInfo_cset_encoding;
  __pyx_vtable_5pysox_3sox_CEncodingInfo.cget_encoding = (sox_encodinginfo_t *(*)(struct __pyx_obj_5pysox_3sox_CEncodingInfo *))__pyx_f_5pysox_3sox_13CEncodingInfo_cget_encoding;
  if (PyType_Ready(&__pyx_type_5pysox_3sox_CEncodingInfo) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_5pysox_3sox_CEncodingInfo, "__init__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_5pysox_3sox_13CEncodingInfo___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_5pysox_3sox_13CEncodingInfo___init__.doc = __pyx_doc_5pysox_3sox_13CEncodingInfo___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5pysox_3sox_13CEncodingInfo___init__;
    }
  }
  if (__Pyx_SetVtable(__pyx_type_5pysox_3sox_CEncodingInfo.tp_dict, __pyx_vtabptr_5pysox_3sox_CEncodingInfo) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "CEncodingInfo", (PyObject *)&__pyx_type_5pysox_3sox_CEncodingInfo) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5pysox_3sox_CEncodingInfo = &__pyx_type_5pysox_3sox_CEncodingInfo;
  __pyx_vtabptr_5pysox_3sox_CSoxStream = &__pyx_vtable_5pysox_3sox_CSoxStream;
  __pyx_vtable_5pysox_3sox_CSoxStream.get_ft = (sox_format_t *(*)(struct __pyx_obj_5pysox_3sox_CSoxStream *))__pyx_f_5pysox_3sox_10CSoxStream_get_ft;
  __pyx_vtable_5pysox_3sox_CSoxStream.asCharP = (char *(*)(struct __pyx_obj_5pysox_3sox_CSoxStream *))__pyx_f_5pysox_3sox_10CSoxStream_asCharP;
  __pyx_vtable_5pysox_3sox_CSoxStream.sox_read = (int (*)(struct __pyx_obj_5pysox_3sox_CSoxStream *, __pyx_t_5pysox_4csox_sox_sample_t *, size_t))__pyx_f_5pysox_3sox_10CSoxStream_sox_read;
  __pyx_vtable_5pysox_3sox_CSoxStream.sox_read_wide = (int (*)(struct __pyx_obj_5pysox_3sox_CSoxStream *, __pyx_t_5pysox_4csox_sox_sample_t *, size_t))__pyx_f_5pysox_3sox_10CSoxStream_sox_read_wide;
  __pyx_vtable_5pysox_3sox_CSoxStream.open_read = (int (*)(struct __pyx_obj_5pysox_3sox_CSoxStream *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_5pysox_3sox_10CSoxStream_open_read *__pyx_optional_args))__pyx_f_5pysox_3sox_10CSoxStream_open_read;
  __pyx_vtable_5pysox_3sox_CSoxStream.open_write = (PyObject *(*)(struct __pyx_obj_5pysox_3sox_CSoxStream *, PyObject *, struct __pyx_obj_5pysox_3sox_CSignalInfo *, int __pyx_skip_dispatch, struct __pyx_opt_args_5pysox_3sox_10CSoxStream_open_write *__pyx_optional_args))__pyx_f_5pysox_3sox_10CSoxStream_open_write;
  __pyx_vtable_5pysox_3sox_CSoxStream.cget_signal = (sox_signalinfo_t *(*)(struct __pyx_obj_5pysox_3sox_CSoxStream *))__pyx_f_5pysox_3sox_10CSoxStream_cget_signal;
  __pyx_vtable_5pysox_3sox_CSoxStream.cget_encoding = (sox_encodinginfo_t *(*)(struct __pyx_obj_5pysox_3sox_CSoxStream *))__pyx_f_5pysox_3sox_10CSoxStream_cget_encoding;
  if (PyType_Ready(&__pyx_type_5pysox_3sox_CSoxStream) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_5pysox_3sox_CSoxStream, "__init__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_5pysox_3sox_10CSoxStream___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_5pysox_3sox_10CSoxStream___init__.doc = __pyx_doc_5pysox_3sox_10CSoxStream___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5pysox_3sox_10CSoxStream___init__;
    }
  }
  if (__Pyx_SetVtable(__pyx_type_5pysox_3sox_CSoxStream.tp_dict, __pyx_vtabptr_5pysox_3sox_CSoxStream) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "CSoxStream", (PyObject *)&__pyx_type_5pysox_3sox_CSoxStream) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5pysox_3sox_CSoxStream = &__pyx_type_5pysox_3sox_CSoxStream;
  __pyx_vtabptr_5pysox_3sox_CPysoxPipeStream = &__pyx_vtable_5pysox_3sox_CPysoxPipeStream;
  __pyx_vtable_5pysox_3sox_CPysoxPipeStream.__pyx_base = *__pyx_vtabptr_5pysox_3sox_CSoxStream;
  __pyx_vtable_5pysox_3sox_CPysoxPipeStream.__pyx_base.sox_read = (int (*)(struct __pyx_obj_5pysox_3sox_CSoxStream *, __pyx_t_5pysox_4csox_sox_sample_t *, size_t))__pyx_f_5pysox_3sox_16CPysoxPipeStream_sox_read;
  __pyx_vtable_5pysox_3sox_CPysoxPipeStream.__pyx_base.sox_read_wide = (int (*)(struct __pyx_obj_5pysox_3sox_CSoxStream *, __pyx_t_5pysox_4csox_sox_sample_t *, size_t))__pyx_f_5pysox_3sox_16CPysoxPipeStream_sox_read_wide;
  __pyx_vtable_5pysox_3sox_CPysoxPipeStream.__pyx_base.open_read = (int (*)(struct __pyx_obj_5pysox_3sox_CSoxStream *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_5pysox_3sox_10CSoxStream_open_read *__pyx_optional_args))__pyx_f_5pysox_3sox_16CPysoxPipeStream_open_read;
  __pyx_vtable_5pysox_3sox_CPysoxPipeStream.__pyx_base.open_write = (PyObject *(*)(struct __pyx_obj_5pysox_3sox_CSoxStream *, PyObject *, struct __pyx_obj_5pysox_3sox_CSignalInfo *, int __pyx_skip_dispatch, struct __pyx_opt_args_5pysox_3sox_10CSoxStream_open_write *__pyx_optional_args))__pyx_f_5pysox_3sox_16CPysoxPipeStream_open_write;
  __pyx_vtable_5pysox_3sox_CPysoxPipeStream.receive_header = (int (*)(struct __pyx_obj_5pysox_3sox_CPysoxPipeStream *))__pyx_f_5pysox_3sox_16CPysoxPipeStream_receive_header;
  __pyx_type_5pysox_3sox_CPysoxPipeStream.tp_base = __pyx_ptype_5pysox_3sox_CSoxStream;
  if (PyType_Ready(&__pyx_type_5pysox_3sox_CPysoxPipeStream) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_5pysox_3sox_CPysoxPipeStream.tp_dict, __pyx_vtabptr_5pysox_3sox_CPysoxPipeStream) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "CPysoxPipeStream", (PyObject *)&__pyx_type_5pysox_3sox_CPysoxPipeStream) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5pysox_3sox_CPysoxPipeStream = &__pyx_type_5pysox_3sox_CPysoxPipeStream;
  __pyx_vtabptr_5pysox_3sox_SoxSampleBuffer = &__pyx_vtable_5pysox_3sox_SoxSampleBuffer;
  __pyx_vtable_5pysox_3sox_SoxSampleBuffer.set_buffer = (void (*)(struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *, __pyx_t_5pysox_4csox_sox_sample_t *, size_t))__pyx_f_5pysox_3sox_15SoxSampleBuffer_set_buffer;
  __pyx_vtable_5pysox_3sox_SoxSampleBuffer.__create_buffer = (int (*)(struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *, PyObject *))__pyx_f_5pysox_3sox_15SoxSampleBuffer___create_buffer;
  __pyx_vtable_5pysox_3sox_SoxSampleBuffer.__do_dealloc_if = (void (*)(struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *))__pyx_f_5pysox_3sox_15SoxSampleBuffer___do_dealloc_if;
  __pyx_vtable_5pysox_3sox_SoxSampleBuffer.write = (int (*)(struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *, __pyx_t_5pysox_4csox_sox_sample_t *, PyObject *))__pyx_f_5pysox_3sox_15SoxSampleBuffer_write;
  __pyx_vtable_5pysox_3sox_SoxSampleBuffer.get_default_format = (PyObject *(*)(struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *))__pyx_f_5pysox_3sox_15SoxSampleBuffer_get_default_format;
  __pyx_vtable_5pysox_3sox_SoxSampleBuffer.list_to_sizebuf = (Py_ssize_t *(*)(struct __pyx_obj_5pysox_3sox_SoxSampleBuffer *, PyObject *))__pyx_f_5pysox_3sox_15SoxSampleBuffer_list_to_sizebuf;
  if (PyType_Ready(&__pyx_type_5pysox_3sox_SoxSampleBuffer) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_5pysox_3sox_SoxSampleBuffer, "__init__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_5pysox_3sox_15SoxSampleBuffer___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_5pysox_3sox_15SoxSampleBuffer___init__.doc = __pyx_doc_5pysox_3sox_15SoxSampleBuffer___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5pysox_3sox_15SoxSampleBuffer___init__;
    }
  }
  if (__Pyx_SetVtable(__pyx_type_5pysox_3sox_SoxSampleBuffer.tp_dict, __pyx_vtabptr_5pysox_3sox_SoxSampleBuffer) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "SoxSampleBuffer", (PyObject *)&__pyx_type_5pysox_3sox_SoxSampleBuffer) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5pysox_3sox_SoxSampleBuffer = &__pyx_type_5pysox_3sox_SoxSampleBuffer;
  __pyx_vtabptr_5pysox_3sox_CNullFile = &__pyx_vtable_5pysox_3sox_CNullFile;
  __pyx_vtable_5pysox_3sox_CNullFile.__pyx_base = *__pyx_vtabptr_5pysox_3sox_CSoxStream;
  __pyx_type_5pysox_3sox_CNullFile.tp_base = __pyx_ptype_5pysox_3sox_CSoxStream;
  if (PyType_Ready(&__pyx_type_5pysox_3sox_CNullFile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_5pysox_3sox_CNullFile, "__init__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_5pysox_3sox_9CNullFile___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_5pysox_3sox_9CNullFile___init__.doc = __pyx_doc_5pysox_3sox_9CNullFile___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5pysox_3sox_9CNullFile___init__;
    }
  }
  if (__Pyx_SetVtable(__pyx_type_5pysox_3sox_CNullFile.tp_dict, __pyx_vtabptr_5pysox_3sox_CNullFile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "CNullFile", (PyObject *)&__pyx_type_5pysox_3sox_CNullFile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5pysox_3sox_CNullFile = &__pyx_type_5pysox_3sox_CNullFile;
  __pyx_vtabptr_5pysox_3sox_CEffectsChain = &__pyx_vtable_5pysox_3sox_CEffectsChain;
  __pyx_vtable_5pysox_3sox_CEffectsChain.__do_dealloc = (PyObject *(*)(struct __pyx_obj_5pysox_3sox_CEffectsChain *))__pyx_f_5pysox_3sox_13CEffectsChain___do_dealloc;
  __pyx_vtable_5pysox_3sox_CEffectsChain.set_chain = (PyObject *(*)(struct __pyx_obj_5pysox_3sox_CEffectsChain *, sox_effects_chain_t *))__pyx_f_5pysox_3sox_13CEffectsChain_set_chain;
  __pyx_vtable_5pysox_3sox_CEffectsChain.get_chain = (sox_effects_chain_t *(*)(struct __pyx_obj_5pysox_3sox_CEffectsChain *))__pyx_f_5pysox_3sox_13CEffectsChain_get_chain;
  __pyx_vtable_5pysox_3sox_CEffectsChain.__create_effects_chain = (PyObject *(*)(struct __pyx_obj_5pysox_3sox_CEffectsChain *, struct __pyx_obj_5pysox_3sox_CEncodingInfo *, struct __pyx_obj_5pysox_3sox_CEncodingInfo *))__pyx_f_5pysox_3sox_13CEffectsChain___create_effects_chain;
  __pyx_vtable_5pysox_3sox_CEffectsChain.__setInput = (PyObject *(*)(struct __pyx_obj_5pysox_3sox_CEffectsChain *, struct __pyx_obj_5pysox_3sox_CSoxStream *))__pyx_f_5pysox_3sox_13CEffectsChain___setInput;
  __pyx_vtable_5pysox_3sox_CEffectsChain.__setOutput = (PyObject *(*)(struct __pyx_obj_5pysox_3sox_CEffectsChain *, struct __pyx_obj_5pysox_3sox_CSoxStream *))__pyx_f_5pysox_3sox_13CEffectsChain___setOutput;
  __pyx_vtable_5pysox_3sox_CEffectsChain.__calculate_signals = (PyObject *(*)(struct __pyx_obj_5pysox_3sox_CEffectsChain *))__pyx_f_5pysox_3sox_13CEffectsChain___calculate_signals;
  __pyx_vtable_5pysox_3sox_CEffectsChain.fixup_out_signal_length = (void (*)(struct __pyx_obj_5pysox_3sox_CEffectsChain *))__pyx_f_5pysox_3sox_13CEffectsChain_fixup_out_signal_length;
  __pyx_vtable_5pysox_3sox_CEffectsChain.__init_effects = (int (*)(struct __pyx_obj_5pysox_3sox_CEffectsChain *))__pyx_f_5pysox_3sox_13CEffectsChain___init_effects;
  __pyx_vtable_5pysox_3sox_CEffectsChain.__init_effect = (int (*)(struct __pyx_obj_5pysox_3sox_CEffectsChain *, struct __pyx_obj_5pysox_3sox_CEffect *))__pyx_f_5pysox_3sox_13CEffectsChain___init_effect;
  __pyx_vtable_5pysox_3sox_CEffectsChain.flow_effects = (int (*)(struct __pyx_obj_5pysox_3sox_CEffectsChain *, int __pyx_skip_dispatch, struct __pyx_opt_args_5pysox_3sox_13CEffectsChain_flow_effects *__pyx_optional_args))__pyx_f_5pysox_3sox_13CEffectsChain_flow_effects;
  __pyx_vtable_5pysox_3sox_CEffectsChain.__optimize_trim = (int (*)(struct __pyx_obj_5pysox_3sox_CEffectsChain *))__pyx_f_5pysox_3sox_13CEffectsChain___optimize_trim;
  if (PyType_Ready(&__pyx_type_5pysox_3sox_CEffectsChain) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_5pysox_3sox_CEffectsChain, "__init__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_5pysox_3sox_13CEffectsChain___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_5pysox_3sox_13CEffectsChain___init__.doc = __pyx_doc_5pysox_3sox_13CEffectsChain___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5pysox_3sox_13CEffectsChain___init__;
    }
  }
  if (__Pyx_SetVtable(__pyx_type_5pysox_3sox_CEffectsChain.tp_dict, __pyx_vtabptr_5pysox_3sox_CEffectsChain) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "CEffectsChain", (PyObject *)&__pyx_type_5pysox_3sox_CEffectsChain) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5pysox_3sox_CEffectsChain = &__pyx_type_5pysox_3sox_CEffectsChain;
  if (PyType_Ready(&__pyx_type_5pysox_3sox_SoxBufferIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "SoxBufferIterator", (PyObject *)&__pyx_type_5pysox_3sox_SoxBufferIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5pysox_3sox_SoxBufferIterator = &__pyx_type_5pysox_3sox_SoxBufferIterator;
  if (PyType_Ready(&__pyx_type_5pysox_3sox___CSox) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "__CSox", (PyObject *)&__pyx_type_5pysox_3sox___CSox) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5pysox_3sox___CSox = &__pyx_type_5pysox_3sox___CSox;
  if (PyType_Ready(&__pyx_type_5pysox_3sox___pyx_scope_struct____getbuffer__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5pysox_3sox___pyx_scope_struct____getbuffer__ = &__pyx_type_5pysox_3sox___pyx_scope_struct____getbuffer__;
  /*--- Type import code ---*/
  __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), 0); if (unlikely(!__pyx_ptype_7cpython_4bool_bool)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), 0); if (unlikely(!__pyx_ptype_7cpython_7complex_complex)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Function import code ---*/
  /*--- Execution code ---*/

  /* "pysox/sox.pyx":22
 * #from sys import version_info #FIXME from python_version cimport PY_MAJOR_VERSION
 * from cpython cimport PY_MAJOR_VERSION
 * import types             # <<<<<<<<<<<<<<
 * 
 * DEF SOX_SUCCESS = 0
 */
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__types), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__types, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pysox/sox.pyx":27
 * DEF SOX_SEEK_SET = 0
 * 
 * PY3 = PY_MAJOR_VERSION >= 3             # <<<<<<<<<<<<<<
 * if PY3:
 *     def b(s):
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong((PY_MAJOR_VERSION >= 3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__PY3, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pysox/sox.pyx":28
 * 
 * PY3 = PY_MAJOR_VERSION >= 3
 * if PY3:             # <<<<<<<<<<<<<<
 *     def b(s):
 *         return s.encode("utf-8")
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__PY3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "pysox/sox.pyx":29
 * PY3 = PY_MAJOR_VERSION >= 3
 * if PY3:
 *     def b(s):             # <<<<<<<<<<<<<<
 *         return s.encode("utf-8")
 *     def u(s):
 */
    __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5pysox_3sox_b, NULL, __pyx_n_s_42); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (PyObject_SetAttr(__pyx_m, __pyx_n_s__b, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pysox/sox.pyx":31
 *     def b(s):
 *         return s.encode("utf-8")
 *     def u(s):             # <<<<<<<<<<<<<<
 *         return s
 * else:
 */
    __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5pysox_3sox_1u, NULL, __pyx_n_s_42); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (PyObject_SetAttr(__pyx_m, __pyx_n_s__u, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L2;
  }
  /*else*/ {

    /* "pysox/sox.pyx":34
 *         return s
 * else:
 *     def b(s):             # <<<<<<<<<<<<<<
 *         return s
 *     def u(s):
 */
    __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5pysox_3sox_2b, NULL, __pyx_n_s_42); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (PyObject_SetAttr(__pyx_m, __pyx_n_s__b, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pysox/sox.pyx":36
 *     def b(s):
 *         return s
 *     def u(s):             # <<<<<<<<<<<<<<
 *         return unicode(s, "unicode_escape")
 * 
 */
    __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5pysox_3sox_3u, NULL, __pyx_n_s_42); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (PyObject_SetAttr(__pyx_m, __pyx_n_s__u, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L2:;

  /* "pysox/sox.pyx":63
 * #
 * ################################################################################################
 * class PysoxError(Exception):             # <<<<<<<<<<<<<<
 *     """Exception which is raised by the pysox system when some configuration is not acceptable
 *     """
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_INCREF(__pyx_builtin_Exception);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_builtin_Exception);
  __Pyx_GIVEREF(__pyx_builtin_Exception);
  if (PyDict_SetItemString(((PyObject *)__pyx_t_1), "__doc__", ((PyObject *)__pyx_kp_s_58)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = __Pyx_CreateClass(((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1), __pyx_n_s__PysoxError, __pyx_n_s_42); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__PysoxError, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

  /* "pysox/sox.pyx":77
 * #    cdef csox.sox_encodinginfo_t  s_encoding
 * 
 *     UNKNOWN = 0  #,             # <<<<<<<<<<<<<<
 *     SIGN2 = 1    #, /[inserted by cython to avoid comment start]* signed linear 2's comp: Mac *[inserted by cython to avoid comment closer]/
 *     UNSIGNED = 2 #, /[inserted by cython to avoid comment start]* unsigned linear: Sound Blaster *[inserted by cython to avoid comment closer]/
 */
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pysox_3sox_CEncodingInfo->tp_dict, __pyx_n_s__UNKNOWN, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyType_Modified(__pyx_ptype_5pysox_3sox_CEncodingInfo);

  /* "pysox/sox.pyx":78
 * 
 *     UNKNOWN = 0  #,
 *     SIGN2 = 1    #, /[inserted by cython to avoid comment start]* signed linear 2's comp: Mac *[inserted by cython to avoid comment closer]/             # <<<<<<<<<<<<<<
 *     UNSIGNED = 2 #, /[inserted by cython to avoid comment start]* unsigned linear: Sound Blaster *[inserted by cython to avoid comment closer]/
 *     FLOAT = 3    #, /[inserted by cython to avoid comment start]* floating point (binary format) *[inserted by cython to avoid comment closer]/
 */
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pysox_3sox_CEncodingInfo->tp_dict, __pyx_n_s__SIGN2, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyType_Modified(__pyx_ptype_5pysox_3sox_CEncodingInfo);

  /* "pysox/sox.pyx":79
 *     UNKNOWN = 0  #,
 *     SIGN2 = 1    #, /[inserted by cython to avoid comment start]* signed linear 2's comp: Mac *[inserted by cython to avoid comment closer]/
 *     UNSIGNED = 2 #, /[inserted by cython to avoid comment start]* unsigned linear: Sound Blaster *[inserted by cython to avoid comment closer]/             # <<<<<<<<<<<<<<
 *     FLOAT = 3    #, /[inserted by cython to avoid comment start]* floating point (binary format) *[inserted by cython to avoid comment closer]/
 *     FLOAT_TEXT = 4 #, /[inserted by cython to avoid comment start]* floating point (text format) *[inserted by cython to avoid comment closer]/
 */
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pysox_3sox_CEncodingInfo->tp_dict, __pyx_n_s__UNSIGNED, __pyx_int_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyType_Modified(__pyx_ptype_5pysox_3sox_CEncodingInfo);

  /* "pysox/sox.pyx":80
 *     SIGN2 = 1    #, /[inserted by cython to avoid comment start]* signed linear 2's comp: Mac *[inserted by cython to avoid comment closer]/
 *     UNSIGNED = 2 #, /[inserted by cython to avoid comment start]* unsigned linear: Sound Blaster *[inserted by cython to avoid comment closer]/
 *     FLOAT = 3    #, /[inserted by cython to avoid comment start]* floating point (binary format) *[inserted by cython to avoid comment closer]/             # <<<<<<<<<<<<<<
 *     FLOAT_TEXT = 4 #, /[inserted by cython to avoid comment start]* floating point (text format) *[inserted by cython to avoid comment closer]/
 *     FLAC = 5     #, /[inserted by cython to avoid comment start]* FLAC compression *[inserted by cython to avoid comment closer]/
 */
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pysox_3sox_CEncodingInfo->tp_dict, __pyx_n_s__FLOAT, __pyx_int_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyType_Modified(__pyx_ptype_5pysox_3sox_CEncodingInfo);

  /* "pysox/sox.pyx":81
 *     UNSIGNED = 2 #, /[inserted by cython to avoid comment start]* unsigned linear: Sound Blaster *[inserted by cython to avoid comment closer]/
 *     FLOAT = 3    #, /[inserted by cython to avoid comment start]* floating point (binary format) *[inserted by cython to avoid comment closer]/
 *     FLOAT_TEXT = 4 #, /[inserted by cython to avoid comment start]* floating point (text format) *[inserted by cython to avoid comment closer]/             # <<<<<<<<<<<<<<
 *     FLAC = 5     #, /[inserted by cython to avoid comment start]* FLAC compression *[inserted by cython to avoid comment closer]/
 *     HCOM = 6     #, /[inserted by cython to avoid comment start]*  *[inserted by cython to avoid comment closer]/
 */
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pysox_3sox_CEncodingInfo->tp_dict, __pyx_n_s__FLOAT_TEXT, __pyx_int_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyType_Modified(__pyx_ptype_5pysox_3sox_CEncodingInfo);

  /* "pysox/sox.pyx":82
 *     FLOAT = 3    #, /[inserted by cython to avoid comment start]* floating point (binary format) *[inserted by cython to avoid comment closer]/
 *     FLOAT_TEXT = 4 #, /[inserted by cython to avoid comment start]* floating point (text format) *[inserted by cython to avoid comment closer]/
 *     FLAC = 5     #, /[inserted by cython to avoid comment start]* FLAC compression *[inserted by cython to avoid comment closer]/             # <<<<<<<<<<<<<<
 *     HCOM = 6     #, /[inserted by cython to avoid comment start]*  *[inserted by cython to avoid comment closer]/
 *     WAVPACK = 7  #, /[inserted by cython to avoid comment start]*  *[inserted by cython to avoid comment closer]/
 */
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pysox_3sox_CEncodingInfo->tp_dict, __pyx_n_s__FLAC, __pyx_int_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyType_Modified(__pyx_ptype_5pysox_3sox_CEncodingInfo);

  /* "pysox/sox.pyx":83
 *     FLOAT_TEXT = 4 #, /[inserted by cython to avoid comment start]* floating point (text format) *[inserted by cython to avoid comment closer]/
 *     FLAC = 5     #, /[inserted by cython to avoid comment start]* FLAC compression *[inserted by cython to avoid comment closer]/
 *     HCOM = 6     #, /[inserted by cython to avoid comment start]*  *[inserted by cython to avoid comment closer]/             # <<<<<<<<<<<<<<
 *     WAVPACK = 7  #, /[inserted by cython to avoid comment start]*  *[inserted by cython to avoid comment closer]/
 *     WAVPACKF = 8 #, /[inserted by cython to avoid comment start]*  *[inserted by cython to avoid comment closer]/
 */
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pysox_3sox_CEncodingInfo->tp_dict, __pyx_n_s__HCOM, __pyx_int_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyType_Modified(__pyx_ptype_5pysox_3sox_CEncodingInfo);

  /* "pysox/sox.pyx":84
 *     FLAC = 5     #, /[inserted by cython to avoid comment start]* FLAC compression *[inserted by cython to avoid comment closer]/
 *     HCOM = 6     #, /[inserted by cython to avoid comment start]*  *[inserted by cython to avoid comment closer]/
 *     WAVPACK = 7  #, /[inserted by cython to avoid comment start]*  *[inserted by cython to avoid comment closer]/             # <<<<<<<<<<<<<<
 *     WAVPACKF = 8 #, /[inserted by cython to avoid comment start]*  *[inserted by cython to avoid comment closer]/
 *     ULAW = 9     #, /[inserted by cython to avoid comment start]* u-law signed logs: US telephony, SPARC *[inserted by cython to avoid comment closer]/
 */
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pysox_3sox_CEncodingInfo->tp_dict, __pyx_n_s__WAVPACK, __pyx_int_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyType_Modified(__pyx_ptype_5pysox_3sox_CEncodingInfo);

  /* "pysox/sox.pyx":85
 *     HCOM = 6     #, /[inserted by cython to avoid comment start]*  *[inserted by cython to avoid comment closer]/
 *     WAVPACK = 7  #, /[inserted by cython to avoid comment start]*  *[inserted by cython to avoid comment closer]/
 *     WAVPACKF = 8 #, /[inserted by cython to avoid comment start]*  *[inserted by cython to avoid comment closer]/             # <<<<<<<<<<<<<<
 *     ULAW = 9     #, /[inserted by cython to avoid comment start]* u-law signed logs: US telephony, SPARC *[inserted by cython to avoid comment closer]/
 *     ALAW = 10     #, /[inserted by cython to avoid comment start]* A-law signed logs: non-US telephony, Psion *[inserted by cython to avoid comment closer]/
 */
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pysox_3sox_CEncodingInfo->tp_dict, __pyx_n_s__WAVPACKF, __pyx_int_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyType_Modified(__pyx_ptype_5pysox_3sox_CEncodingInfo);

  /* "pysox/sox.pyx":86
 *     WAVPACK = 7  #, /[inserted by cython to avoid comment start]*  *[inserted by cython to avoid comment closer]/
 *     WAVPACKF = 8 #, /[inserted by cython to avoid comment start]*  *[inserted by cython to avoid comment closer]/
 *     ULAW = 9     #, /[inserted by cython to avoid comment start]* u-law signed logs: US telephony, SPARC *[inserted by cython to avoid comment closer]/             # <<<<<<<<<<<<<<
 *     ALAW = 10     #, /[inserted by cython to avoid comment start]* A-law signed logs: non-US telephony, Psion *[inserted by cython to avoid comment closer]/
 *     G721 = 11     #, /[inserted by cython to avoid comment start]* G.721 4-bit ADPCM *[inserted by cython to avoid comment closer]/
 */
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pysox_3sox_CEncodingInfo->tp_dict, __pyx_n_s__ULAW, __pyx_int_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyType_Modified(__pyx_ptype_5pysox_3sox_CEncodingInfo);

  /* "pysox/sox.pyx":87
 *     WAVPACKF = 8 #, /[inserted by cython to avoid comment start]*  *[inserted by cython to avoid comment closer]/
 *     ULAW = 9     #, /[inserted by cython to avoid comment start]* u-law signed logs: US telephony, SPARC *[inserted by cython to avoid comment closer]/
 *     ALAW = 10     #, /[inserted by cython to avoid comment start]* A-law signed logs: non-US telephony, Psion *[inserted by cython to avoid comment closer]/             # <<<<<<<<<<<<<<
 *     G721 = 11     #, /[inserted by cython to avoid comment start]* G.721 4-bit ADPCM *[inserted by cython to avoid comment closer]/
 *     G723 = 12     #, /[inserted by cython to avoid comment start]* G.723 3 or 5 bit ADPCM *[inserted by cython to avoid comment closer]/
 */
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pysox_3sox_CEncodingInfo->tp_dict, __pyx_n_s__ALAW, __pyx_int_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyType_Modified(__pyx_ptype_5pysox_3sox_CEncodingInfo);

  /* "pysox/sox.pyx":88
 *     ULAW = 9     #, /[inserted by cython to avoid comment start]* u-law signed logs: US telephony, SPARC *[inserted by cython to avoid comment closer]/
 *     ALAW = 10     #, /[inserted by cython to avoid comment start]* A-law signed logs: non-US telephony, Psion *[inserted by cython to avoid comment closer]/
 *     G721 = 11     #, /[inserted by cython to avoid comment start]* G.721 4-bit ADPCM *[inserted by cython to avoid comment closer]/             # <<<<<<<<<<<<<<
 *     G723 = 12     #, /[inserted by cython to avoid comment start]* G.723 3 or 5 bit ADPCM *[inserted by cython to avoid comment closer]/
 *     CL_ADPCM = 13 #, /[inserted by cython to avoid comment start]* Creative Labs 8 --> 2,3,4 bit Compressed PCM *[inserted by cython to avoid comment closer]/
 */
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pysox_3sox_CEncodingInfo->tp_dict, __pyx_n_s__G721, __pyx_int_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyType_Modified(__pyx_ptype_5pysox_3sox_CEncodingInfo);

  /* "pysox/sox.pyx":89
 *     ALAW = 10     #, /[inserted by cython to avoid comment start]* A-law signed logs: non-US telephony, Psion *[inserted by cython to avoid comment closer]/
 *     G721 = 11     #, /[inserted by cython to avoid comment start]* G.721 4-bit ADPCM *[inserted by cython to avoid comment closer]/
 *     G723 = 12     #, /[inserted by cython to avoid comment start]* G.723 3 or 5 bit ADPCM *[inserted by cython to avoid comment closer]/             # <<<<<<<<<<<<<<
 *     CL_ADPCM = 13 #, /[inserted by cython to avoid comment start]* Creative Labs 8 --> 2,3,4 bit Compressed PCM *[inserted by cython to avoid comment closer]/
 *     CL_ADPCM16 = 14#, /[inserted by cython to avoid comment start]* Creative Labs 16 --> 4 bit Compressed PCM *[inserted by cython to avoid comment closer]/
 */
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pysox_3sox_CEncodingInfo->tp_dict, __pyx_n_s__G723, __pyx_int_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyType_Modified(__pyx_ptype_5pysox_3sox_CEncodingInfo);

  /* "pysox/sox.pyx":90
 *     G721 = 11     #, /[inserted by cython to avoid comment start]* G.721 4-bit ADPCM *[inserted by cython to avoid comment closer]/
 *     G723 = 12     #, /[inserted by cython to avoid comment start]* G.723 3 or 5 bit ADPCM *[inserted by cython to avoid comment closer]/
 *     CL_ADPCM = 13 #, /[inserted by cython to avoid comment start]* Creative Labs 8 --> 2,3,4 bit Compressed PCM *[inserted by cython to avoid comment closer]/             # <<<<<<<<<<<<<<
 *     CL_ADPCM16 = 14#, /[inserted by cython to avoid comment start]* Creative Labs 16 --> 4 bit Compressed PCM *[inserted by cython to avoid comment closer]/
 *     MS_ADPCM = 15 #, /[inserted by cython to avoid comment start]* Microsoft Compressed PCM *[inserted by cython to avoid comment closer]/
 */
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pysox_3sox_CEncodingInfo->tp_dict, __pyx_n_s__CL_ADPCM, __pyx_int_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyType_Modified(__pyx_ptype_5pysox_3sox_CEncodingInfo);

  /* "pysox/sox.pyx":91
 *     G723 = 12     #, /[inserted by cython to avoid comment start]* G.723 3 or 5 bit ADPCM *[inserted by cython to avoid comment closer]/
 *     CL_ADPCM = 13 #, /[inserted by cython to avoid comment start]* Creative Labs 8 --> 2,3,4 bit Compressed PCM *[inserted by cython to avoid comment closer]/
 *     CL_ADPCM16 = 14#, /[inserted by cython to avoid comment start]* Creative Labs 16 --> 4 bit Compressed PCM *[inserted by cython to avoid comment closer]/             # <<<<<<<<<<<<<<
 *     MS_ADPCM = 15 #, /[inserted by cython to avoid comment start]* Microsoft Compressed PCM *[inserted by cython to avoid comment closer]/
 *     IMA_ADPCM = 16#, /[inserted by cython to avoid comment start]* IMA Compressed PCM *[inserted by cython to avoid comment closer]/
 */
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pysox_3sox_CEncodingInfo->tp_dict, __pyx_n_s__CL_ADPCM16, __pyx_int_14) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyType_Modified(__pyx_ptype_5pysox_3sox_CEncodingInfo);

  /* "pysox/sox.pyx":92
 *     CL_ADPCM = 13 #, /[inserted by cython to avoid comment start]* Creative Labs 8 --> 2,3,4 bit Compressed PCM *[inserted by cython to avoid comment closer]/
 *     CL_ADPCM16 = 14#, /[inserted by cython to avoid comment start]* Creative Labs 16 --> 4 bit Compressed PCM *[inserted by cython to avoid comment closer]/
 *     MS_ADPCM = 15 #, /[inserted by cython to avoid comment start]* Microsoft Compressed PCM *[inserted by cython to avoid comment closer]/             # <<<<<<<<<<<<<<
 *     IMA_ADPCM = 16#, /[inserted by cython to avoid comment start]* IMA Compressed PCM *[inserted by cython to avoid comment closer]/
 *     OKI_ADPCM = 17#, /[inserted by cython to avoid comment start]* Dialogic/OKI Compressed PCM *[inserted by cython to avoid comment closer]/
 */
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pysox_3sox_CEncodingInfo->tp_dict, __pyx_n_s__MS_ADPCM, __pyx_int_15) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyType_Modified(__pyx_ptype_5pysox_3sox_CEncodingInfo);

  /* "pysox/sox.pyx":93
 *     CL_ADPCM16 = 14#, /[inserted by cython to avoid comment start]* Creative Labs 16 --> 4 bit Compressed PCM *[inserted by cython to avoid comment closer]/
 *     MS_ADPCM = 15 #, /[inserted by cython to avoid comment start]* Microsoft Compressed PCM *[inserted by cython to avoid comment closer]/
 *     IMA_ADPCM = 16#, /[inserted by cython to avoid comment start]* IMA Compressed PCM *[inserted by cython to avoid comment closer]/             # <<<<<<<<<<<<<<
 *     OKI_ADPCM = 17#, /[inserted by cython to avoid comment start]* Dialogic/OKI Compressed PCM *[inserted by cython to avoid comment closer]/
 *     DPCM = 18     #, /[inserted by cython to avoid comment start]*  *[inserted by cython to avoid comment closer]/
 */
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pysox_3sox_CEncodingInfo->tp_dict, __pyx_n_s__IMA_ADPCM, __pyx_int_16) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyType_Modified(__pyx_ptype_5pysox_3sox_CEncodingInfo);

  /* "pysox/sox.pyx":94
 *     MS_ADPCM = 15 #, /[inserted by cython to avoid comment start]* Microsoft Compressed PCM *[inserted by cython to avoid comment closer]/
 *     IMA_ADPCM = 16#, /[inserted by cython to avoid comment start]* IMA Compressed PCM *[inserted by cython to avoid comment closer]/
 *     OKI_ADPCM = 17#, /[inserted by cython to avoid comment start]* Dialogic/OKI Compressed PCM *[inserted by cython to avoid comment closer]/             # <<<<<<<<<<<<<<
 *     DPCM = 18     #, /[inserted by cython to avoid comment start]*  *[inserted by cython to avoid comment closer]/
 *     DWVW = 19     #, /[inserted by cython to avoid comment start]*  *[inserted by cython to avoid comment closer]/
 */
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pysox_3sox_CEncodingInfo->tp_dict, __pyx_n_s__OKI_ADPCM, __pyx_int_17) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyType_Modified(__pyx_ptype_5pysox_3sox_CEncodingInfo);

  /* "pysox/sox.pyx":95
 *     IMA_ADPCM = 16#, /[inserted by cython to avoid comment start]* IMA Compressed PCM *[inserted by cython to avoid comment closer]/
 *     OKI_ADPCM = 17#, /[inserted by cython to avoid comment start]* Dialogic/OKI Compressed PCM *[inserted by cython to avoid comment closer]/
 *     DPCM = 18     #, /[inserted by cython to avoid comment start]*  *[inserted by cython to avoid comment closer]/             # <<<<<<<<<<<<<<
 *     DWVW = 19     #, /[inserted by cython to avoid comment start]*  *[inserted by cython to avoid comment closer]/
 *     DWVWN = 20    #, /[inserted by cython to avoid comment start]*  *[inserted by cython to avoid comment closer]/
 */
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pysox_3sox_CEncodingInfo->tp_dict, __pyx_n_s__DPCM, __pyx_int_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyType_Modified(__pyx_ptype_5pysox_3sox_CEncodingInfo);

  /* "pysox/sox.pyx":96
 *     OKI_ADPCM = 17#, /[inserted by cython to avoid comment start]* Dialogic/OKI Compressed PCM *[inserted by cython to avoid comment closer]/
 *     DPCM = 18     #, /[inserted by cython to avoid comment start]*  *[inserted by cython to avoid comment closer]/
 *     DWVW = 19     #, /[inserted by cython to avoid comment start]*  *[inserted by cython to avoid comment closer]/             # <<<<<<<<<<<<<<
 *     DWVWN = 20    #, /[inserted by cython to avoid comment start]*  *[inserted by cython to avoid comment closer]/
 *     GSM = 21      #, /[inserted by cython to avoid comment start]* GSM 6.10 33byte frame lossy compression *[inserted by cython to avoid comment closer]/
 */
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pysox_3sox_CEncodingInfo->tp_dict, __pyx_n_s__DWVW, __pyx_int_19) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyType_Modified(__pyx_ptype_5pysox_3sox_CEncodingInfo);

  /* "pysox/sox.pyx":97
 *     DPCM = 18     #, /[inserted by cython to avoid comment start]*  *[inserted by cython to avoid comment closer]/
 *     DWVW = 19     #, /[inserted by cython to avoid comment start]*  *[inserted by cython to avoid comment closer]/
 *     DWVWN = 20    #, /[inserted by cython to avoid comment start]*  *[inserted by cython to avoid comment closer]/             # <<<<<<<<<<<<<<
 *     GSM = 21      #, /[inserted by cython to avoid comment start]* GSM 6.10 33byte frame lossy compression *[inserted by cython to avoid comment closer]/
 *     MP3 = 22      #, /[inserted by cython to avoid comment start]* MP3 compression *[inserted by cython to avoid comment closer]/
 */
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pysox_3sox_CEncodingInfo->tp_dict, __pyx_n_s__DWVWN, __pyx_int_20) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyType_Modified(__pyx_ptype_5pysox_3sox_CEncodingInfo);

  /* "pysox/sox.pyx":98
 *     DWVW = 19     #, /[inserted by cython to avoid comment start]*  *[inserted by cython to avoid comment closer]/
 *     DWVWN = 20    #, /[inserted by cython to avoid comment start]*  *[inserted by cython to avoid comment closer]/
 *     GSM = 21      #, /[inserted by cython to avoid comment start]* GSM 6.10 33byte frame lossy compression *[inserted by cython to avoid comment closer]/             # <<<<<<<<<<<<<<
 *     MP3 = 22      #, /[inserted by cython to avoid comment start]* MP3 compression *[inserted by cython to avoid comment closer]/
 *     VORBIS = 23   #, /[inserted by cython to avoid comment start]* Vorbis compression *[inserted by cython to avoid comment closer]/
 */
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pysox_3sox_CEncodingInfo->tp_dict, __pyx_n_s__GSM, __pyx_int_21) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyType_Modified(__pyx_ptype_5pysox_3sox_CEncodingInfo);

  /* "pysox/sox.pyx":99
 *     DWVWN = 20    #, /[inserted by cython to avoid comment start]*  *[inserted by cython to avoid comment closer]/
 *     GSM = 21      #, /[inserted by cython to avoid comment start]* GSM 6.10 33byte frame lossy compression *[inserted by cython to avoid comment closer]/
 *     MP3 = 22      #, /[inserted by cython to avoid comment start]* MP3 compression *[inserted by cython to avoid comment closer]/             # <<<<<<<<<<<<<<
 *     VORBIS = 23   #, /[inserted by cython to avoid comment start]* Vorbis compression *[inserted by cython to avoid comment closer]/
 *     AMR_WB = 24   #, /[inserted by cython to avoid comment start]* AMR-WB compression *[inserted by cython to avoid comment closer]/
 */
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pysox_3sox_CEncodingInfo->tp_dict, __pyx_n_s__MP3, __pyx_int_22) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyType_Modified(__pyx_ptype_5pysox_3sox_CEncodingInfo);

  /* "pysox/sox.pyx":100
 *     GSM = 21      #, /[inserted by cython to avoid comment start]* GSM 6.10 33byte frame lossy compression *[inserted by cython to avoid comment closer]/
 *     MP3 = 22      #, /[inserted by cython to avoid comment start]* MP3 compression *[inserted by cython to avoid comment closer]/
 *     VORBIS = 23   #, /[inserted by cython to avoid comment start]* Vorbis compression *[inserted by cython to avoid comment closer]/             # <<<<<<<<<<<<<<
 *     AMR_WB = 24   #, /[inserted by cython to avoid comment start]* AMR-WB compression *[inserted by cython to avoid comment closer]/
 *     AMR_NB = 25   #, /[inserted by cython to avoid comment start]* AMR-NB compression *[inserted by cython to avoid comment closer]/
 */
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pysox_3sox_CEncodingInfo->tp_dict, __pyx_n_s__VORBIS, __pyx_int_23) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyType_Modified(__pyx_ptype_5pysox_3sox_CEncodingInfo);

  /* "pysox/sox.pyx":101
 *     MP3 = 22      #, /[inserted by cython to avoid comment start]* MP3 compression *[inserted by cython to avoid comment closer]/
 *     VORBIS = 23   #, /[inserted by cython to avoid comment start]* Vorbis compression *[inserted by cython to avoid comment closer]/
 *     AMR_WB = 24   #, /[inserted by cython to avoid comment start]* AMR-WB compression *[inserted by cython to avoid comment closer]/             # <<<<<<<<<<<<<<
 *     AMR_NB = 25   #, /[inserted by cython to avoid comment start]* AMR-NB compression *[inserted by cython to avoid comment closer]/
 *     CVSD = 26     #, /[inserted by cython to avoid comment start]*  *[inserted by cython to avoid comment closer]/
 */
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pysox_3sox_CEncodingInfo->tp_dict, __pyx_n_s__AMR_WB, __pyx_int_24) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyType_Modified(__pyx_ptype_5pysox_3sox_CEncodingInfo);

  /* "pysox/sox.pyx":102
 *     VORBIS = 23   #, /[inserted by cython to avoid comment start]* Vorbis compression *[inserted by cython to avoid comment closer]/
 *     AMR_WB = 24   #, /[inserted by cython to avoid comment start]* AMR-WB compression *[inserted by cython to avoid comment closer]/
 *     AMR_NB = 25   #, /[inserted by cython to avoid comment start]* AMR-NB compression *[inserted by cython to avoid comment closer]/             # <<<<<<<<<<<<<<
 *     CVSD = 26     #, /[inserted by cython to avoid comment start]*  *[inserted by cython to avoid comment closer]/
 *     LPC10 = 27    #, /[inserted by cython to avoid comment start]*  *[inserted by cython to avoid comment closer]/
 */
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pysox_3sox_CEncodingInfo->tp_dict, __pyx_n_s__AMR_NB, __pyx_int_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyType_Modified(__pyx_ptype_5pysox_3sox_CEncodingInfo);

  /* "pysox/sox.pyx":103
 *     AMR_WB = 24   #, /[inserted by cython to avoid comment start]* AMR-WB compression *[inserted by cython to avoid comment closer]/
 *     AMR_NB = 25   #, /[inserted by cython to avoid comment start]* AMR-NB compression *[inserted by cython to avoid comment closer]/
 *     CVSD = 26     #, /[inserted by cython to avoid comment start]*  *[inserted by cython to avoid comment closer]/             # <<<<<<<<<<<<<<
 *     LPC10 = 27    #, /[inserted by cython to avoid comment start]*  *[inserted by cython to avoid comment closer]/
 * 
 */
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pysox_3sox_CEncodingInfo->tp_dict, __pyx_n_s__CVSD, __pyx_int_26) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyType_Modified(__pyx_ptype_5pysox_3sox_CEncodingInfo);

  /* "pysox/sox.pyx":104
 *     AMR_NB = 25   #, /[inserted by cython to avoid comment start]* AMR-NB compression *[inserted by cython to avoid comment closer]/
 *     CVSD = 26     #, /[inserted by cython to avoid comment start]*  *[inserted by cython to avoid comment closer]/
 *     LPC10 = 27    #, /[inserted by cython to avoid comment start]*  *[inserted by cython to avoid comment closer]/             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, *args, **kwargs):
 */
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pysox_3sox_CEncodingInfo->tp_dict, __pyx_n_s__LPC10, __pyx_int_27) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyType_Modified(__pyx_ptype_5pysox_3sox_CEncodingInfo);

  /* "pysox/sox.pyx":589
 * #    cdef name
 * 
 *     SOX_EFF_CHAN = 1           #/[inserted by cython to avoid comment start]* Can alter # of channels *[inserted by cython to avoid comment closer]/             # <<<<<<<<<<<<<<
 *     SOX_EFF_RATE = 2           #/[inserted by cython to avoid comment start]* Can alter sample rate *[inserted by cython to avoid comment closer]/
 *     SOX_EFF_PREC = 4           #/[inserted by cython to avoid comment start]* Can alter sample precision *[inserted by cython to avoid comment closer]/
 */
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pysox_3sox_CEffect->tp_dict, __pyx_n_s__SOX_EFF_CHAN, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyType_Modified(__pyx_ptype_5pysox_3sox_CEffect);

  /* "pysox/sox.pyx":590
 * 
 *     SOX_EFF_CHAN = 1           #/[inserted by cython to avoid comment start]* Can alter # of channels *[inserted by cython to avoid comment closer]/
 *     SOX_EFF_RATE = 2           #/[inserted by cython to avoid comment start]* Can alter sample rate *[inserted by cython to avoid comment closer]/             # <<<<<<<<<<<<<<
 *     SOX_EFF_PREC = 4           #/[inserted by cython to avoid comment start]* Can alter sample precision *[inserted by cython to avoid comment closer]/
 *     SOX_EFF_LENGTH = 8           #/[inserted by cython to avoid comment start]* Can alter audio length *[inserted by cython to avoid comment closer]/
 */
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pysox_3sox_CEffect->tp_dict, __pyx_n_s__SOX_EFF_RATE, __pyx_int_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyType_Modified(__pyx_ptype_5pysox_3sox_CEffect);

  /* "pysox/sox.pyx":591
 *     SOX_EFF_CHAN = 1           #/[inserted by cython to avoid comment start]* Can alter # of channels *[inserted by cython to avoid comment closer]/
 *     SOX_EFF_RATE = 2           #/[inserted by cython to avoid comment start]* Can alter sample rate *[inserted by cython to avoid comment closer]/
 *     SOX_EFF_PREC = 4           #/[inserted by cython to avoid comment start]* Can alter sample precision *[inserted by cython to avoid comment closer]/             # <<<<<<<<<<<<<<
 *     SOX_EFF_LENGTH = 8           #/[inserted by cython to avoid comment start]* Can alter audio length *[inserted by cython to avoid comment closer]/
 *     SOX_EFF_MCHAN = 16          #/[inserted by cython to avoid comment start]* Can handle multi-channel *[inserted by cython to avoid comment closer]/
 */
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pysox_3sox_CEffect->tp_dict, __pyx_n_s__SOX_EFF_PREC, __pyx_int_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyType_Modified(__pyx_ptype_5pysox_3sox_CEffect);

  /* "pysox/sox.pyx":592
 *     SOX_EFF_RATE = 2           #/[inserted by cython to avoid comment start]* Can alter sample rate *[inserted by cython to avoid comment closer]/
 *     SOX_EFF_PREC = 4           #/[inserted by cython to avoid comment start]* Can alter sample precision *[inserted by cython to avoid comment closer]/
 *     SOX_EFF_LENGTH = 8           #/[inserted by cython to avoid comment start]* Can alter audio length *[inserted by cython to avoid comment closer]/             # <<<<<<<<<<<<<<
 *     SOX_EFF_MCHAN = 16          #/[inserted by cython to avoid comment start]* Can handle multi-channel *[inserted by cython to avoid comment closer]/
 *     SOX_EFF_NULL = 32          #/[inserted by cython to avoid comment start]* Does nothing *[inserted by cython to avoid comment closer]/
 */
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pysox_3sox_CEffect->tp_dict, __pyx_n_s__SOX_EFF_LENGTH, __pyx_int_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyType_Modified(__pyx_ptype_5pysox_3sox_CEffect);

  /* "pysox/sox.pyx":593
 *     SOX_EFF_PREC = 4           #/[inserted by cython to avoid comment start]* Can alter sample precision *[inserted by cython to avoid comment closer]/
 *     SOX_EFF_LENGTH = 8           #/[inserted by cython to avoid comment start]* Can alter audio length *[inserted by cython to avoid comment closer]/
 *     SOX_EFF_MCHAN = 16          #/[inserted by cython to avoid comment start]* Can handle multi-channel *[inserted by cython to avoid comment closer]/             # <<<<<<<<<<<<<<
 *     SOX_EFF_NULL = 32          #/[inserted by cython to avoid comment start]* Does nothing *[inserted by cython to avoid comment closer]/
 *     SOX_EFF_DEPRECATED = 64        #/[inserted by cython to avoid comment start]* Is living on borrowed time *[inserted by cython to avoid comment closer]/
 */
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pysox_3sox_CEffect->tp_dict, __pyx_n_s__SOX_EFF_MCHAN, __pyx_int_16) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyType_Modified(__pyx_ptype_5pysox_3sox_CEffect);

  /* "pysox/sox.pyx":594
 *     SOX_EFF_LENGTH = 8           #/[inserted by cython to avoid comment start]* Can alter audio length *[inserted by cython to avoid comment closer]/
 *     SOX_EFF_MCHAN = 16          #/[inserted by cython to avoid comment start]* Can handle multi-channel *[inserted by cython to avoid comment closer]/
 *     SOX_EFF_NULL = 32          #/[inserted by cython to avoid comment start]* Does nothing *[inserted by cython to avoid comment closer]/             # <<<<<<<<<<<<<<
 *     SOX_EFF_DEPRECATED = 64        #/[inserted by cython to avoid comment start]* Is living on borrowed time *[inserted by cython to avoid comment closer]/
 *     SOX_EFF_GAIN = 128         #/[inserted by cython to avoid comment start]* Does not support gain -r *[inserted by cython to avoid comment closer]/
 */
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pysox_3sox_CEffect->tp_dict, __pyx_n_s__SOX_EFF_NULL, __pyx_int_32) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyType_Modified(__pyx_ptype_5pysox_3sox_CEffect);

  /* "pysox/sox.pyx":595
 *     SOX_EFF_MCHAN = 16          #/[inserted by cython to avoid comment start]* Can handle multi-channel *[inserted by cython to avoid comment closer]/
 *     SOX_EFF_NULL = 32          #/[inserted by cython to avoid comment start]* Does nothing *[inserted by cython to avoid comment closer]/
 *     SOX_EFF_DEPRECATED = 64        #/[inserted by cython to avoid comment start]* Is living on borrowed time *[inserted by cython to avoid comment closer]/             # <<<<<<<<<<<<<<
 *     SOX_EFF_GAIN = 128         #/[inserted by cython to avoid comment start]* Does not support gain -r *[inserted by cython to avoid comment closer]/
 *     SOX_EFF_MODIFY = 256         #/[inserted by cython to avoid comment start]* Does not modify samples *[inserted by cython to avoid comment closer]/
 */
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pysox_3sox_CEffect->tp_dict, __pyx_n_s__SOX_EFF_DEPRECATED, __pyx_int_64) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyType_Modified(__pyx_ptype_5pysox_3sox_CEffect);

  /* "pysox/sox.pyx":596
 *     SOX_EFF_NULL = 32          #/[inserted by cython to avoid comment start]* Does nothing *[inserted by cython to avoid comment closer]/
 *     SOX_EFF_DEPRECATED = 64        #/[inserted by cython to avoid comment start]* Is living on borrowed time *[inserted by cython to avoid comment closer]/
 *     SOX_EFF_GAIN = 128         #/[inserted by cython to avoid comment start]* Does not support gain -r *[inserted by cython to avoid comment closer]/             # <<<<<<<<<<<<<<
 *     SOX_EFF_MODIFY = 256         #/[inserted by cython to avoid comment start]* Does not modify samples *[inserted by cython to avoid comment closer]/
 *     SOX_EFF_ALPHA = 512         #/[inserted by cython to avoid comment start]* Is experimental/incomplete *[inserted by cython to avoid comment closer]/
 */
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pysox_3sox_CEffect->tp_dict, __pyx_n_s__SOX_EFF_GAIN, __pyx_int_128) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyType_Modified(__pyx_ptype_5pysox_3sox_CEffect);

  /* "pysox/sox.pyx":597
 *     SOX_EFF_DEPRECATED = 64        #/[inserted by cython to avoid comment start]* Is living on borrowed time *[inserted by cython to avoid comment closer]/
 *     SOX_EFF_GAIN = 128         #/[inserted by cython to avoid comment start]* Does not support gain -r *[inserted by cython to avoid comment closer]/
 *     SOX_EFF_MODIFY = 256         #/[inserted by cython to avoid comment start]* Does not modify samples *[inserted by cython to avoid comment closer]/             # <<<<<<<<<<<<<<
 *     SOX_EFF_ALPHA = 512         #/[inserted by cython to avoid comment start]* Is experimental/incomplete *[inserted by cython to avoid comment closer]/
 *     SOX_EFF_INTERNAL = 1024        #/[inserted by cython to avoid comment start]* Is in libSoX but not sox *[inserted by cython to avoid comment closer]/
 */
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pysox_3sox_CEffect->tp_dict, __pyx_n_s__SOX_EFF_MODIFY, __pyx_int_256) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyType_Modified(__pyx_ptype_5pysox_3sox_CEffect);

  /* "pysox/sox.pyx":598
 *     SOX_EFF_GAIN = 128         #/[inserted by cython to avoid comment start]* Does not support gain -r *[inserted by cython to avoid comment closer]/
 *     SOX_EFF_MODIFY = 256         #/[inserted by cython to avoid comment start]* Does not modify samples *[inserted by cython to avoid comment closer]/
 *     SOX_EFF_ALPHA = 512         #/[inserted by cython to avoid comment start]* Is experimental/incomplete *[inserted by cython to avoid comment closer]/             # <<<<<<<<<<<<<<
 *     SOX_EFF_INTERNAL = 1024        #/[inserted by cython to avoid comment start]* Is in libSoX but not sox *[inserted by cython to avoid comment closer]/
 * 
 */
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pysox_3sox_CEffect->tp_dict, __pyx_n_s__SOX_EFF_ALPHA, __pyx_int_512) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyType_Modified(__pyx_ptype_5pysox_3sox_CEffect);

  /* "pysox/sox.pyx":599
 *     SOX_EFF_MODIFY = 256         #/[inserted by cython to avoid comment start]* Does not modify samples *[inserted by cython to avoid comment closer]/
 *     SOX_EFF_ALPHA = 512         #/[inserted by cython to avoid comment start]* Is experimental/incomplete *[inserted by cython to avoid comment closer]/
 *     SOX_EFF_INTERNAL = 1024        #/[inserted by cython to avoid comment start]* Is in libSoX but not sox *[inserted by cython to avoid comment closer]/             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, *args, **kwargs):
 */
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pysox_3sox_CEffect->tp_dict, __pyx_n_s__SOX_EFF_INTERNAL, __pyx_int_1024) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyType_Modified(__pyx_ptype_5pysox_3sox_CEffect);

  /* "pysox/sox.pyx":922
 *         return 0
 * 
 *     cpdef int flow_effects(self, optimize_trim=True) except -1:             # <<<<<<<<<<<<<<
 *         """Flow samples through the effects processing chain until EOF is reached.
 * 
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_35 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pysox/sox.pyx":984
 * 
 * available_flags = (
 *     ('FORMAT', cpython.buffer.PyBUF_FORMAT),             # <<<<<<<<<<<<<<
 *     ('INDIRECT', cpython.buffer.PyBUF_INDIRECT),
 *     ('ND', cpython.buffer.PyBUF_ND),
 */
  __pyx_t_1 = PyInt_FromLong(PyBUF_FORMAT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__FORMAT));
  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_n_s__FORMAT));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__FORMAT));
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pysox/sox.pyx":985
 * available_flags = (
 *     ('FORMAT', cpython.buffer.PyBUF_FORMAT),
 *     ('INDIRECT', cpython.buffer.PyBUF_INDIRECT),             # <<<<<<<<<<<<<<
 *     ('ND', cpython.buffer.PyBUF_ND),
 *     ('STRIDES', cpython.buffer.PyBUF_STRIDES),
 */
  __pyx_t_1 = PyInt_FromLong(PyBUF_INDIRECT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__INDIRECT));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_n_s__INDIRECT));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__INDIRECT));
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pysox/sox.pyx":986
 *     ('FORMAT', cpython.buffer.PyBUF_FORMAT),
 *     ('INDIRECT', cpython.buffer.PyBUF_INDIRECT),
 *     ('ND', cpython.buffer.PyBUF_ND),             # <<<<<<<<<<<<<<
 *     ('STRIDES', cpython.buffer.PyBUF_STRIDES),
 *     ('C_CONTIGUOUS', cpython.buffer.PyBUF_C_CONTIGUOUS),
 */
  __pyx_t_1 = PyInt_FromLong(PyBUF_ND); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__ND));
  PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_n_s__ND));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ND));
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pysox/sox.pyx":987
 *     ('INDIRECT', cpython.buffer.PyBUF_INDIRECT),
 *     ('ND', cpython.buffer.PyBUF_ND),
 *     ('STRIDES', cpython.buffer.PyBUF_STRIDES),             # <<<<<<<<<<<<<<
 *     ('C_CONTIGUOUS', cpython.buffer.PyBUF_C_CONTIGUOUS),
 *     ('F_CONTIGUOUS', cpython.buffer.PyBUF_F_CONTIGUOUS),
 */
  __pyx_t_1 = PyInt_FromLong(PyBUF_STRIDES); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__STRIDES));
  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_n_s__STRIDES));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__STRIDES));
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pysox/sox.pyx":988
 *     ('ND', cpython.buffer.PyBUF_ND),
 *     ('STRIDES', cpython.buffer.PyBUF_STRIDES),
 *     ('C_CONTIGUOUS', cpython.buffer.PyBUF_C_CONTIGUOUS),             # <<<<<<<<<<<<<<
 *     ('F_CONTIGUOUS', cpython.buffer.PyBUF_F_CONTIGUOUS),
 *     ('WRITABLE', cpython.buffer.PyBUF_WRITABLE)
 */
  __pyx_t_1 = PyInt_FromLong(PyBUF_C_CONTIGUOUS); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_7));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__C_CONTIGUOUS));
  PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_n_s__C_CONTIGUOUS));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__C_CONTIGUOUS));
  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pysox/sox.pyx":989
 *     ('STRIDES', cpython.buffer.PyBUF_STRIDES),
 *     ('C_CONTIGUOUS', cpython.buffer.PyBUF_C_CONTIGUOUS),
 *     ('F_CONTIGUOUS', cpython.buffer.PyBUF_F_CONTIGUOUS),             # <<<<<<<<<<<<<<
 *     ('WRITABLE', cpython.buffer.PyBUF_WRITABLE)
 * )
 */
  __pyx_t_1 = PyInt_FromLong(PyBUF_F_CONTIGUOUS); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_8));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__F_CONTIGUOUS));
  PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_n_s__F_CONTIGUOUS));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__F_CONTIGUOUS));
  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pysox/sox.pyx":990
 *     ('C_CONTIGUOUS', cpython.buffer.PyBUF_C_CONTIGUOUS),
 *     ('F_CONTIGUOUS', cpython.buffer.PyBUF_F_CONTIGUOUS),
 *     ('WRITABLE', cpython.buffer.PyBUF_WRITABLE)             # <<<<<<<<<<<<<<
 * )
 * cdef class SoxSampleBuffer:
 */
  __pyx_t_1 = PyInt_FromLong(PyBUF_WRITABLE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_9));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__WRITABLE));
  PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_n_s__WRITABLE));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__WRITABLE));
  PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_4));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_t_3));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_t_5));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
  PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_t_6));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
  PyTuple_SET_ITEM(__pyx_t_1, 4, ((PyObject *)__pyx_t_7));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_7));
  PyTuple_SET_ITEM(__pyx_t_1, 5, ((PyObject *)__pyx_t_8));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_8));
  PyTuple_SET_ITEM(__pyx_t_1, 6, ((PyObject *)__pyx_t_9));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_9));
  __pyx_t_4 = 0;
  __pyx_t_3 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __pyx_t_8 = 0;
  __pyx_t_9 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__available_flags, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

  /* "pysox/sox.pyx":1332
 *         csox.sox_quit()
 * 
 * __sox_initializer = __CSox()             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pysox_3sox___CSox)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____sox_initializer, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pysox/sox.pyx":1
 * #             # <<<<<<<<<<<<<<
 * # Python objects wrapping the c implementation
 * #
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

  /* "cpython/type.pxd":2
 * 
 * cdef extern from "Python.h":             # <<<<<<<<<<<<<<
 *     # The C structure of the objects used to describe built-in types.
 * 
 */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  if (__pyx_m) {
    __Pyx_AddTraceback("init pysox.sox");
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init pysox.sox");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if PY_MAJOR_VERSION < 3
  return;
  #else
  return __pyx_m;
  #endif
}

/* Runtime support code */

static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
    PyObject *result;
    result = PyObject_GetAttr(dict, name);
    if (!result)
        PyErr_SetObject(PyExc_NameError, name);
    return result;
}

static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *local_type, *local_value, *local_tb;
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    local_type = tstate->curexc_type;
    local_value = tstate->curexc_value;
    local_tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
    if (unlikely(tstate->curexc_type))
        goto bad;
    #if PY_MAJOR_VERSION >= 3
    if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
        goto bad;
    #endif
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
    Py_INCREF(local_type);
    Py_INCREF(local_value);
    Py_INCREF(local_tb);
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = local_type;
    tstate->exc_value = local_value;
    tstate->exc_traceback = local_tb;
    /* Make sure tstate is in a consistent state when we XDECREF
       these objects (XDECREF may run arbitrary code). */
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
    return 0;
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
}


static CYTHON_INLINE int __Pyx_CheckKeywordStrings(
    PyObject *kwdict,
    const char* function_name,
    int kw_allowed)
{
    PyObject* key = 0;
    Py_ssize_t pos = 0;
    while (PyDict_Next(kwdict, &pos, &key, 0)) {
        #if PY_MAJOR_VERSION < 3
        if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key)))
        #else
        if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key)))
        #endif
            goto invalid_keyword_type;
    }
    if ((!kw_allowed) && unlikely(key))
        goto invalid_keyword;
    return 1;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%s() keywords must be strings", function_name);
    return 0;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%s() got an unexpected keyword argument '%s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
    return 0;
}


static void __Pyx_RaiseArgtupleInvalid(
    const char* func_name,
    int exact,
    Py_ssize_t num_min,
    Py_ssize_t num_max,
    Py_ssize_t num_found)
{
    Py_ssize_t num_expected;
    const char *number, *more_or_less;

    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    number = (num_expected == 1) ? "" : "s";
    PyErr_Format(PyExc_TypeError,
        #if PY_VERSION_HEX < 0x02050000
            "%s() takes %s %d positional argument%s (%d given)",
        #else
            "%s() takes %s %zd positional argument%s (%zd given)",
        #endif
        func_name, more_or_less, num_expected, number, num_found);
}

static CYTHON_INLINE void __Pyx_RaiseNoneIndexingError(void) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is unsubscriptable");
}

static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        #if PY_MAJOR_VERSION >= 3
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
        #else
        "%s() got multiple values for keyword argument '%s'", func_name,
        PyString_AS_STRING(kw_name));
        #endif
}

static int __Pyx_ParseOptionalKeywords(
    PyObject *kwds,
    PyObject **argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject *key = 0, *value = 0;
    Py_ssize_t pos = 0;
    PyObject*** name;
    PyObject*** first_kw_arg = argnames + num_pos_args;

    while (PyDict_Next(kwds, &pos, &key, &value)) {
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
        } else {
            #if PY_MAJOR_VERSION < 3
            if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) {
            #else
            if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key))) {
            #endif
                goto invalid_keyword_type;
            } else {
                for (name = first_kw_arg; *name; name++) {
                    #if PY_MAJOR_VERSION >= 3
                    if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) &&
                        PyUnicode_Compare(**name, key) == 0) break;
                    #else
                    if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) &&
                        _PyString_Eq(**name, key)) break;
                    #endif
                }
                if (*name) {
                    values[name-argnames] = value;
                } else {
                    /* unexpected keyword found */
                    for (name=argnames; name != first_kw_arg; name++) {
                        if (**name == key) goto arg_passed_twice;
                        #if PY_MAJOR_VERSION >= 3
                        if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) &&
                            PyUnicode_Compare(**name, key) == 0) goto arg_passed_twice;
                        #else
                        if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) &&
                            _PyString_Eq(**name, key)) goto arg_passed_twice;
                        #endif
                    }
                    if (kwds2) {
                        if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
                    } else {
                        goto invalid_keyword;
                    }
                }
            }
        }
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, **name);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%s() got an unexpected keyword argument '%s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    return -1;
}

static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
    const char *name, int exact)
{
    if (!type) {
        PyErr_Format(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (none_allowed && obj == Py_None) return 1;
    else if (exact) {
        if (Py_TYPE(obj) == type) return 1;
    }
    else {
        if (PyObject_TypeCheck(obj, type)) return 1;
    }
    PyErr_Format(PyExc_TypeError,
        "Argument '%s' has incorrect type (expected %s, got %s)",
        name, type->tp_name, Py_TYPE(obj)->tp_name);
    return 0;
}

static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();

    tmp_type = tstate->curexc_type;
    tmp_value = tstate->curexc_value;
    tmp_tb = tstate->curexc_traceback;
    tstate->curexc_type = type;
    tstate->curexc_value = value;
    tstate->curexc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}

static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
    PyThreadState *tstate = PyThreadState_GET();
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;

    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
}


#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
    Py_XINCREF(type);
    Py_XINCREF(value);
    Py_XINCREF(tb);
    /* First, check the traceback argument, replacing None with NULL. */
    if (tb == Py_None) {
        Py_DECREF(tb);
        tb = 0;
    }
    else if (tb != NULL && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto raise_error;
    }
    /* Next, replace a missing value with None */
    if (value == NULL) {
        value = Py_None;
        Py_INCREF(value);
    }
    #if PY_VERSION_HEX < 0x02050000
    if (!PyClass_Check(type))
    #else
    if (!PyType_Check(type))
    #endif
    {
        /* Raising an instance.  The value should be a dummy. */
        if (value != Py_None) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        /* Normalize to raise <class>, <instance> */
        Py_DECREF(value);
        value = type;
        #if PY_VERSION_HEX < 0x02050000
            if (PyInstance_Check(type)) {
                type = (PyObject*) ((PyInstanceObject*)type)->in_class;
                Py_INCREF(type);
            }
            else {
                type = 0;
                PyErr_SetString(PyExc_TypeError,
                    "raise: exception must be an old-style class or instance");
                goto raise_error;
            }
        #else
            type = (PyObject*) Py_TYPE(type);
            Py_INCREF(type);
            if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
                PyErr_SetString(PyExc_TypeError,
                    "raise: exception class must be a subclass of BaseException");
                goto raise_error;
            }
        #endif
    }

    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}

#else /* Python 3+ */

static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
    if (tb == Py_None) {
        tb = 0;
    } else if (tb && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;

    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } else if (!PyExceptionClass_Check(type)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }

    PyErr_SetObject(type, value);

    if (tb) {
        PyThreadState *tstate = PyThreadState_GET();
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
    }

bad:
    return;
}
#endif

static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
    if (unlikely(!type)) {
        PyErr_Format(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (likely(PyObject_TypeCheck(obj, type)))
        return 1;
    PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
                 Py_TYPE(obj)->tp_name, type->tp_name);
    return 0;
}

static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
        #if PY_VERSION_HEX < 0x02050000
                 "need more than %d value%s to unpack", (int)index,
        #else
                 "need more than %zd value%s to unpack", index,
        #endif
                 (index == 1) ? "" : "s");
}

static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
    PyErr_Format(PyExc_ValueError,
        #if PY_VERSION_HEX < 0x02050000
            "too many values to unpack (expected %d)", (int)expected);
        #else
            "too many values to unpack (expected %zd)", expected);
        #endif
}

static PyObject *__Pyx_UnpackItem(PyObject *iter, Py_ssize_t index) {
    PyObject *item;
    if (!(item = PyIter_Next(iter))) {
        if (!PyErr_Occurred()) {
            __Pyx_RaiseNeedMoreValuesError(index);
        }
    }
    return item;
}

static int __Pyx_EndUnpack(PyObject *iter, Py_ssize_t expected) {
    PyObject *item;
    if ((item = PyIter_Next(iter))) {
        Py_DECREF(item);
        __Pyx_RaiseTooManyValuesError(expected);
        return -1;
    }
    else if (!PyErr_Occurred())
        return 0;
    else
        return -1;
}

static CYTHON_INLINE int __Pyx_div_int(int a, int b) {
    int q = a / b;
    int r = a - q*b;
    q -= ((r != 0) & ((r ^ b) < 0));
    return q;
}

static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
    Py_ssize_t q = a / b;
    Py_ssize_t r = a - q*b;
    q -= ((r != 0) & ((r ^ b) < 0));
    return q;
}

static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
    PyThreadState *tstate = PyThreadState_GET();
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
}

static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = type;
    tstate->exc_value = value;
    tstate->exc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}

static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) {
    PyObject *py_import = 0;
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    py_import = __Pyx_GetAttrString(__pyx_b, "__import__");
    if (!py_import)
        goto bad;
    if (from_list)
        list = from_list;
    else {
        empty_list = PyList_New(0);
        if (!empty_list)
            goto bad;
        list = empty_list;
    }
    global_dict = PyModule_GetDict(__pyx_m);
    if (!global_dict)
        goto bad;
    empty_dict = PyDict_New();
    if (!empty_dict)
        goto bad;
    module = PyObject_CallFunctionObjArgs(py_import,
        name, global_dict, empty_dict, list, NULL);
bad:
    Py_XDECREF(empty_list);
    Py_XDECREF(py_import);
    Py_XDECREF(empty_dict);
    return module;
}

static PyObject *__Pyx_FindPy2Metaclass(PyObject *bases) {
    PyObject *metaclass;
    /* Default metaclass */
#if PY_MAJOR_VERSION < 3
    if (PyTuple_Check(bases) && PyTuple_GET_SIZE(bases) > 0) {
        PyObject *base = PyTuple_GET_ITEM(bases, 0);
        metaclass = PyObject_GetAttrString(base, "__class__");
        if (!metaclass) {
            PyErr_Clear();
            metaclass = (PyObject*) Py_TYPE(base);
        }
    } else {
        metaclass = (PyObject *) &PyClass_Type;
    }
#else
    if (PyTuple_Check(bases) && PyTuple_GET_SIZE(bases) > 0) {
        PyObject *base = PyTuple_GET_ITEM(bases, 0);
        metaclass = (PyObject*) Py_TYPE(base);
    } else {
        metaclass = (PyObject *) &PyType_Type;
    }
#endif
    Py_INCREF(metaclass);
    return metaclass;
}

static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name,
                                   PyObject *modname) {
    PyObject *result;
    PyObject *metaclass;

    if (PyDict_SetItemString(dict, "__module__", modname) < 0)
        return NULL;

    /* Python2 __metaclass__ */
    metaclass = PyDict_GetItemString(dict, "__metaclass__");
    if (metaclass) {
        Py_INCREF(metaclass);
    } else {
        metaclass = __Pyx_FindPy2Metaclass(bases);
    }
    result = PyObject_CallFunctionObjArgs(metaclass, name, bases, dict, NULL);
    Py_DECREF(metaclass);
    return result;
}

#if PY_MAJOR_VERSION < 3
static PyObject *__Pyx_GetStdout(void) {
    PyObject *f = PySys_GetObject((char *)"stdout");
    if (!f) {
        PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout");
    }
    return f;
}

static int __Pyx_Print(PyObject* f, PyObject *arg_tuple, int newline) {
    PyObject* v;
    int i;

    if (!f) {
        if (!(f = __Pyx_GetStdout()))
            return -1;
    }
    for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) {
        if (PyFile_SoftSpace(f, 1)) {
            if (PyFile_WriteString(" ", f) < 0)
                return -1;
        }
        v = PyTuple_GET_ITEM(arg_tuple, i);
        if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0)
            return -1;
        if (PyString_Check(v)) {
            char *s = PyString_AsString(v);
            Py_ssize_t len = PyString_Size(v);
            if (len > 0 &&
                isspace(Py_CHARMASK(s[len-1])) &&
                s[len-1] != ' ')
                    PyFile_SoftSpace(f, 0);
        }
    }
    if (newline) {
        if (PyFile_WriteString("\n", f) < 0)
            return -1;
        PyFile_SoftSpace(f, 0);
    }
    return 0;
}

#else /* Python 3 has a print function */

static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple, int newline) {
    PyObject* kwargs = 0;
    PyObject* result = 0;
    PyObject* end_string;
    if (unlikely(!__pyx_print)) {
        __pyx_print = __Pyx_GetAttrString(__pyx_b, "print");
        if (!__pyx_print)
            return -1;
    }
    if (stream) {
        kwargs = PyDict_New();
        if (unlikely(!kwargs))
            return -1;
        if (unlikely(PyDict_SetItemString(kwargs, "file", stream) < 0))
            goto bad;
        if (!newline) {
            end_string = PyUnicode_FromStringAndSize(" ", 1);
            if (unlikely(!end_string))
                goto bad;
            if (PyDict_SetItemString(kwargs, "end", end_string) < 0) {
                Py_DECREF(end_string);
                goto bad;
            }
            Py_DECREF(end_string);
        }
    } else if (!newline) {
        if (unlikely(!__pyx_print_kwargs)) {
            __pyx_print_kwargs = PyDict_New();
            if (unlikely(!__pyx_print_kwargs))
                return -1;
            end_string = PyUnicode_FromStringAndSize(" ", 1);
            if (unlikely(!end_string))
                return -1;
            if (PyDict_SetItemString(__pyx_print_kwargs, "end", end_string) < 0) {
                Py_DECREF(end_string);
                return -1;
            }
            Py_DECREF(end_string);
        }
        kwargs = __pyx_print_kwargs;
    }
    result = PyObject_Call(__pyx_print, arg_tuple, kwargs);
    if (unlikely(kwargs) && (kwargs != __pyx_print_kwargs))
        Py_DECREF(kwargs);
    if (!result)
        return -1;
    Py_DECREF(result);
    return 0;
bad:
    if (kwargs != __pyx_print_kwargs)
        Py_XDECREF(kwargs);
    return -1;
}

#endif

#if PY_MAJOR_VERSION < 3

static int __Pyx_PrintOne(PyObject* f, PyObject *o) {
    if (!f) {
        if (!(f = __Pyx_GetStdout()))
            return -1;
    }
    if (PyFile_SoftSpace(f, 0)) {
        if (PyFile_WriteString(" ", f) < 0)
            return -1;
    }
    if (PyFile_WriteObject(o, f, Py_PRINT_RAW) < 0)
        return -1;
    if (PyFile_WriteString("\n", f) < 0)
        return -1;
    return 0;
    /* the line below is just to avoid compiler
     * compiler warnings about unused functions */
    return __Pyx_Print(f, NULL, 0);
}

#else /* Python 3 has a print function */

static int __Pyx_PrintOne(PyObject* stream, PyObject *o) {
    int res;
    PyObject* arg_tuple = PyTuple_New(1);
    if (unlikely(!arg_tuple))
        return -1;
    Py_INCREF(o);
    PyTuple_SET_ITEM(arg_tuple, 0, o);
    res = __Pyx_Print(stream, arg_tuple, 1);
    Py_DECREF(arg_tuple);
    return res;
}

#endif

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_uint64_t(uint64_t val) {
    const uint64_t neg_one = (uint64_t)-1, const_zero = (uint64_t)0;
    const int is_unsigned = const_zero < neg_one;
    if ((sizeof(uint64_t) == sizeof(char))  ||
        (sizeof(uint64_t) == sizeof(short))) {
        return PyInt_FromLong((long)val);
    } else if ((sizeof(uint64_t) == sizeof(int)) ||
               (sizeof(uint64_t) == sizeof(long))) {
        if (is_unsigned)
            return PyLong_FromUnsignedLong((unsigned long)val);
        else
            return PyInt_FromLong((long)val);
    } else if (sizeof(uint64_t) == sizeof(PY_LONG_LONG)) {
        if (is_unsigned)
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val);
        else
            return PyLong_FromLongLong((PY_LONG_LONG)val);
    } else {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        return _PyLong_FromByteArray(bytes, sizeof(uint64_t), 
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE int32_t __Pyx_PyInt_from_py_int32_t(PyObject* x) {
    const int32_t neg_one = (int32_t)-1, const_zero = (int32_t)0;
    const int is_unsigned = const_zero < neg_one;
    if (sizeof(int32_t) == sizeof(char)) {
        if (is_unsigned)
            return (int32_t)__Pyx_PyInt_AsUnsignedChar(x);
        else
            return (int32_t)__Pyx_PyInt_AsSignedChar(x);
    } else if (sizeof(int32_t) == sizeof(short)) {
        if (is_unsigned)
            return (int32_t)__Pyx_PyInt_AsUnsignedShort(x);
        else
            return (int32_t)__Pyx_PyInt_AsSignedShort(x);
    } else if (sizeof(int32_t) == sizeof(int)) {
        if (is_unsigned)
            return (int32_t)__Pyx_PyInt_AsUnsignedInt(x);
        else
            return (int32_t)__Pyx_PyInt_AsSignedInt(x);
    } else if (sizeof(int32_t) == sizeof(long)) {
        if (is_unsigned)
            return (int32_t)__Pyx_PyInt_AsUnsignedLong(x);
        else
            return (int32_t)__Pyx_PyInt_AsSignedLong(x);
    } else if (sizeof(int32_t) == sizeof(PY_LONG_LONG)) {
        if (is_unsigned)
            return (int32_t)__Pyx_PyInt_AsUnsignedLongLong(x);
        else
            return (int32_t)__Pyx_PyInt_AsSignedLongLong(x);
    }  else {
        int32_t val;
        PyObject *v = __Pyx_PyNumber_Int(x);
        #if PY_VERSION_HEX < 0x03000000
        if (likely(v) && !PyLong_Check(v)) {
            PyObject *tmp = v;
            v = PyNumber_Long(tmp);
            Py_DECREF(tmp);
        }
        #endif
        if (likely(v)) {
            int one = 1; int is_little = (int)*(unsigned char *)&one;
            unsigned char *bytes = (unsigned char *)&val;
            int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                          bytes, sizeof(val),
                                          is_little, !is_unsigned);
            Py_DECREF(v);
            if (likely(!ret))
                return val;
        }
        return (int32_t)-1;
    }
}


static PyObject *__pyx_binding_PyCFunctionType_NewEx(PyMethodDef *ml, PyObject *self, PyObject *module) {
	__pyx_binding_PyCFunctionType_object *op = PyObject_GC_New(__pyx_binding_PyCFunctionType_object, __pyx_binding_PyCFunctionType);
    if (op == NULL)
        return NULL;
	op->func.m_ml = ml;
	Py_XINCREF(self);
	op->func.m_self = self;
	Py_XINCREF(module);
	op->func.m_module = module;
	PyObject_GC_Track(op);
	return (PyObject *)op;
}

static void __pyx_binding_PyCFunctionType_dealloc(__pyx_binding_PyCFunctionType_object *m) {
	PyObject_GC_UnTrack(m);
	Py_XDECREF(m->func.m_self);
	Py_XDECREF(m->func.m_module);
    PyObject_GC_Del(m);
}

static PyObject *__pyx_binding_PyCFunctionType_descr_get(PyObject *func, PyObject *obj, PyObject *type) {
	if (obj == Py_None)
		obj = NULL;
	return PyMethod_New(func, obj, type);
}

static int __pyx_binding_PyCFunctionType_init(void) {
    __pyx_binding_PyCFunctionType_type = PyCFunction_Type;
    __pyx_binding_PyCFunctionType_type.tp_name = __Pyx_NAMESTR("cython_binding_builtin_function_or_method");
    __pyx_binding_PyCFunctionType_type.tp_dealloc = (destructor)__pyx_binding_PyCFunctionType_dealloc;
    __pyx_binding_PyCFunctionType_type.tp_descr_get = __pyx_binding_PyCFunctionType_descr_get;
    if (PyType_Ready(&__pyx_binding_PyCFunctionType_type) < 0) {
        return -1;
    }
    __pyx_binding_PyCFunctionType = &__pyx_binding_PyCFunctionType_type;
    return 0;

}

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_int32_t(int32_t val) {
    const int32_t neg_one = (int32_t)-1, const_zero = (int32_t)0;
    const int is_unsigned = const_zero < neg_one;
    if ((sizeof(int32_t) == sizeof(char))  ||
        (sizeof(int32_t) == sizeof(short))) {
        return PyInt_FromLong((long)val);
    } else if ((sizeof(int32_t) == sizeof(int)) ||
               (sizeof(int32_t) == sizeof(long))) {
        if (is_unsigned)
            return PyLong_FromUnsignedLong((unsigned long)val);
        else
            return PyInt_FromLong((long)val);
    } else if (sizeof(int32_t) == sizeof(PY_LONG_LONG)) {
        if (is_unsigned)
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val);
        else
            return PyLong_FromLongLong((PY_LONG_LONG)val);
    } else {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        return _PyLong_FromByteArray(bytes, sizeof(int32_t), 
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
    const unsigned char neg_one = (unsigned char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned char" :
                    "value too large to convert to unsigned char");
            }
            return (unsigned char)-1;
        }
        return (unsigned char)val;
    }
    return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
    const unsigned short neg_one = (unsigned short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned short" :
                    "value too large to convert to unsigned short");
            }
            return (unsigned short)-1;
        }
        return (unsigned short)val;
    }
    return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
    const unsigned int neg_one = (unsigned int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned int" :
                    "value too large to convert to unsigned int");
            }
            return (unsigned int)-1;
        }
        return (unsigned int)val;
    }
    return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
    const char neg_one = (char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to char" :
                    "value too large to convert to char");
            }
            return (char)-1;
        }
        return (char)val;
    }
    return (char)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
    const short neg_one = (short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to short" :
                    "value too large to convert to short");
            }
            return (short)-1;
        }
        return (short)val;
    }
    return (short)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
    const int neg_one = (int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to int" :
                    "value too large to convert to int");
            }
            return (int)-1;
        }
        return (int)val;
    }
    return (int)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
    const signed char neg_one = (signed char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed char" :
                    "value too large to convert to signed char");
            }
            return (signed char)-1;
        }
        return (signed char)val;
    }
    return (signed char)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
    const signed short neg_one = (signed short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed short" :
                    "value too large to convert to signed short");
            }
            return (signed short)-1;
        }
        return (signed short)val;
    }
    return (signed short)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
    const signed int neg_one = (signed int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed int" :
                    "value too large to convert to signed int");
            }
            return (signed int)-1;
        }
        return (signed int)val;
    }
    return (signed int)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) {
    const int neg_one = (int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to int" :
                    "value too large to convert to int");
            }
            return (int)-1;
        }
        return (int)val;
    }
    return (int)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
    const unsigned long neg_one = (unsigned long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to unsigned long");
            return (unsigned long)-1;
        }
        return (unsigned long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to unsigned long");
                return (unsigned long)-1;
            }
            return PyLong_AsUnsignedLong(x);
        } else {
            return PyLong_AsLong(x);
        }
    } else {
        unsigned long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (unsigned long)-1;
        val = __Pyx_PyInt_AsUnsignedLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
    const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to unsigned PY_LONG_LONG");
            return (unsigned PY_LONG_LONG)-1;
        }
        return (unsigned PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to unsigned PY_LONG_LONG");
                return (unsigned PY_LONG_LONG)-1;
            }
            return PyLong_AsUnsignedLongLong(x);
        } else {
            return PyLong_AsLongLong(x);
        }
    } else {
        unsigned PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (unsigned PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsUnsignedLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
    const long neg_one = (long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to long");
            return (long)-1;
        }
        return (long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to long");
                return (long)-1;
            }
            return PyLong_AsUnsignedLong(x);
        } else {
            return PyLong_AsLong(x);
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (long)-1;
        val = __Pyx_PyInt_AsLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
    const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to PY_LONG_LONG");
            return (PY_LONG_LONG)-1;
        }
        return (PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to PY_LONG_LONG");
                return (PY_LONG_LONG)-1;
            }
            return PyLong_AsUnsignedLongLong(x);
        } else {
            return PyLong_AsLongLong(x);
        }
    } else {
        PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
    const signed long neg_one = (signed long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to signed long");
            return (signed long)-1;
        }
        return (signed long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to signed long");
                return (signed long)-1;
            }
            return PyLong_AsUnsignedLong(x);
        } else {
            return PyLong_AsLong(x);
        }
    } else {
        signed long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (signed long)-1;
        val = __Pyx_PyInt_AsSignedLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
    const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to signed PY_LONG_LONG");
            return (signed PY_LONG_LONG)-1;
        }
        return (signed PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to signed PY_LONG_LONG");
                return (signed PY_LONG_LONG)-1;
            }
            return PyLong_AsUnsignedLongLong(x);
        } else {
            return PyLong_AsLongLong(x);
        }
    } else {
        signed PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (signed PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsSignedLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static void __Pyx_WriteUnraisable(const char *name) {
    PyObject *old_exc, *old_val, *old_tb;
    PyObject *ctx;
    __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
    #if PY_MAJOR_VERSION < 3
    ctx = PyString_FromString(name);
    #else
    ctx = PyUnicode_FromString(name);
    #endif
    __Pyx_ErrRestore(old_exc, old_val, old_tb);
    if (!ctx) {
        PyErr_WriteUnraisable(Py_None);
    } else {
        PyErr_WriteUnraisable(ctx);
        Py_DECREF(ctx);
    }
}

static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) {
    PyObject *d = 0;
    PyObject *cobj = 0;
    union {
        void (*fp)(void);
        void *p;
    } tmp;

    d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__");
    if (!d) {
        PyErr_Clear();
        d = PyDict_New();
        if (!d)
            goto bad;
        Py_INCREF(d);
        if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0)
            goto bad;
    }
    tmp.fp = f;
#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0)
    cobj = PyCapsule_New(tmp.p, sig, 0);
#else
    cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0);
#endif
    if (!cobj)
        goto bad;
    if (PyDict_SetItemString(d, name, cobj) < 0)
        goto bad;
    Py_DECREF(cobj);
    Py_DECREF(d);
    return 0;
bad:
    Py_XDECREF(cobj);
    Py_XDECREF(d);
    return -1;
}

static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0)
    PyObject *ob = PyCapsule_New(vtable, 0, 0);
#else
    PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
#endif
    if (!ob)
        goto bad;
    if (PyDict_SetItemString(dict, "__pyx_vtable__", ob) < 0)
        goto bad;
    Py_DECREF(ob);
    return 0;
bad:
    Py_XDECREF(ob);
    return -1;
}

#ifndef __PYX_HAVE_RT_ImportType
#define __PYX_HAVE_RT_ImportType
static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
    long size, int strict)
{
    PyObject *py_module = 0;
    PyObject *result = 0;
    PyObject *py_name = 0;
    char warning[200];

    py_module = __Pyx_ImportModule(module_name);
    if (!py_module)
        goto bad;
    #if PY_MAJOR_VERSION < 3
    py_name = PyString_FromString(class_name);
    #else
    py_name = PyUnicode_FromString(class_name);
    #endif
    if (!py_name)
        goto bad;
    result = PyObject_GetAttr(py_module, py_name);
    Py_DECREF(py_name);
    py_name = 0;
    Py_DECREF(py_module);
    py_module = 0;
    if (!result)
        goto bad;
    if (!PyType_Check(result)) {
        PyErr_Format(PyExc_TypeError,
            "%s.%s is not a type object",
            module_name, class_name);
        goto bad;
    }
    if (!strict && ((PyTypeObject *)result)->tp_basicsize > size) {
        PyOS_snprintf(warning, sizeof(warning),
            "%s.%s size changed, may indicate binary incompatibility",
            module_name, class_name);
        #if PY_VERSION_HEX < 0x02050000
        PyErr_Warn(NULL, warning);
        #else
        PyErr_WarnEx(NULL, warning, 0);
        #endif
    }
    else if (((PyTypeObject *)result)->tp_basicsize != size) {
        PyErr_Format(PyExc_ValueError,
            "%s.%s has the wrong size, try recompiling",
            module_name, class_name);
        goto bad;
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(py_module);
    Py_XDECREF(result);
    return 0;
}
#endif

#ifndef __PYX_HAVE_RT_ImportModule
#define __PYX_HAVE_RT_ImportModule
static PyObject *__Pyx_ImportModule(const char *name) {
    PyObject *py_name = 0;
    PyObject *py_module = 0;

    #if PY_MAJOR_VERSION < 3
    py_name = PyString_FromString(name);
    #else
    py_name = PyUnicode_FromString(name);
    #endif
    if (!py_name)
        goto bad;
    py_module = PyImport_Import(py_name);
    Py_DECREF(py_name);
    return py_module;
bad:
    Py_XDECREF(py_name);
    return 0;
}
#endif

#include "compile.h"
#include "frameobject.h"
#include "traceback.h"

static void __Pyx_AddTraceback(const char *funcname) {
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    PyObject *py_globals = 0;
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;

    #if PY_MAJOR_VERSION < 3
    py_srcfile = PyString_FromString(__pyx_filename);
    #else
    py_srcfile = PyUnicode_FromString(__pyx_filename);
    #endif
    if (!py_srcfile) goto bad;
    if (__pyx_clineno) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno);
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno);
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        #else
        py_funcname = PyUnicode_FromString(funcname);
        #endif
    }
    if (!py_funcname) goto bad;
    py_globals = PyModule_GetDict(__pyx_m);
    if (!py_globals) goto bad;
    py_code = PyCode_New(
        0,            /*int argcount,*/
        #if PY_MAJOR_VERSION >= 3
        0,            /*int kwonlyargcount,*/
        #endif
        0,            /*int nlocals,*/
        0,            /*int stacksize,*/
        0,            /*int flags,*/
        __pyx_empty_bytes, /*PyObject *code,*/
        __pyx_empty_tuple,  /*PyObject *consts,*/
        __pyx_empty_tuple,  /*PyObject *names,*/
        __pyx_empty_tuple,  /*PyObject *varnames,*/
        __pyx_empty_tuple,  /*PyObject *freevars,*/
        __pyx_empty_tuple,  /*PyObject *cellvars,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        __pyx_lineno,   /*int firstlineno,*/
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    if (!py_code) goto bad;
    py_frame = PyFrame_New(
        PyThreadState_GET(), /*PyThreadState *tstate,*/
        py_code,             /*PyCodeObject *code,*/
        py_globals,          /*PyObject *globals,*/
        0                    /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    py_frame->f_lineno = __pyx_lineno;
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION < 3
        if (t->is_unicode) {
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
        } else if (t->intern) {
            *t->p = PyString_InternFromString(t->s);
        } else {
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        }
        #else  /* Python 3+ has unicode identifiers */
        if (t->is_unicode | t->is_str) {
            if (t->intern) {
                *t->p = PyUnicode_InternFromString(t->s);
            } else if (t->encoding) {
                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
            } else {
                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
            }
        } else {
            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
        }
        #endif
        if (!*t->p)
            return -1;
        ++t;
    }
    return 0;
}

/* Type Conversion Functions */

static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}

static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
  PyNumberMethods *m;
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_VERSION_HEX < 0x03000000
  if (PyInt_Check(x) || PyLong_Check(x))
#else
  if (PyLong_Check(x))
#endif
    return Py_INCREF(x), x;
  m = Py_TYPE(x)->tp_as_number;
#if PY_VERSION_HEX < 0x03000000
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = PyNumber_Long(x);
  }
#else
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Long(x);
  }
#endif
  if (res) {
#if PY_VERSION_HEX < 0x03000000
    if (!PyInt_Check(res) && !PyLong_Check(res)) {
#else
    if (!PyLong_Check(res)) {
#endif
      PyErr_Format(PyExc_TypeError,
                   "__%s__ returned non-%s (type %.200s)",
                   name, name, Py_TYPE(res)->tp_name);
      Py_DECREF(res);
      return NULL;
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}

static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject* x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}

static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
#if PY_VERSION_HEX < 0x02050000
   if (ival <= LONG_MAX)
       return PyInt_FromLong((long)ival);
   else {
       unsigned char *bytes = (unsigned char *) &ival;
       int one = 1; int little = (int)*(unsigned char*)&one;
       return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
   }
#else
   return PyInt_FromSize_t(ival);
#endif
}

static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
   unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x);
   if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) {
       return (size_t)-1;
   } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) {
       PyErr_SetString(PyExc_OverflowError,
                       "value too large to convert to size_t");
       return (size_t)-1;
   }
   return (size_t)val;
}


#endif /* Py_PYTHON_H */
