/* Generated by Cython 0.10.2 on Sun Dec 14 17:23:18 2008 */

#define PY_SSIZE_T_CLEAN
#include "Python.h"
#include "structmember.h"
#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif
#if PY_VERSION_HEX < 0x02040000
  #define METH_COEXIST 0
#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 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)
#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_LOCK 0x0002
  #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 PyString_Type                PyBytes_Type
  #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
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
#else
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
  #define PyBytes_Type                 PyString_Type
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyMethod_New(func, self, klass) PyInstanceMethod_New(func)
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
#else
  #define _USE_MATH_DEFINES
#endif
#ifdef __cplusplus
#define __PYX_EXTERN_C extern "C"
#else
#define __PYX_EXTERN_C extern
#endif
#include <math.h>
#define __PYX_HAVE_API__scikits__audiolab__pysndfile___sndfile
#include "stdlib.h"
#include "numpy/arrayobject.h"
#include "sndfile.h"


#ifdef __GNUC__
#define INLINE __inline__
#elif _WIN32
#define INLINE __inline
#else
#define INLINE 
#endif

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



static int __pyx_skip_dispatch = 0;


/* Type Conversion Predeclarations */

#if PY_MAJOR_VERSION < 3
#define __Pyx_PyBytes_FromString PyString_FromString
#define __Pyx_PyBytes_AsString   PyString_AsString
#else
#define __Pyx_PyBytes_FromString PyBytes_FromString
#define __Pyx_PyBytes_AsString   PyBytes_AsString
#endif

#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
static INLINE int __Pyx_PyObject_IsTrue(PyObject* x);
static INLINE PY_LONG_LONG __pyx_PyInt_AsLongLong(PyObject* x);
static INLINE unsigned PY_LONG_LONG __pyx_PyInt_AsUnsignedLongLong(PyObject* x);
static INLINE Py_ssize_t __pyx_PyIndex_AsSsize_t(PyObject* b);

#define __pyx_PyInt_AsLong(x) (PyInt_CheckExact(x) ? PyInt_AS_LONG(x) : PyInt_AsLong(x))
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))

static INLINE unsigned char __pyx_PyInt_unsigned_char(PyObject* x);
static INLINE unsigned short __pyx_PyInt_unsigned_short(PyObject* x);
static INLINE char __pyx_PyInt_char(PyObject* x);
static INLINE short __pyx_PyInt_short(PyObject* x);
static INLINE int __pyx_PyInt_int(PyObject* x);
static INLINE long __pyx_PyInt_long(PyObject* x);
static INLINE signed char __pyx_PyInt_signed_char(PyObject* x);
static INLINE signed short __pyx_PyInt_signed_short(PyObject* x);
static INLINE signed int __pyx_PyInt_signed_int(PyObject* x);
static INLINE signed long __pyx_PyInt_signed_long(PyObject* x);
static INLINE long double __pyx_PyInt_long_double(PyObject* 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 int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm= __FILE__;
static const char *__pyx_filename;
static const char **__pyx_f;

static INLINE PyObject *__Pyx_GetItemInt(PyObject *o, Py_ssize_t i, int is_unsigned) {
    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) || !is_unsigned))
        r = PySequence_GetItem(o, i);
    else {
        PyObject *j = (likely(i >= 0) || !is_unsigned) ? PyInt_FromLong(i) : PyLong_FromUnsignedLongLong((sizeof(unsigned long long) > sizeof(Py_ssize_t) ? (1ULL << (sizeof(Py_ssize_t)*8)) : 0) + i);
        if (!j)
            return 0;
        r = PyObject_GetItem(o, j);
        Py_DECREF(j);
    }
    return r;
}

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

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 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_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
static INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info);
static INLINE void __Pyx_ZeroBuffer(Py_buffer* buf); /*proto*/
static INLINE const char* __Pyx_ConsumeWhitespace(const char* ts); /*proto*/
static void __Pyx_BufferNdimError(Py_buffer* buffer, int expected_ndim); /*proto*/
static const char* __Pyx_DescribeTokenInFormatString(const char* ts); /*proto*/
static const char* __Pyx_CheckTypestring_nn___pyx_t_5numpy_float64_t(const char* ts); /*proto*/

static int __Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t(PyObject* obj, Py_buffer* buf, int flags, int nd, int cast); /*proto*/

static void __Pyx_RaiseBufferFallbackError(void); /*proto*/

static INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
static INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
static const char* __Pyx_CheckTypestring_nn___pyx_t_5numpy_float32_t(const char* ts); /*proto*/

static int __Pyx_GetBuffer_nn___pyx_t_5numpy_float32_t(PyObject* obj, Py_buffer* buf, int flags, int nd, int cast); /*proto*/
static const char* __Pyx_CheckTypestring_nn___pyx_t_5numpy_int32_t(const char* ts); /*proto*/

static int __Pyx_GetBuffer_nn___pyx_t_5numpy_int32_t(PyObject* obj, Py_buffer* buf, int flags, int nd, int cast); /*proto*/
static const char* __Pyx_CheckTypestring_nn___pyx_t_5numpy_int16_t(const char* ts); /*proto*/

static int __Pyx_GetBuffer_nn___pyx_t_5numpy_int16_t(PyObject* obj, Py_buffer* buf, int flags, int nd, int cast); /*proto*/

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

static INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
#if PY_MAJOR_VERSION < 3
static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
static void __Pyx_ReleaseBuffer(Py_buffer *view);
#else
#define __Pyx_GetBuffer PyObject_GetBuffer
#define __Pyx_ReleaseBuffer PyBuffer_Release
#endif

Py_ssize_t __Pyx_zeros[] = {0, 0};
Py_ssize_t __Pyx_minusones[] = {-1, -1};

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

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

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

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

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

static 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 = PyObject_GetAttrString(L, "append");
        if (!m) return NULL;
        r = PyObject_CallFunctionObjArgs(m, x, NULL);
        Py_DECREF(m);
        return r;
    }
}

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

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

static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, long size);  /*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*/

/* Type declarations */

typedef npy_int8 __pyx_t_5numpy_int8_t;

typedef npy_int16 __pyx_t_5numpy_int16_t;

typedef npy_int32 __pyx_t_5numpy_int32_t;

typedef npy_int64 __pyx_t_5numpy_int64_t;

typedef npy_uint8 __pyx_t_5numpy_uint8_t;

typedef npy_uint16 __pyx_t_5numpy_uint16_t;

typedef npy_uint32 __pyx_t_5numpy_uint32_t;

typedef npy_uint64 __pyx_t_5numpy_uint64_t;

typedef npy_float32 __pyx_t_5numpy_float32_t;

typedef npy_float64 __pyx_t_5numpy_float64_t;

typedef npy_long __pyx_t_5numpy_int_t;

typedef npy_longlong __pyx_t_5numpy_long_t;

typedef npy_ulong __pyx_t_5numpy_uint_t;

typedef npy_ulonglong __pyx_t_5numpy_ulong_t;

typedef npy_double __pyx_t_5numpy_float_t;

typedef npy_double __pyx_t_5numpy_double_t;

typedef npy_longdouble __pyx_t_5numpy_longdouble_t;

typedef npy_cfloat __pyx_t_5numpy_cfloat_t;

typedef npy_cdouble __pyx_t_5numpy_cdouble_t;

typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;

/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":384
 *     return majors
 * 
 * cdef class Sndfile:             # <<<<<<<<<<<<<<
 *     """\
 *     Sndfile is the core class to read/write audio files. Once an instance is
 */

struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile {
  PyObject_HEAD
  struct __pyx_vtabstruct_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *__pyx_vtab;
  SNDFILE *hdl;
  PyObject *filename;
  int fd;
  struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *_format;
  int _mode;
  SF_INFO _sfinfo;
};

/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":130
 *     return int(major), int(minor), int(micro), prerelease
 * 
 * cdef class Format:             # <<<<<<<<<<<<<<
 *     """\
 *     This class represents an audio file format. It knows about audio file
 */

struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format {
  PyObject_HEAD
  struct __pyx_vtabstruct_7scikits_8audiolab_9pysndfile_8_sndfile_Format *__pyx_vtab;
  SF_INFO _sf_info;
  int _format_raw_int;
  PyObject *_type;
  PyObject *_encoding;
  PyObject *_endianness;
  PyObject *_format_str;
  PyObject *_encoding_str;
  PyObject *_endian_str;
};


struct __pyx_vtabstruct_7scikits_8audiolab_9pysndfile_8_sndfile_Format {
  int (*format_int)(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *);
  int (*file_format_int)(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *);
  int (*encoding_int)(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *);
  int (*endianness_int)(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *);
  int (*_is_equal)(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *, struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *);
};
static struct __pyx_vtabstruct_7scikits_8audiolab_9pysndfile_8_sndfile_Format *__pyx_vtabptr_7scikits_8audiolab_9pysndfile_8_sndfile_Format;


/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":384
 *     return majors
 * 
 * cdef class Sndfile:             # <<<<<<<<<<<<<<
 *     """\
 *     Sndfile is the core class to read/write audio files. Once an instance is
 */

struct __pyx_vtabstruct_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile {
  PyObject *(*_close)(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *);
  sf_count_t (*_get_nframes)(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *);
  PyObject *(*read_frames_double)(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *, sf_count_t);
  PyObject *(*read_frames_float)(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *, sf_count_t);
  PyObject *(*read_frames_int)(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *, sf_count_t);
  PyObject *(*read_frames_short)(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *, sf_count_t);
  sf_count_t (*write_frames_double)(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *, PyArrayObject *, sf_count_t);
  sf_count_t (*write_frames_float)(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *, PyArrayObject *, sf_count_t);
  sf_count_t (*write_frames_int)(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *, PyArrayObject *, sf_count_t);
  sf_count_t (*write_frames_short)(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *, PyArrayObject *, sf_count_t);
};
static struct __pyx_vtabstruct_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *__pyx_vtabptr_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile;
/* Module declarations from python_buffer */

/* Module declarations from stdlib */

/* Module declarations from numpy */

/* Module declarations from numpy */

static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
static INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *); /*proto*/
/* Module declarations from scikits.audiolab.pysndfile.sndfile */

/* Module declarations from scikits.audiolab.pysndfile._sndfile */

static PyTypeObject *__pyx_ptype_7scikits_8audiolab_9pysndfile_8_sndfile_Format = 0;
static PyTypeObject *__pyx_ptype_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile = 0;
static PyObject *__pyx_k_92;
static PyObject *__pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile__sub_formats_int(int); /*proto*/
static PyObject *__pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile__major_formats_int(void); /*proto*/
static PyObject *__pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_int_to_format(int); /*proto*/


/* Implementation of scikits.audiolab.pysndfile._sndfile */
static char __pyx_k_23[] = "File format (wav, etc...).";
static char __pyx_k_24[] = "File encoding (pcm16, etc...).";
static char __pyx_k_25[] = "File endianness (file, little, etc...).";
static char __pyx_k_26[] = "File format description: the full description from sndfile.";
static char __pyx_k_27[] = "File encoding description: the full description from sndfile.";
static char __pyx_k_28[] = "Number of frames of the file.";
static char __pyx_k_29[] = "Sampling rate (in Hz).";
static char __pyx_k_30[] = "Number of channels.";
static char __pyx_k_31[] = "Format instance attached to the Sndfile instance.";
static PyObject *__pyx_int_0x0060;
static PyObject *__pyx_int_0x170000;
static PyObject *__pyx_int_0x180000;
static PyObject *__pyx_int_0x190000;
static PyObject *__pyx_int_0x200000;
static PyObject *__pyx_int_0x210000;
static PyObject *__pyx_int_0x220000;
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static char __pyx_k___init__[] = "__init__";
static PyObject *__pyx_kp___init__;
static char __pyx_k___copy__[] = "__copy__";
static PyObject *__pyx_kp___copy__;
static char __pyx_k___deepcopy__[] = "__deepcopy__";
static PyObject *__pyx_kp___deepcopy__;
static char __pyx_k___richcmp__[] = "__richcmp__";
static PyObject *__pyx_kp___richcmp__;
static char __pyx_k___str__[] = "__str__";
static PyObject *__pyx_kp___str__;
static char __pyx_k___repr__[] = "__repr__";
static PyObject *__pyx_kp___repr__;
static char __pyx_k___dealloc__[] = "__dealloc__";
static PyObject *__pyx_kp___dealloc__;
static char __pyx_k_close[] = "close";
static PyObject *__pyx_kp_close;
static char __pyx_k_sync[] = "sync";
static PyObject *__pyx_kp_sync;
static char __pyx_k_read_frames[] = "read_frames";
static PyObject *__pyx_kp_read_frames;
static char __pyx_k_write_frames[] = "write_frames";
static PyObject *__pyx_kp_write_frames;
static char __pyx_k_seek[] = "seek";
static PyObject *__pyx_kp_seek;
static char __pyx_k_type[] = "type";
static PyObject *__pyx_kp_type;
static char __pyx_k_encoding[] = "encoding";
static PyObject *__pyx_kp_encoding;
static char __pyx_k_endianness[] = "endianness";
static PyObject *__pyx_kp_endianness;
static char __pyx_k_self[] = "self";
static PyObject *__pyx_kp_self;
static char __pyx_k_other[] = "other";
static PyObject *__pyx_kp_other;
static char __pyx_k_op[] = "op";
static PyObject *__pyx_kp_op;
static char __pyx_k_major[] = "major";
static PyObject *__pyx_kp_major;
static char __pyx_k_filename[] = "filename";
static PyObject *__pyx_kp_filename;
static char __pyx_k_mode[] = "mode";
static PyObject *__pyx_kp_mode;
static char __pyx_k_format[] = "format";
static PyObject *__pyx_kp_format;
static char __pyx_k_channels[] = "channels";
static PyObject *__pyx_kp_channels;
static char __pyx_k_samplerate[] = "samplerate";
static PyObject *__pyx_kp_samplerate;
static char __pyx_k_nframes[] = "nframes";
static PyObject *__pyx_kp_nframes;
static char __pyx_k_dtype[] = "dtype";
static PyObject *__pyx_kp_dtype;
static char __pyx_k_input[] = "input";
static PyObject *__pyx_kp_input;
static char __pyx_k_offset[] = "offset";
static PyObject *__pyx_kp_offset;
static char __pyx_k_whence[] = "whence";
static PyObject *__pyx_kp_whence;
static char __pyx_k_numpy[] = "numpy";
static PyObject *__pyx_kp_numpy;
static char __pyx_k_np[] = "np";
static PyObject *__pyx_kp_np;
static char __pyx_k_warnings[] = "warnings";
static PyObject *__pyx_kp_warnings;
static char __pyx_k_copy[] = "copy";
static PyObject *__pyx_kp_copy;
static char __pyx_k_32[] = "pcms8";
static PyObject *__pyx_kp_32;
static char __pyx_k_33[] = "pcm16";
static PyObject *__pyx_kp_33;
static char __pyx_k_34[] = "pcm24";
static PyObject *__pyx_kp_34;
static char __pyx_k_35[] = "pcm32";
static PyObject *__pyx_kp_35;
static char __pyx_k_36[] = "pcmu8";
static PyObject *__pyx_kp_36;
static char __pyx_k_37[] = "float32";
static PyObject *__pyx_kp_37;
static char __pyx_k_38[] = "float64";
static PyObject *__pyx_kp_38;
static char __pyx_k_39[] = "ulaw";
static PyObject *__pyx_kp_39;
static char __pyx_k_40[] = "alaw";
static PyObject *__pyx_kp_40;
static char __pyx_k_41[] = "ima_adpcm";
static PyObject *__pyx_kp_41;
static char __pyx_k_42[] = "ms_adpcm";
static PyObject *__pyx_kp_42;
static char __pyx_k_43[] = "gsm610";
static PyObject *__pyx_kp_43;
static char __pyx_k_44[] = "vox_adpcm";
static PyObject *__pyx_kp_44;
static char __pyx_k_45[] = "g721_32";
static PyObject *__pyx_kp_45;
static char __pyx_k_46[] = "g723_24";
static PyObject *__pyx_kp_46;
static char __pyx_k_47[] = "g723_40";
static PyObject *__pyx_kp_47;
static char __pyx_k_48[] = "dww12";
static PyObject *__pyx_kp_48;
static char __pyx_k_49[] = "dww16";
static PyObject *__pyx_kp_49;
static char __pyx_k_50[] = "dww24";
static PyObject *__pyx_kp_50;
static char __pyx_k_51[] = "dwwN";
static PyObject *__pyx_kp_51;
static char __pyx_k_52[] = "dpcm8";
static PyObject *__pyx_kp_52;
static char __pyx_k_53[] = "dpcm16";
static PyObject *__pyx_kp_53;
static char __pyx_k__SNDFILE_ENCODING[] = "_SNDFILE_ENCODING";
static PyObject *__pyx_kp__SNDFILE_ENCODING;
static char __pyx_k_54[] = "wav";
static PyObject *__pyx_kp_54;
static char __pyx_k_55[] = "aiff";
static PyObject *__pyx_kp_55;
static char __pyx_k_56[] = "au";
static PyObject *__pyx_kp_56;
static char __pyx_k_57[] = "raw";
static PyObject *__pyx_kp_57;
static char __pyx_k_58[] = "paf";
static PyObject *__pyx_kp_58;
static char __pyx_k_59[] = "svx";
static PyObject *__pyx_kp_59;
static char __pyx_k_60[] = "nist";
static PyObject *__pyx_kp_60;
static char __pyx_k_61[] = "voc";
static PyObject *__pyx_kp_61;
static char __pyx_k_62[] = "ircam";
static PyObject *__pyx_kp_62;
static char __pyx_k_63[] = "wav64";
static PyObject *__pyx_kp_63;
static char __pyx_k_64[] = "mat4";
static PyObject *__pyx_kp_64;
static char __pyx_k_65[] = "mat5";
static PyObject *__pyx_kp_65;
static char __pyx_k_66[] = "pvf";
static PyObject *__pyx_kp_66;
static char __pyx_k_67[] = "xi";
static PyObject *__pyx_kp_67;
static char __pyx_k_68[] = "htk";
static PyObject *__pyx_kp_68;
static char __pyx_k_69[] = "sds";
static PyObject *__pyx_kp_69;
static char __pyx_k_70[] = "avr";
static PyObject *__pyx_kp_70;
static char __pyx_k_71[] = "wavex";
static PyObject *__pyx_kp_71;
static char __pyx_k_72[] = "sd2";
static PyObject *__pyx_kp_72;
static char __pyx_k_73[] = "_SNDFILE_FILE_FORMAT";
static PyObject *__pyx_kp_73;
static char __pyx_k_74[] = "vorbis";
static PyObject *__pyx_kp_74;
static char __pyx_k_75[] = "flac";
static PyObject *__pyx_kp_75;
static char __pyx_k_76[] = "caf";
static PyObject *__pyx_kp_76;
static char __pyx_k_77[] = "wve";
static PyObject *__pyx_kp_77;
static char __pyx_k_78[] = "ogg";
static PyObject *__pyx_kp_78;
static char __pyx_k_79[] = "mpc2k";
static PyObject *__pyx_kp_79;
static char __pyx_k_80[] = "rf64";
static PyObject *__pyx_kp_80;
static char __pyx_k_81[] = "file";
static PyObject *__pyx_kp_81;
static char __pyx_k_82[] = "little";
static PyObject *__pyx_kp_82;
static char __pyx_k_83[] = "big";
static PyObject *__pyx_kp_83;
static char __pyx_k_84[] = "cpu";
static PyObject *__pyx_kp_84;
static char __pyx_k__SNDFILE_ENDIAN[] = "_SNDFILE_ENDIAN";
static PyObject *__pyx_kp__SNDFILE_ENDIAN;
static char __pyx_k_85[] = "_ENUM_TO_STR_ENCODING";
static PyObject *__pyx_kp_85;
static char __pyx_k_j[] = "j";
static PyObject *__pyx_kp_j;
static char __pyx_k_i[] = "i";
static PyObject *__pyx_kp_i;
static char __pyx_k_items[] = "items";
static PyObject *__pyx_kp_items;
static char __pyx_k_86[] = "_ENUM_TO_STR_FILE_FORMAT";
static PyObject *__pyx_kp_86;
static char __pyx_k__ENUM_TO_STR_ENDIAN[] = "_ENUM_TO_STR_ENDIAN";
static PyObject *__pyx_kp__ENUM_TO_STR_ENDIAN;
static char __pyx_k_87[] = "wav";
static PyObject *__pyx_kp_87;
static char __pyx_k_88[] = "pcm16";
static PyObject *__pyx_kp_88;
static char __pyx_k_89[] = "file";
static PyObject *__pyx_kp_89;
static char __pyx_k_90[] = "r";
static PyObject *__pyx_kp_90;
static char __pyx_k_91[] = "float64";
static PyObject *__pyx_kp_91;
static char __pyx_k_93[] = "rw";
static PyObject *__pyx_kp_93;
static char __pyx_k_RuntimeError[] = "RuntimeError";
static PyObject *__pyx_kp_RuntimeError;
static char __pyx_k_split[] = "split";
static PyObject *__pyx_kp_split;
static char __pyx_k_ValueError[] = "ValueError";
static PyObject *__pyx_kp_ValueError;
static char __pyx_k_97[] = "pre";
static PyObject *__pyx_kp_97;
static char __pyx_k_KeyError[] = "KeyError";
static PyObject *__pyx_kp_KeyError;
static char __pyx_k___class__[] = "__class__";
static PyObject *__pyx_kp___class__;
static char __pyx_k_NotImplementedError[] = "NotImplementedError";
static PyObject *__pyx_kp_NotImplementedError;
static char __pyx_k_TypeError[] = "TypeError";
static PyObject *__pyx_kp_TypeError;
static char __pyx_k_join[] = "join";
static PyObject *__pyx_kp_join;
static char __pyx_k_has_key[] = "has_key";
static PyObject *__pyx_kp_has_key;
static char __pyx_k_warn[] = "warn";
static PyObject *__pyx_kp_warn;
static char __pyx_k_append[] = "append";
static PyObject *__pyx_kp_append;
static char __pyx_k_115[] = "r";
static PyObject *__pyx_kp_115;
static char __pyx_k_116[] = "w";
static PyObject *__pyx_kp_116;
static char __pyx_k_118[] = "rw";
static PyObject *__pyx_kp_118;
static char __pyx_k_121[] = "r";
static PyObject *__pyx_kp_121;
static char __pyx_k_IOError[] = "IOError";
static PyObject *__pyx_kp_IOError;
static char __pyx_k_129[] = "r";
static PyObject *__pyx_kp_129;
static char __pyx_k_file_format[] = "file_format";
static PyObject *__pyx_kp_file_format;
static char __pyx_k_144[] = "float32";
static PyObject *__pyx_kp_144;
static char __pyx_k_145[] = "int32";
static PyObject *__pyx_kp_145;
static char __pyx_k_146[] = "int16";
static PyObject *__pyx_kp_146;
static char __pyx_k_shape[] = "shape";
static PyObject *__pyx_kp_shape;
static char __pyx_k_empty[] = "empty";
static PyObject *__pyx_kp_empty;
static char __pyx_k_order[] = "order";
static PyObject *__pyx_kp_order;
static char __pyx_k_148[] = "C";
static PyObject *__pyx_kp_148;
static char __pyx_k_150[] = "F";
static PyObject *__pyx_kp_150;
static char __pyx_k_int[] = "int";
static PyObject *__pyx_kp_int;
static char __pyx_k_152[] = "F";
static PyObject *__pyx_kp_152;
static char __pyx_k_short[] = "short";
static PyObject *__pyx_kp_short;
static char __pyx_k_154[] = "F";
static PyObject *__pyx_kp_154;
static char __pyx_k_size[] = "size";
static PyObject *__pyx_kp_size;
static char __pyx_k_require[] = "require";
static PyObject *__pyx_kp_require;
static char __pyx_k_requirements[] = "requirements";
static PyObject *__pyx_kp_requirements;
static char __pyx_k_158[] = "C";
static PyObject *__pyx_kp_158;
static char __pyx_k_Exception[] = "Exception";
static PyObject *__pyx_kp_Exception;
static char __pyx_k_161[] = "rw";
static PyObject *__pyx_kp_161;
static char __pyx_k_162[] = "r";
static PyObject *__pyx_kp_162;
static char __pyx_k_163[] = "w";
static PyObject *__pyx_kp_163;
static PyObject *__pyx_builtin_RuntimeError;
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_KeyError;
static PyObject *__pyx_builtin_NotImplementedError;
static PyObject *__pyx_builtin_TypeError;
static PyObject *__pyx_builtin_IOError;
static PyObject *__pyx_builtin_Exception;
static PyObject *__pyx_kp_94;
static PyObject *__pyx_kp_95;
static PyObject *__pyx_kp_96;
static char __pyx_k_94[] = "Error while getting version of libsndfile";
static char __pyx_k_95[] = "-";
static char __pyx_k_96[] = ".";
static PyObject *__pyx_kp_98;
static PyObject *__pyx_kp_99;
static PyObject *__pyx_kp_100;
static PyObject *__pyx_kp_101;
static PyObject *__pyx_kp_102;
static PyObject *__pyx_kp_103;
static PyObject *__pyx_kp_104;
static PyObject *__pyx_kp_105;
static char __pyx_k_98[] = "file format %s not recognized";
static char __pyx_k_99[] = "endianness %s not recognized";
static char __pyx_k_100[] = "encoding %s not recognized";
static char __pyx_k_101[] = "The combination (type=%s|encoding=%s|endianness=%s) you requested is not supported. You can use available_formats and available_encodings functions to query which formats and encodings are available.";
static char __pyx_k_102[] = "Could not get format string for format %d, ";
static char __pyx_k_103[] = "please report thisproblem to the maintainer";
static char __pyx_k_104[] = "Could not get format string for format %d, ";
static char __pyx_k_105[] = "please report thisproblem to the maintainer";
static PyObject *__pyx_kp_106;
static PyObject *__pyx_kp_107;
static PyObject *__pyx_kp_108;
static PyObject *__pyx_kp_109;
static char __pyx_k_106[] = "Major Format: %s";
static char __pyx_k_107[] = "Encoding Format: %s";
static char __pyx_k_108[] = "Endianness: %s";
static char __pyx_k_109[] = "\n";
static PyObject *__pyx_kp_110;
static char __pyx_k_110[] = "Format %#10x supported by libsndfile but not yet supported by audiolab";
static PyObject *__pyx_kp_111;
static PyObject *__pyx_kp_112;
static char __pyx_k_111[] = "Unknown file format %s";
static char __pyx_k_112[] = "Encoding %#10x supported by libsndfile but not yet supported by audiolab";
static PyObject *__pyx_kp_113;
static char __pyx_k_113[] = "Error while calling sf_command";
static PyObject *__pyx_kp_114;
static char __pyx_k_114[] = "Error while calling sf_command";
static PyObject *__pyx_kp_117;
static PyObject *__pyx_kp_119;
static PyObject *__pyx_kp_120;
static PyObject *__pyx_kp_122;
static PyObject *__pyx_kp_123;
static PyObject *__pyx_kp_124;
static PyObject *__pyx_kp_125;
static PyObject *__pyx_kp_126;
static PyObject *__pyx_kp_127;
static PyObject *__pyx_kp_128;
static char __pyx_k_117[] = "For write mode, you should providea format argument !";
static char __pyx_k_119[] = "For write mode, you should providea format argument !";
static char __pyx_k_120[] = "mode %s not recognized";
static char __pyx_k_122[] = "Bad value of samplerate (%d) or channels (%d)";
static char __pyx_k_123[] = "Bad format specification: check arguments.";
static char __pyx_k_124[] = "";
static char __pyx_k_125[] = "error while opening file %s\n\t-> ";
static char __pyx_k_126[] = "error while opening file descriptor %d\n\t->";
static char __pyx_k_127[] = "\n(Check that the mode argument passed to sndfile is the same than the one used\nwhen getting the file descriptor, eg do not pass 'r' to sndfile if you\npassed 'write' to the method you used to get the file descriptor. If you are on\nwin32, you are out of luck, because its implementation of POSIX open is\nbroken)";
static char __pyx_k_128[] = "error while opening %s\n\t->%s";
static PyObject *__pyx_kp_130;
static char __pyx_k_130[] = "Sorry, getting the current number offrames in write modes is not supported yet";
static PyObject *__pyx_kp_131;
static PyObject *__pyx_kp_132;
static PyObject *__pyx_kp_133;
static PyObject *__pyx_kp_134;
static PyObject *__pyx_kp_135;
static PyObject *__pyx_kp_136;
static PyObject *__pyx_kp_137;
static PyObject *__pyx_kp_138;
static PyObject *__pyx_kp_139;
static PyObject *__pyx_kp_140;
static PyObject *__pyx_kp_141;
static PyObject *__pyx_kp_142;
static char __pyx_k_131[] = "----------------------------------------";
static char __pyx_k_132[] = "File        : %d (opened by file descriptor)";
static char __pyx_k_133[] = "File        : %s";
static char __pyx_k_134[] = "Channels    : %d";
static char __pyx_k_135[] = "Sample rate : %d";
static char __pyx_k_136[] = "Frames      : %d";
static char __pyx_k_137[] = "Raw Format  : %#010x";
static char __pyx_k_138[] = "File format : %s";
static char __pyx_k_139[] = "Encoding    : %s";
static char __pyx_k_140[] = "Endianness  : %s";
static char __pyx_k_141[] = "Seekable    : %s\n";
static char __pyx_k_142[] = "\n";
static PyObject *__pyx_kp_143;
static PyObject *__pyx_kp_147;
static char __pyx_k_143[] = "number of frames has to be >= 0 (was %d)";
static char __pyx_k_147[] = "Sorry, dtype %s not supported";
static PyObject *__pyx_kp_149;
static char __pyx_k_149[] = "Asked %d frames, read %d";
static PyObject *__pyx_kp_151;
static char __pyx_k_151[] = "Asked %d frames, read %d";
static PyObject *__pyx_kp_153;
static char __pyx_k_153[] = "Asked %d frames, read %d";
static PyObject *__pyx_kp_155;
static char __pyx_k_155[] = "Asked %d frames, read %d";
static PyObject *__pyx_kp_156;
static PyObject *__pyx_kp_157;
static PyObject *__pyx_kp_159;
static PyObject *__pyx_kp_160;
static char __pyx_k_156[] = "Expect array of rank 2, got %d";
static char __pyx_k_157[] = "Expected %d channels, got %d";
static char __pyx_k_159[] = "type of input &s not understood";
static char __pyx_k_160[] = "write %d frames, expected to write %d";
static PyObject *__pyx_kp_164;
static PyObject *__pyx_kp_165;
static char __pyx_k_164[] = "mode should be one of 'r', 'w' or 'rw' only";
static char __pyx_k_165[] = "Error while seeking, libsndfile error is %s";
static PyObject *__pyx_kp_166;
static char __pyx_k_166[] = "Inconsistent format: this is a bug";
static char __pyx_k___getbuffer__[] = "__getbuffer__";
static PyObject *__pyx_kp___getbuffer__;
static char __pyx_k___releasebuffer__[] = "__releasebuffer__";
static PyObject *__pyx_kp___releasebuffer__;
static char __pyx_k_info[] = "info";
static PyObject *__pyx_kp_info;
static char __pyx_k_flags[] = "flags";
static PyObject *__pyx_kp_flags;
static char __pyx_k_itervalues[] = "itervalues";
static PyObject *__pyx_kp_itervalues;
static PyObject *__pyx_kp_1;
static PyObject *__pyx_kp_2;
static PyObject *__pyx_kp_20;
static char __pyx_k_1[] = "ndarray is not C contiguous";
static char __pyx_k_2[] = "ndarray is not Fortran contiguous";
static char __pyx_k_3[] = "b";
static char __pyx_k_4[] = "B";
static char __pyx_k_5[] = "h";
static char __pyx_k_6[] = "H";
static char __pyx_k_7[] = "i";
static char __pyx_k_8[] = "I";
static char __pyx_k_9[] = "l";
static char __pyx_k_10[] = "L";
static char __pyx_k_11[] = "q";
static char __pyx_k_12[] = "Q";
static char __pyx_k_13[] = "f";
static char __pyx_k_14[] = "d";
static char __pyx_k_15[] = "g";
static char __pyx_k_16[] = "Zf";
static char __pyx_k_17[] = "Zd";
static char __pyx_k_18[] = "Zg";
static char __pyx_k_19[] = "O";
static char __pyx_k_20[] = "unknown dtype code in numpy.pxd (%d)";
static PyObject *__pyx_kp_21;
static PyObject *__pyx_kp_22;
static char __pyx_k_21[] = "Format string allocated too short.";
static char __pyx_k_22[] = "unknown dtype code in numpy.pxd (%d)";

/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":106
 *         dict([(i, j) for j, i in _SNDFILE_ENDIAN.items()])
 * 
 * def sndfile_version():             # <<<<<<<<<<<<<<
 *     """Return version of sndfile."""
 *     cdef int st
 */

static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_sndfile_version(PyObject *__pyx_self, PyObject *unused); /*proto*/
static char __pyx_doc_7scikits_8audiolab_9pysndfile_8_sndfile_sndfile_version[] = "sndfile_version()\nReturn version of sndfile.";
static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_sndfile_version(PyObject *__pyx_self, PyObject *unused) {
  int __pyx_v_st;
  char __pyx_v_buff[128];
  PyObject *__pyx_v_ver;
  PyObject *__pyx_v_version;
  PyObject *__pyx_v_prerelease;
  PyObject *__pyx_v_major;
  PyObject *__pyx_v_minor;
  PyObject *__pyx_v_micro;
  PyObject *__pyx_v_e;
  PyObject *__pyx_v_i;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  int __pyx_2;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  PyObject *__pyx_6 = 0;
  PyObject *__pyx_7 = 0;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __pyx_self = __pyx_self;
  __pyx_v_ver = Py_None; Py_INCREF(Py_None);
  __pyx_v_version = Py_None; Py_INCREF(Py_None);
  __pyx_v_prerelease = Py_None; Py_INCREF(Py_None);
  __pyx_v_major = Py_None; Py_INCREF(Py_None);
  __pyx_v_minor = Py_None; Py_INCREF(Py_None);
  __pyx_v_micro = Py_None; Py_INCREF(Py_None);
  __pyx_v_e = Py_None; Py_INCREF(Py_None);
  __pyx_v_i = Py_None; Py_INCREF(Py_None);

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":111
 *     cdef char buff[128]
 * 
 *     st = sf_command(NULL, SFC_GET_LIB_VERSION, buff, sizeof(buff))             # <<<<<<<<<<<<<<
 *     if st < 1:
 *         raise RuntimeError("Error while getting version of libsndfile")
 */
  __pyx_v_st = sf_command(NULL, SFC_GET_LIB_VERSION, __pyx_v_buff, (sizeof(__pyx_v_buff)));

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":112
 * 
 *     st = sf_command(NULL, SFC_GET_LIB_VERSION, buff, sizeof(buff))
 *     if st < 1:             # <<<<<<<<<<<<<<
 *         raise RuntimeError("Error while getting version of libsndfile")
 * 
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = (__pyx_v_st < 1);
  if (__pyx_t_1) {
    /* __pyx_t_1 released */

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":113
 *     st = sf_command(NULL, SFC_GET_LIB_VERSION, buff, sizeof(buff))
 *     if st < 1:
 *         raise RuntimeError("Error while getting version of libsndfile")             # <<<<<<<<<<<<<<
 * 
 *     ver = PyString_FromStringAndSize(buff, stdlib.strlen(buff))
 */
    /* __pyx_t_2 allocated */
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_INCREF(__pyx_kp_94);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_94);
    /* __pyx_t_3 allocated */
    __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    /* __pyx_t_2 released */
    __Pyx_Raise(__pyx_t_3, 0, 0);
    Py_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    /* __pyx_t_3 released */
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":115
 *         raise RuntimeError("Error while getting version of libsndfile")
 * 
 *     ver = PyString_FromStringAndSize(buff, stdlib.strlen(buff))             # <<<<<<<<<<<<<<
 * 
 *     # Get major, minor and micro from version
 */
  /* __pyx_t_3 allocated */
  __pyx_t_3 = PyString_FromStringAndSize(__pyx_v_buff, strlen(__pyx_v_buff)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_v_ver);
  __pyx_v_ver = __pyx_t_3;
  __pyx_t_3 = 0;
  /* __pyx_t_3 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":119
 *     # Get major, minor and micro from version
 *     # Template: libsndfile-X.X.XpreX with preX being optional
 *     version = ver.split('-')[1]             # <<<<<<<<<<<<<<
 *     prerelease = 0
 *     major, minor, micro = [i for i in version.split('.')]
 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_ver, __pyx_kp_split); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /* __pyx_t_3 allocated */
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_INCREF(__pyx_kp_95);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_95);
  /* __pyx_t_2 allocated */
  __pyx_t_2 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  /* __pyx_t_3 released */
  __pyx_1 = __Pyx_GetItemInt(__pyx_t_2, 1, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  /* __pyx_t_2 released */
  Py_DECREF(__pyx_v_version);
  __pyx_v_version = __pyx_1;
  __pyx_1 = 0;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":120
 *     # Template: libsndfile-X.X.XpreX with preX being optional
 *     version = ver.split('-')[1]
 *     prerelease = 0             # <<<<<<<<<<<<<<
 *     major, minor, micro = [i for i in version.split('.')]
 *     try:
 */
  Py_INCREF(__pyx_int_0);
  Py_DECREF(__pyx_v_prerelease);
  __pyx_v_prerelease = __pyx_int_0;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":121
 *     version = ver.split('-')[1]
 *     prerelease = 0
 *     major, minor, micro = [i for i in version.split('.')]             # <<<<<<<<<<<<<<
 *     try:
 *         micro = int(micro)
 */
  /* __pyx_t_2 allocated */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /* __pyx_t_4 allocated */
  __pyx_1 = PyObject_GetAttr(__pyx_v_version, __pyx_kp_split); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /* __pyx_t_3 allocated */
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_INCREF(__pyx_kp_96);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_96);
  /* __pyx_t_5 allocated */
  __pyx_t_5 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  /* __pyx_t_3 released */
  /* __pyx_t_3 allocated */
  if (PyList_CheckExact(__pyx_t_5) || PyTuple_CheckExact(__pyx_t_5)) {
    __pyx_t_4 = 0; __pyx_t_3 = __pyx_t_5; Py_INCREF(__pyx_t_3);
  } else {
    __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  Py_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  /* __pyx_t_5 released */
  for (;;) {
    /* __pyx_t_5 allocated */
    if (likely(PyList_CheckExact(__pyx_t_3))) {
      if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
      __pyx_t_5 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); Py_INCREF(__pyx_t_5); __pyx_t_4++;
    } else if (likely(PyTuple_CheckExact(__pyx_t_3))) {
      if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
      __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); Py_INCREF(__pyx_t_5); __pyx_t_4++;
    } else {
      __pyx_t_5 = PyIter_Next(__pyx_t_3);
      if (!__pyx_t_5) {
        if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        break;
      }
    }
    Py_DECREF(__pyx_v_i);
    __pyx_v_i = __pyx_t_5;
    __pyx_t_5 = 0;
    /* __pyx_t_5 released */
    __pyx_2 = PyList_Append(__pyx_t_2, (PyObject*)__pyx_v_i); if (unlikely(__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  /* __pyx_t_4 released */
  Py_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  /* __pyx_t_3 released */
  if (PyTuple_CheckExact(((PyObject *)__pyx_t_2)) && PyTuple_GET_SIZE(((PyObject *)__pyx_t_2)) == 3) {
    PyObject* tuple = ((PyObject *)__pyx_t_2);
    __pyx_3 = PyTuple_GET_ITEM(tuple, 0); Py_INCREF(__pyx_3);
    __pyx_4 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(__pyx_4);
    __pyx_5 = PyTuple_GET_ITEM(tuple, 2); Py_INCREF(__pyx_5);
    Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    Py_DECREF(__pyx_v_major);
    __pyx_v_major = __pyx_3;
    __pyx_3 = 0;
    Py_DECREF(__pyx_v_minor);
    __pyx_v_minor = __pyx_4;
    __pyx_4 = 0;
    Py_DECREF(__pyx_v_micro);
    __pyx_v_micro = __pyx_5;
    __pyx_5 = 0;
  } else {
    __pyx_1 = PyObject_GetIter(((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __pyx_3 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_4 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_5 = __Pyx_UnpackItem(__pyx_1, 2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    Py_DECREF(__pyx_v_major);
    __pyx_v_major = __pyx_3;
    __pyx_3 = 0;
    Py_DECREF(__pyx_v_minor);
    __pyx_v_minor = __pyx_4;
    __pyx_4 = 0;
    Py_DECREF(__pyx_v_micro);
    __pyx_v_micro = __pyx_5;
    __pyx_5 = 0;
  }
  /* __pyx_t_2 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":122
 *     prerelease = 0
 *     major, minor, micro = [i for i in version.split('.')]
 *     try:             # <<<<<<<<<<<<<<
 *         micro = int(micro)
 *     except ValueError,e:
 */
  {
    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);
    /*try:*/ {

      /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":123
 *     major, minor, micro = [i for i in version.split('.')]
 *     try:
 *         micro = int(micro)             # <<<<<<<<<<<<<<
 *     except ValueError,e:
 *         #print "micro is " + str(micro)
 */
      /* __pyx_t_2 allocated */
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
      Py_INCREF(__pyx_v_micro);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_micro);
      /* __pyx_t_3 allocated */
      __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)&PyInt_Type)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
      Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      /* __pyx_t_2 released */
      Py_DECREF(__pyx_v_micro);
      __pyx_v_micro = __pyx_t_3;
      __pyx_t_3 = 0;
      /* __pyx_t_3 released */
    }
    Py_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
    Py_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
    Py_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
    goto __pyx_L12_try;
    __pyx_L8_error:;
    Py_XDECREF(__pyx_1); __pyx_1 = 0;
    Py_XDECREF(__pyx_3); __pyx_3 = 0;
    Py_XDECREF(__pyx_4); __pyx_4 = 0;
    Py_XDECREF(__pyx_5); __pyx_5 = 0;

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":124
 *     try:
 *         micro = int(micro)
 *     except ValueError,e:             # <<<<<<<<<<<<<<
 *         #print "micro is " + str(micro)
 *         micro, prerelease = micro.split('pre')
 */
    __pyx_2 = PyErr_ExceptionMatches(__pyx_builtin_ValueError);
    if (__pyx_2) {
      __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.sndfile_version");
      if (__Pyx_GetException(&__pyx_1, &__pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
      Py_INCREF(__pyx_3);
      Py_DECREF(__pyx_v_e);
      __pyx_v_e = __pyx_3;

      /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":126
 *     except ValueError,e:
 *         #print "micro is " + str(micro)
 *         micro, prerelease = micro.split('pre')             # <<<<<<<<<<<<<<
 * 
 *     return int(major), int(minor), int(micro), prerelease
 */
      __pyx_5 = PyObject_GetAttr(__pyx_v_micro, __pyx_kp_split); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
      /* __pyx_t_3 allocated */
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
      Py_INCREF(__pyx_kp_97);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_97);
      /* __pyx_t_2 allocated */
      __pyx_t_2 = PyObject_Call(__pyx_5, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
      Py_DECREF(__pyx_5); __pyx_5 = 0;
      Py_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      /* __pyx_t_3 released */
      if (PyTuple_CheckExact(__pyx_t_2) && PyTuple_GET_SIZE(__pyx_t_2) == 2) {
        PyObject* tuple = __pyx_t_2;
        __pyx_6 = PyTuple_GET_ITEM(tuple, 0); Py_INCREF(__pyx_6);
        __pyx_7 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(__pyx_7);
        Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        Py_DECREF(__pyx_v_micro);
        __pyx_v_micro = __pyx_6;
        __pyx_6 = 0;
        Py_DECREF(__pyx_v_prerelease);
        __pyx_v_prerelease = __pyx_7;
        __pyx_7 = 0;
      } else {
        __pyx_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
        Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_6 = __Pyx_UnpackItem(__pyx_5, 0); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
        __pyx_7 = __Pyx_UnpackItem(__pyx_5, 1); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
        if (__Pyx_EndUnpack(__pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
        Py_DECREF(__pyx_5); __pyx_5 = 0;
        Py_DECREF(__pyx_v_micro);
        __pyx_v_micro = __pyx_6;
        __pyx_6 = 0;
        Py_DECREF(__pyx_v_prerelease);
        __pyx_v_prerelease = __pyx_7;
        __pyx_7 = 0;
      }
      /* __pyx_t_2 released */
      Py_DECREF(__pyx_1); __pyx_1 = 0;
      Py_DECREF(__pyx_3); __pyx_3 = 0;
      Py_DECREF(__pyx_4); __pyx_4 = 0;
      goto __pyx_L9_exception_handled;
    }
    __pyx_L10_except_error:;
    Py_XDECREF(__pyx_save_exc_type);
    Py_XDECREF(__pyx_save_exc_value);
    Py_XDECREF(__pyx_save_exc_tb);
    goto __pyx_L1_error;
    __pyx_L9_exception_handled:;
    __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
    __pyx_L12_try:;
  }

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":128
 *         micro, prerelease = micro.split('pre')
 * 
 *     return int(major), int(minor), int(micro), prerelease             # <<<<<<<<<<<<<<
 * 
 * cdef class Format:
 */
  /* __pyx_t_2 allocated */
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_INCREF(__pyx_v_major);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_major);
  /* __pyx_t_3 allocated */
  __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)&PyInt_Type)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  /* __pyx_t_2 released */
  /* __pyx_t_2 allocated */
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_INCREF(__pyx_v_minor);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_minor);
  /* __pyx_t_5 allocated */
  __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)&PyInt_Type)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  /* __pyx_t_2 released */
  /* __pyx_t_2 allocated */
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_INCREF(__pyx_v_micro);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_micro);
  /* __pyx_t_6 allocated */
  __pyx_t_6 = PyObject_Call(((PyObject *)((PyObject*)&PyInt_Type)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  /* __pyx_t_2 released */
  /* __pyx_t_2 allocated */
  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_6);
  Py_INCREF(__pyx_v_prerelease);
  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_prerelease);
  __pyx_t_3 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  /* __pyx_t_3 released */
  /* __pyx_t_5 released */
  /* __pyx_t_6 released */
  __pyx_r = ((PyObject *)__pyx_t_2);
  __pyx_t_2 = 0;
  /* __pyx_t_2 released */
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  Py_XDECREF(__pyx_6);
  Py_XDECREF(__pyx_7);
  Py_XDECREF(__pyx_t_2);
  Py_XDECREF(__pyx_t_3);
  Py_XDECREF(__pyx_t_5);
  Py_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.sndfile_version");
  __pyx_r = NULL;
  __pyx_L0:;
  Py_DECREF(__pyx_v_ver);
  Py_DECREF(__pyx_v_version);
  Py_DECREF(__pyx_v_prerelease);
  Py_DECREF(__pyx_v_major);
  Py_DECREF(__pyx_v_minor);
  Py_DECREF(__pyx_v_micro);
  Py_DECREF(__pyx_v_e);
  Py_DECREF(__pyx_v_i);
  return __pyx_r;
}

/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":158
 *     cdef object _type, _encoding, _endianness
 *     cdef object _format_str, _encoding_str, _endian_str
 *     def __init__(self, type = 'wav', encoding = 'pcm16', endianness = 'file'):             # <<<<<<<<<<<<<<
 *         cdef int format, ctype, cencoding, cendian, st
 *         cdef SF_FORMAT_INFO format_info
 */

static int __pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_type = 0;
  PyObject *__pyx_v_encoding = 0;
  PyObject *__pyx_v_endianness = 0;
  int __pyx_v_format;
  int __pyx_v_ctype;
  int __pyx_v_cencoding;
  int __pyx_v_cendian;
  int __pyx_v_st;
  SF_FORMAT_INFO __pyx_v_format_info;
  PyObject *__pyx_v_e;
  PyObject *__pyx_v_ret;
  PyObject *__pyx_v_msg;
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  int __pyx_3;
  PyObject *__pyx_4 = 0;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  static PyObject **__pyx_pyargnames[] = {&__pyx_kp_type,&__pyx_kp_encoding,&__pyx_kp_endianness,0};
  __pyx_v_type = __pyx_kp_87;
  __pyx_v_encoding = __pyx_kp_88;
  __pyx_v_endianness = __pyx_kp_89;
  if (unlikely(__pyx_kwds)) {
    PyObject* values[3] = {0,0,0};
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      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;
    }
    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 = 158; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    if (values[0]) {
      __pyx_v_type = values[0];
    }
    if (values[1]) {
      __pyx_v_encoding = values[1];
    }
    if (values[2]) {
      __pyx_v_endianness = values[2];
    }
  } else {
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  3: __pyx_v_endianness = PyTuple_GET_ITEM(__pyx_args, 2);
      case  2: __pyx_v_encoding = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: __pyx_v_type = 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, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.Format.__init__");
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_v_e = Py_None; Py_INCREF(Py_None);
  __pyx_v_ret = Py_None; Py_INCREF(Py_None);
  __pyx_v_msg = Py_None; Py_INCREF(Py_None);

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":163
 * 
 *         # Keep the arguments
 *         self._type = type             # <<<<<<<<<<<<<<
 *         self._encoding = encoding
 *         self._endianness = endianness
 */
  Py_INCREF(__pyx_v_type);
  Py_DECREF(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_self)->_type);
  ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_self)->_type = __pyx_v_type;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":164
 *         # Keep the arguments
 *         self._type = type
 *         self._encoding = encoding             # <<<<<<<<<<<<<<
 *         self._endianness = endianness
 * 
 */
  Py_INCREF(__pyx_v_encoding);
  Py_DECREF(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_self)->_encoding);
  ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_self)->_encoding = __pyx_v_encoding;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":165
 *         self._type = type
 *         self._encoding = encoding
 *         self._endianness = endianness             # <<<<<<<<<<<<<<
 * 
 *         # Get the internal values which corresponds to the values libsndfile
 */
  Py_INCREF(__pyx_v_endianness);
  Py_DECREF(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_self)->_endianness);
  ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_self)->_endianness = __pyx_v_endianness;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":169
 *         # Get the internal values which corresponds to the values libsndfile
 *         # can understand
 *         try:             # <<<<<<<<<<<<<<
 *             ctype = _SNDFILE_FILE_FORMAT[type]
 *         except KeyError, e:
 */
  {
    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);
    /*try:*/ {

      /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":170
 *         # can understand
 *         try:
 *             ctype = _SNDFILE_FILE_FORMAT[type]             # <<<<<<<<<<<<<<
 *         except KeyError, e:
 *             raise ValueError("file format %s not recognized" % type)
 */
      __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_73); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
      __pyx_2 = PyObject_GetItem(__pyx_1, __pyx_v_type); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
      Py_DECREF(__pyx_1); __pyx_1 = 0;
      /* __pyx_t_1 allocated */
      __pyx_t_1 = __pyx_PyInt_int(__pyx_2); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      __pyx_v_ctype = __pyx_t_1;
      /* __pyx_t_1 released */
    }
    Py_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
    Py_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
    Py_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
    goto __pyx_L10_try;
    __pyx_L6_error:;
    Py_XDECREF(__pyx_1); __pyx_1 = 0;
    Py_XDECREF(__pyx_2); __pyx_2 = 0;

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":171
 *         try:
 *             ctype = _SNDFILE_FILE_FORMAT[type]
 *         except KeyError, e:             # <<<<<<<<<<<<<<
 *             raise ValueError("file format %s not recognized" % type)
 * 
 */
    __pyx_3 = PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_3) {
      __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.__init__");
      if (__Pyx_GetException(&__pyx_1, &__pyx_2, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
      Py_INCREF(__pyx_2);
      Py_DECREF(__pyx_v_e);
      __pyx_v_e = __pyx_2;

      /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":172
 *             ctype = _SNDFILE_FILE_FORMAT[type]
 *         except KeyError, e:
 *             raise ValueError("file format %s not recognized" % type)             # <<<<<<<<<<<<<<
 * 
 *         try:
 */
      /* __pyx_t_2 allocated */
      __pyx_t_2 = PyNumber_Remainder(__pyx_kp_98, __pyx_v_type); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
      /* __pyx_t_3 allocated */
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      /* __pyx_t_2 released */
      /* __pyx_t_2 allocated */
      __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
      Py_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      /* __pyx_t_3 released */
      __Pyx_Raise(__pyx_t_2, 0, 0);
      Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      /* __pyx_t_2 released */
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
      Py_DECREF(__pyx_1); __pyx_1 = 0;
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      Py_DECREF(__pyx_4); __pyx_4 = 0;
      goto __pyx_L7_exception_handled;
    }
    __pyx_L8_except_error:;
    Py_XDECREF(__pyx_save_exc_type);
    Py_XDECREF(__pyx_save_exc_value);
    Py_XDECREF(__pyx_save_exc_tb);
    goto __pyx_L1_error;
    __pyx_L7_exception_handled:;
    __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
    __pyx_L10_try:;
  }

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":174
 *             raise ValueError("file format %s not recognized" % type)
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             cendian = _SNDFILE_ENDIAN[endianness]
 *         except KeyError, e:
 */
  {
    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);
    /*try:*/ {

      /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":175
 * 
 *         try:
 *             cendian = _SNDFILE_ENDIAN[endianness]             # <<<<<<<<<<<<<<
 *         except KeyError, e:
 *             raise ValueError("endianness %s not recognized" % endianness)
 */
      __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__SNDFILE_ENDIAN); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
      __pyx_2 = PyObject_GetItem(__pyx_1, __pyx_v_endianness); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
      Py_DECREF(__pyx_1); __pyx_1 = 0;
      /* __pyx_t_1 allocated */
      __pyx_t_1 = __pyx_PyInt_int(__pyx_2); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      __pyx_v_cendian = __pyx_t_1;
      /* __pyx_t_1 released */
    }
    Py_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
    Py_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
    Py_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
    goto __pyx_L15_try;
    __pyx_L11_error:;
    Py_XDECREF(__pyx_4); __pyx_4 = 0;
    Py_XDECREF(__pyx_1); __pyx_1 = 0;
    Py_XDECREF(__pyx_2); __pyx_2 = 0;

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":176
 *         try:
 *             cendian = _SNDFILE_ENDIAN[endianness]
 *         except KeyError, e:             # <<<<<<<<<<<<<<
 *             raise ValueError("endianness %s not recognized" % endianness)
 * 
 */
    __pyx_3 = PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_3) {
      __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.__init__");
      if (__Pyx_GetException(&__pyx_4, &__pyx_1, &__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;}
      Py_INCREF(__pyx_1);
      Py_DECREF(__pyx_v_e);
      __pyx_v_e = __pyx_1;

      /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":177
 *             cendian = _SNDFILE_ENDIAN[endianness]
 *         except KeyError, e:
 *             raise ValueError("endianness %s not recognized" % endianness)             # <<<<<<<<<<<<<<
 * 
 *         try:
 */
      /* __pyx_t_2 allocated */
      __pyx_t_2 = PyNumber_Remainder(__pyx_kp_99, __pyx_v_endianness); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;}
      /* __pyx_t_3 allocated */
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;}
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      /* __pyx_t_2 released */
      /* __pyx_t_2 allocated */
      __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;}
      Py_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      /* __pyx_t_3 released */
      __Pyx_Raise(__pyx_t_2, 0, 0);
      Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      /* __pyx_t_2 released */
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;}
      Py_DECREF(__pyx_4); __pyx_4 = 0;
      Py_DECREF(__pyx_1); __pyx_1 = 0;
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      goto __pyx_L12_exception_handled;
    }
    __pyx_L13_except_error:;
    Py_XDECREF(__pyx_save_exc_type);
    Py_XDECREF(__pyx_save_exc_value);
    Py_XDECREF(__pyx_save_exc_tb);
    goto __pyx_L1_error;
    __pyx_L12_exception_handled:;
    __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
    __pyx_L15_try:;
  }

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":179
 *             raise ValueError("endianness %s not recognized" % endianness)
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             cencoding = _SNDFILE_ENCODING[encoding]
 *         except KeyError, e:
 */
  {
    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);
    /*try:*/ {

      /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":180
 * 
 *         try:
 *             cencoding = _SNDFILE_ENCODING[encoding]             # <<<<<<<<<<<<<<
 *         except KeyError, e:
 *             raise ValueError("encoding %s not recognized" % encoding)
 */
      __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp__SNDFILE_ENCODING); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L16_error;}
      __pyx_1 = PyObject_GetItem(__pyx_4, __pyx_v_encoding); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L16_error;}
      Py_DECREF(__pyx_4); __pyx_4 = 0;
      /* __pyx_t_1 allocated */
      __pyx_t_1 = __pyx_PyInt_int(__pyx_1); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L16_error;}
      Py_DECREF(__pyx_1); __pyx_1 = 0;
      __pyx_v_cencoding = __pyx_t_1;
      /* __pyx_t_1 released */
    }
    Py_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
    Py_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
    Py_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
    goto __pyx_L20_try;
    __pyx_L16_error:;
    Py_XDECREF(__pyx_2); __pyx_2 = 0;
    Py_XDECREF(__pyx_4); __pyx_4 = 0;
    Py_XDECREF(__pyx_1); __pyx_1 = 0;

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":181
 *         try:
 *             cencoding = _SNDFILE_ENCODING[encoding]
 *         except KeyError, e:             # <<<<<<<<<<<<<<
 *             raise ValueError("encoding %s not recognized" % encoding)
 * 
 */
    __pyx_3 = PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_3) {
      __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.__init__");
      if (__Pyx_GetException(&__pyx_2, &__pyx_4, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L18_except_error;}
      Py_INCREF(__pyx_4);
      Py_DECREF(__pyx_v_e);
      __pyx_v_e = __pyx_4;

      /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":182
 *             cencoding = _SNDFILE_ENCODING[encoding]
 *         except KeyError, e:
 *             raise ValueError("encoding %s not recognized" % encoding)             # <<<<<<<<<<<<<<
 * 
 *         format = ctype | cencoding | cendian
 */
      /* __pyx_t_2 allocated */
      __pyx_t_2 = PyNumber_Remainder(__pyx_kp_100, __pyx_v_encoding); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L18_except_error;}
      /* __pyx_t_3 allocated */
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L18_except_error;}
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      /* __pyx_t_2 released */
      /* __pyx_t_2 allocated */
      __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L18_except_error;}
      Py_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      /* __pyx_t_3 released */
      __Pyx_Raise(__pyx_t_2, 0, 0);
      Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      /* __pyx_t_2 released */
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L18_except_error;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      Py_DECREF(__pyx_4); __pyx_4 = 0;
      Py_DECREF(__pyx_1); __pyx_1 = 0;
      goto __pyx_L17_exception_handled;
    }
    __pyx_L18_except_error:;
    Py_XDECREF(__pyx_save_exc_type);
    Py_XDECREF(__pyx_save_exc_value);
    Py_XDECREF(__pyx_save_exc_tb);
    goto __pyx_L1_error;
    __pyx_L17_exception_handled:;
    __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
    __pyx_L20_try:;
  }

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":184
 *             raise ValueError("encoding %s not recognized" % encoding)
 * 
 *         format = ctype | cencoding | cendian             # <<<<<<<<<<<<<<
 * 
 *         # Now, we need to test if the combination of format, encoding and
 */
  __pyx_v_format = ((__pyx_v_ctype | __pyx_v_cencoding) | __pyx_v_cendian);

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":193
 *         # checked against values different than 1 or 2, so giving a value of 1
 *         # to channel should be ok.
 *         self._sf_info.channels = 1             # <<<<<<<<<<<<<<
 *         self._sf_info.samplerate = 8000
 *         self._sf_info.format = format
 */
  ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_self)->_sf_info.channels = 1;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":194
 *         # to channel should be ok.
 *         self._sf_info.channels = 1
 *         self._sf_info.samplerate = 8000             # <<<<<<<<<<<<<<
 *         self._sf_info.format = format
 * 
 */
  ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_self)->_sf_info.samplerate = 8000;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":195
 *         self._sf_info.channels = 1
 *         self._sf_info.samplerate = 8000
 *         self._sf_info.format = format             # <<<<<<<<<<<<<<
 * 
 *         ret = sf_format_check(&self._sf_info)
 */
  ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_self)->_sf_info.format = __pyx_v_format;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":197
 *         self._sf_info.format = format
 * 
 *         ret = sf_format_check(&self._sf_info)             # <<<<<<<<<<<<<<
 *         if ret is not SF_TRUE:
 *             msg = "The combination (type=%s|encoding=%s|endianness=%s) " \
 */
  /* __pyx_t_2 allocated */
  __pyx_t_2 = PyInt_FromLong(sf_format_check((&((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_self)->_sf_info))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_v_ret);
  __pyx_v_ret = __pyx_t_2;
  __pyx_t_2 = 0;
  /* __pyx_t_2 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":198
 * 
 *         ret = sf_format_check(&self._sf_info)
 *         if ret is not SF_TRUE:             # <<<<<<<<<<<<<<
 *             msg = "The combination (type=%s|encoding=%s|endianness=%s) " \
 *                   "you requested is not supported. " \
 */
  /* __pyx_t_2 allocated */
  __pyx_t_2 = PyInt_FromLong(SF_TRUE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /* __pyx_t_4 allocated */
  __pyx_t_4 = (__pyx_v_ret != __pyx_t_2);
  Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  /* __pyx_t_2 released */
  if (__pyx_t_4) {
    /* __pyx_t_4 released */

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":199
 *         ret = sf_format_check(&self._sf_info)
 *         if ret is not SF_TRUE:
 *             msg = "The combination (type=%s|encoding=%s|endianness=%s) " \             # <<<<<<<<<<<<<<
 *                   "you requested is not supported. " \
 *                   "You can use available_formats and " \
 */
    Py_INCREF(__pyx_kp_101);
    Py_DECREF(__pyx_v_msg);
    __pyx_v_msg = __pyx_kp_101;

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":204
 *                   "available_encodings functions to query which formats "\
 *                   "and encodings are available."
 *             raise ValueError(msg % (type, encoding, endianness))             # <<<<<<<<<<<<<<
 * 
 *         # Get the sndfile string description of the format type
 */
    /* __pyx_t_2 allocated */
    __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_INCREF(__pyx_v_type);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_type);
    Py_INCREF(__pyx_v_encoding);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_encoding);
    Py_INCREF(__pyx_v_endianness);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_endianness);
    /* __pyx_t_3 allocated */
    __pyx_t_3 = PyNumber_Remainder(__pyx_v_msg, ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    /* __pyx_t_2 released */
    /* __pyx_t_2 allocated */
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
    __pyx_t_3 = 0;
    /* __pyx_t_3 released */
    /* __pyx_t_3 allocated */
    __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    /* __pyx_t_2 released */
    __Pyx_Raise(__pyx_t_3, 0, 0);
    Py_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    /* __pyx_t_3 released */
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L21;
  }
  __pyx_L21:;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":207
 * 
 *         # Get the sndfile string description of the format type
 *         format_info.format = ctype             # <<<<<<<<<<<<<<
 *         st = sf_command(NULL, SFC_GET_FORMAT_INFO, &format_info,
 *                         sizeof(format_info))
 */
  __pyx_v_format_info.format = __pyx_v_ctype;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":209
 *         format_info.format = ctype
 *         st = sf_command(NULL, SFC_GET_FORMAT_INFO, &format_info,
 *                         sizeof(format_info))             # <<<<<<<<<<<<<<
 *         if not st == 0:
 *             raise RuntimeError("Could not get format string for format "\
 */
  __pyx_v_st = sf_command(NULL, SFC_GET_FORMAT_INFO, (&__pyx_v_format_info), (sizeof(__pyx_v_format_info)));

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":210
 *         st = sf_command(NULL, SFC_GET_FORMAT_INFO, &format_info,
 *                         sizeof(format_info))
 *         if not st == 0:             # <<<<<<<<<<<<<<
 *             raise RuntimeError("Could not get format string for format "\
 *                     "%d, " % format_info.format + "please report this" \
 */
  /* __pyx_t_4 allocated */
  __pyx_t_4 = (!(__pyx_v_st == 0));
  if (__pyx_t_4) {
    /* __pyx_t_4 released */

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":212
 *         if not st == 0:
 *             raise RuntimeError("Could not get format string for format "\
 *                     "%d, " % format_info.format + "please report this" \             # <<<<<<<<<<<<<<
 *                     "problem to the maintainer")
 * 
 */
    /* __pyx_t_3 allocated */
    __pyx_t_3 = PyInt_FromLong(__pyx_v_format_info.format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    /* __pyx_t_2 allocated */
    __pyx_t_2 = PyNumber_Remainder(__pyx_kp_102, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    /* __pyx_t_3 released */
    /* __pyx_t_3 allocated */
    __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_kp_103); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    /* __pyx_t_2 released */
    /* __pyx_t_2 allocated */
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
    __pyx_t_3 = 0;
    /* __pyx_t_3 released */
    /* __pyx_t_3 allocated */
    __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    /* __pyx_t_2 released */
    __Pyx_Raise(__pyx_t_3, 0, 0);
    Py_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    /* __pyx_t_3 released */
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L22;
  }
  __pyx_L22:;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":216
 * 
 *         self._format_str = PyString_FromStringAndSize(format_info.name,
 *                                              stdlib.strlen(format_info.name))             # <<<<<<<<<<<<<<
 * 
 *         # Get the sndfile string description of the encoding type
 */
  /* __pyx_t_3 allocated */
  __pyx_t_3 = PyString_FromStringAndSize(__pyx_v_format_info.name, strlen(__pyx_v_format_info.name)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":215
 *                     "problem to the maintainer")
 * 
 *         self._format_str = PyString_FromStringAndSize(format_info.name,             # <<<<<<<<<<<<<<
 *                                              stdlib.strlen(format_info.name))
 * 
 */
  Py_DECREF(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_self)->_format_str);
  ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_self)->_format_str = __pyx_t_3;
  __pyx_t_3 = 0;
  /* __pyx_t_3 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":219
 * 
 *         # Get the sndfile string description of the encoding type
 *         format_info.format = cencoding             # <<<<<<<<<<<<<<
 *         st = sf_command(NULL, SFC_GET_FORMAT_INFO, &format_info,
 *                         sizeof(format_info))
 */
  __pyx_v_format_info.format = __pyx_v_cencoding;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":221
 *         format_info.format = cencoding
 *         st = sf_command(NULL, SFC_GET_FORMAT_INFO, &format_info,
 *                         sizeof(format_info))             # <<<<<<<<<<<<<<
 *         if not st == 0:
 *             raise RuntimeError("Could not get format string for format "\
 */
  __pyx_v_st = sf_command(NULL, SFC_GET_FORMAT_INFO, (&__pyx_v_format_info), (sizeof(__pyx_v_format_info)));

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":222
 *         st = sf_command(NULL, SFC_GET_FORMAT_INFO, &format_info,
 *                         sizeof(format_info))
 *         if not st == 0:             # <<<<<<<<<<<<<<
 *             raise RuntimeError("Could not get format string for format "\
 *                     "%d, " % format_info.format + "please report this" \
 */
  /* __pyx_t_4 allocated */
  __pyx_t_4 = (!(__pyx_v_st == 0));
  if (__pyx_t_4) {
    /* __pyx_t_4 released */

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":224
 *         if not st == 0:
 *             raise RuntimeError("Could not get format string for format "\
 *                     "%d, " % format_info.format + "please report this" \             # <<<<<<<<<<<<<<
 *                     "problem to the maintainer")
 * 
 */
    /* __pyx_t_3 allocated */
    __pyx_t_3 = PyInt_FromLong(__pyx_v_format_info.format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    /* __pyx_t_2 allocated */
    __pyx_t_2 = PyNumber_Remainder(__pyx_kp_104, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    /* __pyx_t_3 released */
    /* __pyx_t_3 allocated */
    __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_kp_105); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    /* __pyx_t_2 released */
    /* __pyx_t_2 allocated */
    __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;}
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
    __pyx_t_3 = 0;
    /* __pyx_t_3 released */
    /* __pyx_t_3 allocated */
    __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    /* __pyx_t_2 released */
    __Pyx_Raise(__pyx_t_3, 0, 0);
    Py_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    /* __pyx_t_3 released */
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L23;
  }
  __pyx_L23:;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":228
 * 
 *         self._encoding_str = PyString_FromStringAndSize(format_info.name,
 *                                              stdlib.strlen(format_info.name))             # <<<<<<<<<<<<<<
 * 
 *         self._format_raw_int = format
 */
  /* __pyx_t_3 allocated */
  __pyx_t_3 = PyString_FromStringAndSize(__pyx_v_format_info.name, strlen(__pyx_v_format_info.name)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":227
 *                     "problem to the maintainer")
 * 
 *         self._encoding_str = PyString_FromStringAndSize(format_info.name,             # <<<<<<<<<<<<<<
 *                                              stdlib.strlen(format_info.name))
 * 
 */
  Py_DECREF(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_self)->_encoding_str);
  ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_self)->_encoding_str = __pyx_t_3;
  __pyx_t_3 = 0;
  /* __pyx_t_3 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":230
 *                                              stdlib.strlen(format_info.name))
 * 
 *         self._format_raw_int = format             # <<<<<<<<<<<<<<
 * 
 *     property file_format:
 */
  ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_self)->_format_raw_int = __pyx_v_format;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_t_2);
  Py_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.Format.__init__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_e);
  Py_DECREF(__pyx_v_ret);
  Py_DECREF(__pyx_v_msg);
  return __pyx_r;
}

/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":234
 *     property file_format:
 *         """File format (wav, etc...)."""
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._type
 * 
 */

static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_11file_format___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_11file_format___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":235
 *         """File format (wav, etc...)."""
 *         def __get__(self):
 *             return self._type             # <<<<<<<<<<<<<<
 * 
 *     property encoding:
 */
  Py_INCREF(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_self)->_type);
  __pyx_r = ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_self)->_type;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  __pyx_L0:;
  return __pyx_r;
}

/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":239
 *     property encoding:
 *         """File encoding (pcm16, etc...)."""
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._encoding
 * 
 */

static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_8encoding___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_8encoding___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":240
 *         """File encoding (pcm16, etc...)."""
 *         def __get__(self):
 *             return self._encoding             # <<<<<<<<<<<<<<
 * 
 *     property endianness:
 */
  Py_INCREF(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_self)->_encoding);
  __pyx_r = ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_self)->_encoding;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  __pyx_L0:;
  return __pyx_r;
}

/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":244
 *     property endianness:
 *         """File endianness (file, little, etc...)."""
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._endianness
 * 
 */

static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_10endianness___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_10endianness___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":245
 *         """File endianness (file, little, etc...)."""
 *         def __get__(self):
 *             return self._endianness             # <<<<<<<<<<<<<<
 * 
 *     property file_format_description:
 */
  Py_INCREF(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_self)->_endianness);
  __pyx_r = ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_self)->_endianness;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  __pyx_L0:;
  return __pyx_r;
}

/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":249
 *     property file_format_description:
 *         """File format description: the full description from sndfile."""
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._format_str
 * 
 */

static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_23file_format_description___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_23file_format_description___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":250
 *         """File format description: the full description from sndfile."""
 *         def __get__(self):
 *             return self._format_str             # <<<<<<<<<<<<<<
 * 
 *     property encoding_description:
 */
  Py_INCREF(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_self)->_format_str);
  __pyx_r = ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_self)->_format_str;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  __pyx_L0:;
  return __pyx_r;
}

/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":254
 *     property encoding_description:
 *         """File encoding description: the full description from sndfile."""
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._encoding_str
 * 
 */

static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_20encoding_description___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_20encoding_description___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":255
 *         """File encoding description: the full description from sndfile."""
 *         def __get__(self):
 *             return self._encoding_str             # <<<<<<<<<<<<<<
 * 
 *     cdef int format_int(self):
 */
  Py_INCREF(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_self)->_encoding_str);
  __pyx_r = ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_self)->_encoding_str;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  __pyx_L0:;
  return __pyx_r;
}

/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":257
 *             return self._encoding_str
 * 
 *     cdef int format_int(self):             # <<<<<<<<<<<<<<
 *         """Return the full format integer (binary OR of file format, encoding
 *         and endianness)."""
 */

static  int __pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_format_int(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *__pyx_v_self) {
  int __pyx_r;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":260
 *         """Return the full format integer (binary OR of file format, encoding
 *         and endianness)."""
 *         return self._format_raw_int             # <<<<<<<<<<<<<<
 * 
 *     cdef int file_format_int(self):
 */
  __pyx_r = __pyx_v_self->_format_raw_int;
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}

/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":262
 *         return self._format_raw_int
 * 
 *     cdef int file_format_int(self):             # <<<<<<<<<<<<<<
 *         """Return the file format int."""
 *         return self._format_raw_int & SF_FORMAT_TYPEMASK
 */

static  int __pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_file_format_int(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *__pyx_v_self) {
  int __pyx_r;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":264
 *     cdef int file_format_int(self):
 *         """Return the file format int."""
 *         return self._format_raw_int & SF_FORMAT_TYPEMASK             # <<<<<<<<<<<<<<
 * 
 *     cdef int encoding_int(self):
 */
  __pyx_r = (__pyx_v_self->_format_raw_int & SF_FORMAT_TYPEMASK);
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}

/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":266
 *         return self._format_raw_int & SF_FORMAT_TYPEMASK
 * 
 *     cdef int encoding_int(self):             # <<<<<<<<<<<<<<
 *         """Return the encoding part of the format int."""
 *         return self._format_raw_int & SF_FORMAT_SUBMASK
 */

static  int __pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_encoding_int(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *__pyx_v_self) {
  int __pyx_r;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":268
 *     cdef int encoding_int(self):
 *         """Return the encoding part of the format int."""
 *         return self._format_raw_int & SF_FORMAT_SUBMASK             # <<<<<<<<<<<<<<
 * 
 *     cdef int endianness_int(self):
 */
  __pyx_r = (__pyx_v_self->_format_raw_int & SF_FORMAT_SUBMASK);
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}

/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":270
 *         return self._format_raw_int & SF_FORMAT_SUBMASK
 * 
 *     cdef int endianness_int(self):             # <<<<<<<<<<<<<<
 *         """Return the endianness part of the format int."""
 *         return self._format_raw_int & SF_FORMAT_ENDMASK
 */

static  int __pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_endianness_int(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *__pyx_v_self) {
  int __pyx_r;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":272
 *     cdef int endianness_int(self):
 *         """Return the endianness part of the format int."""
 *         return self._format_raw_int & SF_FORMAT_ENDMASK             # <<<<<<<<<<<<<<
 * 
 *     cdef int _is_equal(self, Format other):
 */
  __pyx_r = (__pyx_v_self->_format_raw_int & SF_FORMAT_ENDMASK);
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}

/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":274
 *         return self._format_raw_int & SF_FORMAT_ENDMASK
 * 
 *     cdef int _is_equal(self, Format other):             # <<<<<<<<<<<<<<
 *         return self._format_raw_int == other._format_raw_int
 * 
 */

static  int __pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_6Format__is_equal(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *__pyx_v_self, struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *__pyx_v_other) {
  int __pyx_r;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":275
 * 
 *     cdef int _is_equal(self, Format other):
 *         return self._format_raw_int == other._format_raw_int             # <<<<<<<<<<<<<<
 * 
 *     def __copy__(self):
 */
  __pyx_r = (__pyx_v_self->_format_raw_int == __pyx_v_other->_format_raw_int);
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}

/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":277
 *         return self._format_raw_int == other._format_raw_int
 * 
 *     def __copy__(self):             # <<<<<<<<<<<<<<
 *         typ, enc, endian = int_to_format(self._format_raw_int)
 *         return Format(typ, enc, endian)
 */

static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format___copy__(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_7scikits_8audiolab_9pysndfile_8_sndfile_6Format___copy__[] = "Format.__copy__(self)";
static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format___copy__(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_v_typ;
  PyObject *__pyx_v_enc;
  PyObject *__pyx_v_endian;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __pyx_v_typ = Py_None; Py_INCREF(Py_None);
  __pyx_v_enc = Py_None; Py_INCREF(Py_None);
  __pyx_v_endian = Py_None; Py_INCREF(Py_None);

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":278
 * 
 *     def __copy__(self):
 *         typ, enc, endian = int_to_format(self._format_raw_int)             # <<<<<<<<<<<<<<
 *         return Format(typ, enc, endian)
 * 
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = __pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_int_to_format(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_self)->_format_raw_int); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyTuple_CheckExact(__pyx_t_1) && PyTuple_GET_SIZE(__pyx_t_1) == 3) {
    PyObject* tuple = __pyx_t_1;
    __pyx_2 = PyTuple_GET_ITEM(tuple, 0); Py_INCREF(__pyx_2);
    __pyx_3 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(__pyx_3);
    __pyx_4 = PyTuple_GET_ITEM(tuple, 2); Py_INCREF(__pyx_4);
    Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    Py_DECREF(__pyx_v_typ);
    __pyx_v_typ = __pyx_2;
    __pyx_2 = 0;
    Py_DECREF(__pyx_v_enc);
    __pyx_v_enc = __pyx_3;
    __pyx_3 = 0;
    Py_DECREF(__pyx_v_endian);
    __pyx_v_endian = __pyx_4;
    __pyx_4 = 0;
  } else {
    __pyx_1 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_4 = __Pyx_UnpackItem(__pyx_1, 2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    Py_DECREF(__pyx_v_typ);
    __pyx_v_typ = __pyx_2;
    __pyx_2 = 0;
    Py_DECREF(__pyx_v_enc);
    __pyx_v_enc = __pyx_3;
    __pyx_3 = 0;
    Py_DECREF(__pyx_v_endian);
    __pyx_v_endian = __pyx_4;
    __pyx_4 = 0;
  }
  /* __pyx_t_1 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":279
 *     def __copy__(self):
 *         typ, enc, endian = int_to_format(self._format_raw_int)
 *         return Format(typ, enc, endian)             # <<<<<<<<<<<<<<
 * 
 *     def __deepcopy__(self):
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_INCREF(__pyx_v_typ);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_typ);
  Py_INCREF(__pyx_v_enc);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_enc);
  Py_INCREF(__pyx_v_endian);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_endian);
  /* __pyx_t_2 allocated */
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_7scikits_8audiolab_9pysndfile_8_sndfile_Format)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  /* __pyx_t_1 released */
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  /* __pyx_t_2 released */
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_t_1);
  Py_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.Format.__copy__");
  __pyx_r = NULL;
  __pyx_L0:;
  Py_DECREF(__pyx_v_typ);
  Py_DECREF(__pyx_v_enc);
  Py_DECREF(__pyx_v_endian);
  return __pyx_r;
}

/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":281
 *         return Format(typ, enc, endian)
 * 
 *     def __deepcopy__(self):             # <<<<<<<<<<<<<<
 *         return self.__copy__()
 * 
 */

static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format___deepcopy__(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_7scikits_8audiolab_9pysndfile_8_sndfile_6Format___deepcopy__[] = "Format.__deepcopy__(self)";
static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format___deepcopy__(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_t_1 = NULL;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":282
 * 
 *     def __deepcopy__(self):
 *         return self.__copy__()             # <<<<<<<<<<<<<<
 * 
 *     def __richcmp__(self, other, int op):
 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp___copy__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  /* __pyx_t_1 released */
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.Format.__deepcopy__");
  __pyx_r = NULL;
  __pyx_L0:;
  return __pyx_r;
}

/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":284
 *         return self.__copy__()
 * 
 *     def __richcmp__(self, other, int op):             # <<<<<<<<<<<<<<
 *         if not other.__class__ == self.__class__:
 *             raise NotImplementedError()
 */

static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format___richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /*proto*/
static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format___richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) {
  PyObject *__pyx_v_eq;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  __pyx_v_eq = Py_None; Py_INCREF(Py_None);

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":285
 * 
 *     def __richcmp__(self, other, int op):
 *         if not other.__class__ == self.__class__:             # <<<<<<<<<<<<<<
 *             raise NotImplementedError()
 *         if Format._is_equal(self, other):
 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_other, __pyx_kp___class__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_kp___class__); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyObject_RichCompare(__pyx_1, __pyx_2, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  /* __pyx_t_2 allocated */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /* __pyx_t_1 released */
  /* __pyx_t_3 allocated */
  __pyx_t_3 = (!__pyx_t_2);
  if (__pyx_t_3) {
    /* __pyx_t_3 released */

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":286
 *     def __richcmp__(self, other, int op):
 *         if not other.__class__ == self.__class__:
 *             raise NotImplementedError()             # <<<<<<<<<<<<<<
 *         if Format._is_equal(self, other):
 *             eq = True
 */
    /* __pyx_t_1 allocated */
    __pyx_t_1 = PyObject_Call(__pyx_builtin_NotImplementedError, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_Raise(__pyx_t_1, 0, 0);
    Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    /* __pyx_t_1 released */
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":287
 *         if not other.__class__ == self.__class__:
 *             raise NotImplementedError()
 *         if Format._is_equal(self, other):             # <<<<<<<<<<<<<<
 *             eq = True
 *         else:
 */
  if (!(__Pyx_TypeTest(__pyx_v_self, __pyx_ptype_7scikits_8audiolab_9pysndfile_8_sndfile_Format))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (!(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_7scikits_8audiolab_9pysndfile_8_sndfile_Format))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /* __pyx_t_4 allocated */
  __pyx_t_4 = __pyx_vtabptr_7scikits_8audiolab_9pysndfile_8_sndfile_Format->_is_equal(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_self), ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_other));
  if (__pyx_t_4) {
    /* __pyx_t_4 released */

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":288
 *             raise NotImplementedError()
 *         if Format._is_equal(self, other):
 *             eq = True             # <<<<<<<<<<<<<<
 *         else:
 *             eq = False
 */
    /* __pyx_t_1 allocated */
    __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(__pyx_v_eq);
    __pyx_v_eq = __pyx_t_1;
    __pyx_t_1 = 0;
    /* __pyx_t_1 released */
    goto __pyx_L6;
  }
  /*else*/ {

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":290
 *             eq = True
 *         else:
 *             eq = False             # <<<<<<<<<<<<<<
 *         if op == 2:
 *             return eq
 */
    /* __pyx_t_1 allocated */
    __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(__pyx_v_eq);
    __pyx_v_eq = __pyx_t_1;
    __pyx_t_1 = 0;
    /* __pyx_t_1 released */
  }
  __pyx_L6:;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":291
 *         else:
 *             eq = False
 *         if op == 2:             # <<<<<<<<<<<<<<
 *             return eq
 *         elif op == 3:
 */
  switch (__pyx_v_op) {
    case 2:

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":292
 *             eq = False
 *         if op == 2:
 *             return eq             # <<<<<<<<<<<<<<
 *         elif op == 3:
 *             return not eq
 */
    Py_INCREF(__pyx_v_eq);
    __pyx_r = __pyx_v_eq;
    goto __pyx_L0;
    break;
    case 3:

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":294
 *             return eq
 *         elif op == 3:
 *             return not eq             # <<<<<<<<<<<<<<
 *         else:
 *             raise TypeError()
 */
    /* __pyx_t_3 allocated */
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_eq); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    /* __pyx_t_1 allocated */
    __pyx_t_1 = __Pyx_PyBool_FromLong((!__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    /* __pyx_t_1 released */
    goto __pyx_L0;
    break;
    default:

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":296
 *             return not eq
 *         else:
 *             raise TypeError()             # <<<<<<<<<<<<<<
 * 
 *     # Syntactic sugar
 */
    /* __pyx_t_1 allocated */
    __pyx_t_1 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_Raise(__pyx_t_1, 0, 0);
    Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    /* __pyx_t_1 released */
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    break;
  }

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.Format.__richcmp__");
  __pyx_r = NULL;
  __pyx_L0:;
  Py_DECREF(__pyx_v_eq);
  return __pyx_r;
}

/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":299
 * 
 *     # Syntactic sugar
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         s = ["Major Format: %s" % self._format_str]
 *         s += ["Encoding Format: %s" % self._encoding_str]
 */

static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format___str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format___str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_v_s;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __pyx_v_s = Py_None; Py_INCREF(Py_None);

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":300
 *     # Syntactic sugar
 *     def __str__(self):
 *         s = ["Major Format: %s" % self._format_str]             # <<<<<<<<<<<<<<
 *         s += ["Encoding Format: %s" % self._encoding_str]
 *         s += ["Endianness: %s" % self.endianness]
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyNumber_Remainder(__pyx_kp_106, ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_self)->_format_str); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /* __pyx_t_2 allocated */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  /* __pyx_t_1 released */
  Py_DECREF(__pyx_v_s);
  __pyx_v_s = ((PyObject *)__pyx_t_2);
  __pyx_t_2 = 0;
  /* __pyx_t_2 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":301
 *     def __str__(self):
 *         s = ["Major Format: %s" % self._format_str]
 *         s += ["Encoding Format: %s" % self._encoding_str]             # <<<<<<<<<<<<<<
 *         s += ["Endianness: %s" % self.endianness]
 *         return "\n".join(s)
 */
  /* __pyx_t_2 allocated */
  __pyx_t_2 = PyNumber_Remainder(__pyx_kp_107, ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_self)->_encoding_str); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  /* __pyx_t_2 released */
  __pyx_1 = PyNumber_InPlaceAdd(__pyx_v_s, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  /* __pyx_t_1 released */
  Py_DECREF(__pyx_v_s);
  __pyx_v_s = __pyx_1;
  __pyx_1 = 0;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":302
 *         s = ["Major Format: %s" % self._format_str]
 *         s += ["Encoding Format: %s" % self._encoding_str]
 *         s += ["Endianness: %s" % self.endianness]             # <<<<<<<<<<<<<<
 *         return "\n".join(s)
 * 
 */
  __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_endianness); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyNumber_Remainder(__pyx_kp_108, __pyx_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  /* __pyx_t_2 allocated */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  /* __pyx_t_1 released */
  __pyx_1 = PyNumber_InPlaceAdd(__pyx_v_s, ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  /* __pyx_t_2 released */
  Py_DECREF(__pyx_v_s);
  __pyx_v_s = __pyx_1;
  __pyx_1 = 0;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":303
 *         s += ["Encoding Format: %s" % self._encoding_str]
 *         s += ["Endianness: %s" % self.endianness]
 *         return "\n".join(s)             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __pyx_2 = PyObject_GetAttr(__pyx_kp_109, __pyx_kp_join); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /* __pyx_t_2 allocated */
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_INCREF(__pyx_v_s);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_s);
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  /* __pyx_t_2 released */
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  /* __pyx_t_1 released */
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_t_1);
  Py_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.Format.__str__");
  __pyx_r = NULL;
  __pyx_L0:;
  Py_DECREF(__pyx_v_s);
  return __pyx_r;
}

/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":305
 *         return "\n".join(s)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return self.__str__()
 * 
 */

static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format___repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format___repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_t_1 = NULL;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":306
 * 
 *     def __repr__(self):
 *         return self.__str__()             # <<<<<<<<<<<<<<
 * 
 * def available_file_formats():
 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp___str__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  /* __pyx_t_1 released */
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.Format.__repr__");
  __pyx_r = NULL;
  __pyx_L0:;
  return __pyx_r;
}

/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":308
 *         return self.__str__()
 * 
 * def available_file_formats():             # <<<<<<<<<<<<<<
 *     """Return lists of available file formats supported by audiolab."""
 *     ret = []
 */

static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_available_file_formats(PyObject *__pyx_self, PyObject *unused); /*proto*/
static char __pyx_doc_7scikits_8audiolab_9pysndfile_8_sndfile_available_file_formats[] = "available_file_formats()\nReturn lists of available file formats supported by audiolab.";
static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_available_file_formats(PyObject *__pyx_self, PyObject *unused) {
  PyObject *__pyx_v_ret;
  PyObject *__pyx_v_i;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  __pyx_self = __pyx_self;
  __pyx_v_ret = Py_None; Py_INCREF(Py_None);
  __pyx_v_i = Py_None; Py_INCREF(Py_None);

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":310
 * def available_file_formats():
 *     """Return lists of available file formats supported by audiolab."""
 *     ret = []             # <<<<<<<<<<<<<<
 *     for i in _major_formats_int():
 *         # Handle the case where libsndfile supports a format we don't
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_v_ret);
  __pyx_v_ret = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  /* __pyx_t_1 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":311
 *     """Return lists of available file formats supported by audiolab."""
 *     ret = []
 *     for i in _major_formats_int():             # <<<<<<<<<<<<<<
 *         # Handle the case where libsndfile supports a format we don't
 *         if not _ENUM_TO_STR_FILE_FORMAT.has_key(i & SF_FORMAT_TYPEMASK):
 */
  /* __pyx_t_2 allocated */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = __pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile__major_formats_int(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /* __pyx_t_3 allocated */
  if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = 0; __pyx_t_3 = __pyx_t_1; Py_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 = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /* __pyx_t_1 released */
  for (;;) {
    /* __pyx_t_1 allocated */
    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); Py_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); Py_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 = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        break;
      }
    }
    Py_DECREF(__pyx_v_i);
    __pyx_v_i = __pyx_t_1;
    __pyx_t_1 = 0;
    /* __pyx_t_1 released */

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":313
 *     for i in _major_formats_int():
 *         # Handle the case where libsndfile supports a format we don't
 *         if not _ENUM_TO_STR_FILE_FORMAT.has_key(i & SF_FORMAT_TYPEMASK):             # <<<<<<<<<<<<<<
 *             warnings.warn("Format %#10x supported by libsndfile but not "
 *                           "yet supported by audiolab" %
 */
    __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_86); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_has_key); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    /* __pyx_t_1 allocated */
    __pyx_t_1 = PyInt_FromLong(SF_FORMAT_TYPEMASK); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    /* __pyx_t_4 allocated */
    __pyx_t_4 = PyNumber_And(__pyx_v_i, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    /* __pyx_t_1 released */
    /* __pyx_t_1 allocated */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
    __pyx_t_4 = 0;
    /* __pyx_t_4 released */
    /* __pyx_t_4 allocated */
    __pyx_t_4 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    /* __pyx_t_1 released */
    /* __pyx_t_5 allocated */
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    /* __pyx_t_4 released */
    /* __pyx_t_6 allocated */
    __pyx_t_6 = (!__pyx_t_5);
    if (__pyx_t_6) {
      /* __pyx_t_6 released */

      /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":314
 *         # Handle the case where libsndfile supports a format we don't
 *         if not _ENUM_TO_STR_FILE_FORMAT.has_key(i & SF_FORMAT_TYPEMASK):
 *             warnings.warn("Format %#10x supported by libsndfile but not "             # <<<<<<<<<<<<<<
 *                           "yet supported by audiolab" %
 *                           (i & SF_FORMAT_TYPEMASK))
 */
      __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_warnings); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_warn); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_1); __pyx_1 = 0;

      /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":316
 *             warnings.warn("Format %#10x supported by libsndfile but not "
 *                           "yet supported by audiolab" %
 *                           (i & SF_FORMAT_TYPEMASK))             # <<<<<<<<<<<<<<
 *         else:
 *             ret.append(_ENUM_TO_STR_FILE_FORMAT[i & SF_FORMAT_TYPEMASK])
 */
      /* __pyx_t_4 allocated */
      __pyx_t_4 = PyInt_FromLong(SF_FORMAT_TYPEMASK); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      /* __pyx_t_1 allocated */
      __pyx_t_1 = PyNumber_And(__pyx_v_i, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      /* __pyx_t_4 released */
      /* __pyx_t_4 allocated */
      __pyx_t_4 = PyNumber_Remainder(__pyx_kp_110, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      /* __pyx_t_1 released */
      /* __pyx_t_1 allocated */
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      /* __pyx_t_4 released */
      /* __pyx_t_4 allocated */
      __pyx_t_4 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      Py_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      /* __pyx_t_1 released */
      Py_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      /* __pyx_t_4 released */
      goto __pyx_L7;
    }
    /*else*/ {

      /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":318
 *                           (i & SF_FORMAT_TYPEMASK))
 *         else:
 *             ret.append(_ENUM_TO_STR_FILE_FORMAT[i & SF_FORMAT_TYPEMASK])             # <<<<<<<<<<<<<<
 *     return ret
 * 
 */
      __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_86); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      /* __pyx_t_4 allocated */
      __pyx_t_4 = PyInt_FromLong(SF_FORMAT_TYPEMASK); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      /* __pyx_t_1 allocated */
      __pyx_t_1 = PyNumber_And(__pyx_v_i, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      /* __pyx_t_4 released */
      __pyx_2 = PyObject_GetItem(__pyx_1, __pyx_t_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_1); __pyx_1 = 0;
      Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      /* __pyx_t_1 released */
      /* __pyx_t_1 allocated */
      __pyx_t_1 = __Pyx_PyObject_Append(__pyx_v_ret, __pyx_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      /* __pyx_t_1 released */
    }
    __pyx_L7:;
  }
  /* __pyx_t_2 released */
  Py_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  /* __pyx_t_3 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":319
 *         else:
 *             ret.append(_ENUM_TO_STR_FILE_FORMAT[i & SF_FORMAT_TYPEMASK])
 *     return ret             # <<<<<<<<<<<<<<
 * 
 * def available_encodings(major):
 */
  Py_INCREF(__pyx_v_ret);
  __pyx_r = __pyx_v_ret;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_t_1);
  Py_XDECREF(__pyx_t_3);
  Py_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.available_file_formats");
  __pyx_r = NULL;
  __pyx_L0:;
  Py_DECREF(__pyx_v_ret);
  Py_DECREF(__pyx_v_i);
  return __pyx_r;
}

/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":321
 *     return ret
 * 
 * def available_encodings(major):             # <<<<<<<<<<<<<<
 *     """Return lists of available encoding for the given major format."""
 *     if not _SNDFILE_FILE_FORMAT.has_key(major):
 */

static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_available_encodings(PyObject *__pyx_self, PyObject *__pyx_v_major); /*proto*/
static char __pyx_doc_7scikits_8audiolab_9pysndfile_8_sndfile_available_encodings[] = "available_encodings(major)\nReturn lists of available encoding for the given major format.";
static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_available_encodings(PyObject *__pyx_self, PyObject *__pyx_v_major) {
  PyObject *__pyx_v_ret;
  PyObject *__pyx_v_i;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  __pyx_self = __pyx_self;
  __pyx_v_ret = Py_None; Py_INCREF(Py_None);
  __pyx_v_i = Py_None; Py_INCREF(Py_None);

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":323
 * def available_encodings(major):
 *     """Return lists of available encoding for the given major format."""
 *     if not _SNDFILE_FILE_FORMAT.has_key(major):             # <<<<<<<<<<<<<<
 *         raise ValueError("Unknown file format %s" % major)
 * 
 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_73); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_has_key); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_INCREF(__pyx_v_major);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_major);
  /* __pyx_t_2 allocated */
  __pyx_t_2 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  /* __pyx_t_1 released */
  /* __pyx_t_3 allocated */
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  /* __pyx_t_2 released */
  /* __pyx_t_4 allocated */
  __pyx_t_4 = (!__pyx_t_3);
  if (__pyx_t_4) {
    /* __pyx_t_4 released */

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":324
 *     """Return lists of available encoding for the given major format."""
 *     if not _SNDFILE_FILE_FORMAT.has_key(major):
 *         raise ValueError("Unknown file format %s" % major)             # <<<<<<<<<<<<<<
 * 
 *     ret = []
 */
    /* __pyx_t_2 allocated */
    __pyx_t_2 = PyNumber_Remainder(__pyx_kp_111, __pyx_v_major); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    /* __pyx_t_1 allocated */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
    __pyx_t_2 = 0;
    /* __pyx_t_2 released */
    /* __pyx_t_2 allocated */
    __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    /* __pyx_t_1 released */
    __Pyx_Raise(__pyx_t_2, 0, 0);
    Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    /* __pyx_t_2 released */
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":326
 *         raise ValueError("Unknown file format %s" % major)
 * 
 *     ret = []             # <<<<<<<<<<<<<<
 *     for i in _sub_formats_int(_SNDFILE_FILE_FORMAT[major]):
 *         # Handle the case where libsndfile supports an encoding we don't
 */
  /* __pyx_t_2 allocated */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_v_ret);
  __pyx_v_ret = ((PyObject *)__pyx_t_2);
  __pyx_t_2 = 0;
  /* __pyx_t_2 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":327
 * 
 *     ret = []
 *     for i in _sub_formats_int(_SNDFILE_FILE_FORMAT[major]):             # <<<<<<<<<<<<<<
 *         # Handle the case where libsndfile supports an encoding we don't
 *         if not _ENUM_TO_STR_ENCODING.has_key(i & SF_FORMAT_SUBMASK):
 */
  /* __pyx_t_5 allocated */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_73); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_2 = PyObject_GetItem(__pyx_1, __pyx_v_major); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  /* __pyx_t_6 allocated */
  __pyx_t_6 = __pyx_PyInt_int(__pyx_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  /* __pyx_t_2 allocated */
  __pyx_t_2 = __pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile__sub_formats_int(__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /* __pyx_t_6 released */
  /* __pyx_t_1 allocated */
  if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_5 = 0; __pyx_t_1 = __pyx_t_2; Py_INCREF(__pyx_t_1);
  } else {
    __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  /* __pyx_t_2 released */
  for (;;) {
    /* __pyx_t_2 allocated */
    if (likely(PyList_CheckExact(__pyx_t_1))) {
      if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break;
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); Py_INCREF(__pyx_t_2); __pyx_t_5++;
    } else if (likely(PyTuple_CheckExact(__pyx_t_1))) {
      if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); Py_INCREF(__pyx_t_2); __pyx_t_5++;
    } else {
      __pyx_t_2 = PyIter_Next(__pyx_t_1);
      if (!__pyx_t_2) {
        if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        break;
      }
    }
    Py_DECREF(__pyx_v_i);
    __pyx_v_i = __pyx_t_2;
    __pyx_t_2 = 0;
    /* __pyx_t_2 released */

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":329
 *     for i in _sub_formats_int(_SNDFILE_FILE_FORMAT[major]):
 *         # Handle the case where libsndfile supports an encoding we don't
 *         if not _ENUM_TO_STR_ENCODING.has_key(i & SF_FORMAT_SUBMASK):             # <<<<<<<<<<<<<<
 *             warnings.warn("Encoding %#10x supported by libsndfile but not "
 *                           "yet supported by audiolab" %
 */
    __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_85); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_has_key); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    /* __pyx_t_2 allocated */
    __pyx_t_2 = PyInt_FromLong(SF_FORMAT_SUBMASK); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    /* __pyx_t_7 allocated */
    __pyx_t_7 = PyNumber_And(__pyx_v_i, __pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    /* __pyx_t_2 released */
    /* __pyx_t_2 allocated */
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7);
    __pyx_t_7 = 0;
    /* __pyx_t_7 released */
    /* __pyx_t_7 allocated */
    __pyx_t_7 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    /* __pyx_t_2 released */
    /* __pyx_t_4 allocated */
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    /* __pyx_t_7 released */
    /* __pyx_t_8 allocated */
    __pyx_t_8 = (!__pyx_t_4);
    if (__pyx_t_8) {
      /* __pyx_t_8 released */

      /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":330
 *         # Handle the case where libsndfile supports an encoding we don't
 *         if not _ENUM_TO_STR_ENCODING.has_key(i & SF_FORMAT_SUBMASK):
 *             warnings.warn("Encoding %#10x supported by libsndfile but not "             # <<<<<<<<<<<<<<
 *                           "yet supported by audiolab" %
 *                           (i & SF_FORMAT_SUBMASK))
 */
      __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_warnings); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_warn); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_1); __pyx_1 = 0;

      /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":332
 *             warnings.warn("Encoding %#10x supported by libsndfile but not "
 *                           "yet supported by audiolab" %
 *                           (i & SF_FORMAT_SUBMASK))             # <<<<<<<<<<<<<<
 *         else:
 *             ret.append(_ENUM_TO_STR_ENCODING[i & SF_FORMAT_SUBMASK])
 */
      /* __pyx_t_7 allocated */
      __pyx_t_7 = PyInt_FromLong(SF_FORMAT_SUBMASK); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      /* __pyx_t_2 allocated */
      __pyx_t_2 = PyNumber_And(__pyx_v_i, __pyx_t_7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      /* __pyx_t_7 released */
      /* __pyx_t_7 allocated */
      __pyx_t_7 = PyNumber_Remainder(__pyx_kp_112, __pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      /* __pyx_t_2 released */
      /* __pyx_t_2 allocated */
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7);
      __pyx_t_7 = 0;
      /* __pyx_t_7 released */
      /* __pyx_t_7 allocated */
      __pyx_t_7 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      /* __pyx_t_2 released */
      Py_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      /* __pyx_t_7 released */
      goto __pyx_L8;
    }
    /*else*/ {

      /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":334
 *                           (i & SF_FORMAT_SUBMASK))
 *         else:
 *             ret.append(_ENUM_TO_STR_ENCODING[i & SF_FORMAT_SUBMASK])             # <<<<<<<<<<<<<<
 *     return ret
 * 
 */
      __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_85); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      /* __pyx_t_7 allocated */
      __pyx_t_7 = PyInt_FromLong(SF_FORMAT_SUBMASK); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      /* __pyx_t_2 allocated */
      __pyx_t_2 = PyNumber_And(__pyx_v_i, __pyx_t_7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      /* __pyx_t_7 released */
      __pyx_2 = PyObject_GetItem(__pyx_1, __pyx_t_2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_1); __pyx_1 = 0;
      Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      /* __pyx_t_2 released */
      /* __pyx_t_2 allocated */
      __pyx_t_2 = __Pyx_PyObject_Append(__pyx_v_ret, __pyx_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      /* __pyx_t_2 released */
    }
    __pyx_L8:;
  }
  /* __pyx_t_5 released */
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /* __pyx_t_1 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":335
 *         else:
 *             ret.append(_ENUM_TO_STR_ENCODING[i & SF_FORMAT_SUBMASK])
 *     return ret             # <<<<<<<<<<<<<<
 * 
 * cdef _sub_formats_int(int format):
 */
  Py_INCREF(__pyx_v_ret);
  __pyx_r = __pyx_v_ret;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_t_1);
  Py_XDECREF(__pyx_t_2);
  Py_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.available_encodings");
  __pyx_r = NULL;
  __pyx_L0:;
  Py_DECREF(__pyx_v_ret);
  Py_DECREF(__pyx_v_i);
  return __pyx_r;
}

/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":337
 *     return ret
 * 
 * cdef _sub_formats_int(int format):             # <<<<<<<<<<<<<<
 *     """Return list of subtype formats given the major format.
 * 
 */

static  PyObject *__pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile__sub_formats_int(int __pyx_v_format) {
  int __pyx_v_st;
  int __pyx_v_nsub;
  int __pyx_v_i;
  SF_FORMAT_INFO __pyx_v_info;
  SF_INFO __pyx_v_sfinfo;
  PyObject *__pyx_v_subs;
  PyObject *__pyx_r;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __pyx_v_subs = Py_None; Py_INCREF(Py_None);

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":347
 *     cdef SF_INFO sfinfo
 * 
 *     st = sf_command (NULL, SFC_GET_FORMAT_SUBTYPE_COUNT, &nsub, sizeof(int))             # <<<<<<<<<<<<<<
 *     if st:
 *         raise RuntimeError("Error while calling sf_command")
 */
  __pyx_v_st = sf_command(NULL, SFC_GET_FORMAT_SUBTYPE_COUNT, (&__pyx_v_nsub), (sizeof(int)));

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":348
 * 
 *     st = sf_command (NULL, SFC_GET_FORMAT_SUBTYPE_COUNT, &nsub, sizeof(int))
 *     if st:             # <<<<<<<<<<<<<<
 *         raise RuntimeError("Error while calling sf_command")
 * 
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = __pyx_v_st;
  if (__pyx_t_1) {
    /* __pyx_t_1 released */

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":349
 *     st = sf_command (NULL, SFC_GET_FORMAT_SUBTYPE_COUNT, &nsub, sizeof(int))
 *     if st:
 *         raise RuntimeError("Error while calling sf_command")             # <<<<<<<<<<<<<<
 * 
 *     subs = []
 */
    /* __pyx_t_2 allocated */
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_INCREF(__pyx_kp_113);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_113);
    /* __pyx_t_3 allocated */
    __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    /* __pyx_t_2 released */
    __Pyx_Raise(__pyx_t_3, 0, 0);
    Py_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    /* __pyx_t_3 released */
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":351
 *         raise RuntimeError("Error while calling sf_command")
 * 
 *     subs = []             # <<<<<<<<<<<<<<
 *     # Not used, but necessary to pass sfinfo to sf_format_check
 *     sfinfo.channels = 1
 */
  /* __pyx_t_3 allocated */
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_v_subs);
  __pyx_v_subs = ((PyObject *)__pyx_t_3);
  __pyx_t_3 = 0;
  /* __pyx_t_3 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":353
 *     subs = []
 *     # Not used, but necessary to pass sfinfo to sf_format_check
 *     sfinfo.channels = 1             # <<<<<<<<<<<<<<
 *     sfinfo.samplerate = 8000
 *     for i in range(nsub):
 */
  __pyx_v_sfinfo.channels = 1;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":354
 *     # Not used, but necessary to pass sfinfo to sf_format_check
 *     sfinfo.channels = 1
 *     sfinfo.samplerate = 8000             # <<<<<<<<<<<<<<
 *     for i in range(nsub):
 *         info.format = i
 */
  __pyx_v_sfinfo.samplerate = 8000;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":355
 *     sfinfo.channels = 1
 *     sfinfo.samplerate = 8000
 *     for i in range(nsub):             # <<<<<<<<<<<<<<
 *         info.format = i
 *         sf_command (NULL, SFC_GET_FORMAT_SUBTYPE, &info, sizeof (info))
 */
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_nsub; __pyx_v_i+=1) {

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":356
 *     sfinfo.samplerate = 8000
 *     for i in range(nsub):
 *         info.format = i             # <<<<<<<<<<<<<<
 *         sf_command (NULL, SFC_GET_FORMAT_SUBTYPE, &info, sizeof (info))
 *         format = (format & SF_FORMAT_TYPEMASK) | info.format
 */
    __pyx_v_info.format = __pyx_v_i;

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":357
 *     for i in range(nsub):
 *         info.format = i
 *         sf_command (NULL, SFC_GET_FORMAT_SUBTYPE, &info, sizeof (info))             # <<<<<<<<<<<<<<
 *         format = (format & SF_FORMAT_TYPEMASK) | info.format
 * 
 */
    sf_command(NULL, SFC_GET_FORMAT_SUBTYPE, (&__pyx_v_info), (sizeof(__pyx_v_info)));

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":358
 *         info.format = i
 *         sf_command (NULL, SFC_GET_FORMAT_SUBTYPE, &info, sizeof (info))
 *         format = (format & SF_FORMAT_TYPEMASK) | info.format             # <<<<<<<<<<<<<<
 * 
 *         sfinfo.format = format
 */
    __pyx_v_format = ((__pyx_v_format & SF_FORMAT_TYPEMASK) | __pyx_v_info.format);

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":360
 *         format = (format & SF_FORMAT_TYPEMASK) | info.format
 * 
 *         sfinfo.format = format             # <<<<<<<<<<<<<<
 *         if sf_format_check(&sfinfo):
 *             subs.append(info.format)
 */
    __pyx_v_sfinfo.format = __pyx_v_format;

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":361
 * 
 *         sfinfo.format = format
 *         if sf_format_check(&sfinfo):             # <<<<<<<<<<<<<<
 *             subs.append(info.format)
 * 
 */
    /* __pyx_t_1 allocated */
    __pyx_t_1 = sf_format_check((&__pyx_v_sfinfo));
    if (__pyx_t_1) {
      /* __pyx_t_1 released */

      /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":362
 *         sfinfo.format = format
 *         if sf_format_check(&sfinfo):
 *             subs.append(info.format)             # <<<<<<<<<<<<<<
 * 
 *     return subs
 */
      /* __pyx_t_3 allocated */
      __pyx_t_3 = PyInt_FromLong(__pyx_v_info.format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      /* __pyx_t_2 allocated */
      __pyx_t_2 = __Pyx_PyObject_Append(__pyx_v_subs, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      /* __pyx_t_3 released */
      Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      /* __pyx_t_2 released */
      goto __pyx_L6;
    }
    __pyx_L6:;
  }

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":364
 *             subs.append(info.format)
 * 
 *     return subs             # <<<<<<<<<<<<<<
 * 
 * cdef _major_formats_int():
 */
  Py_INCREF(__pyx_v_subs);
  __pyx_r = __pyx_v_subs;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  Py_XDECREF(__pyx_t_2);
  Py_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile._sub_formats_int");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_subs);
  return __pyx_r;
}

/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":366
 *     return subs
 * 
 * cdef _major_formats_int():             # <<<<<<<<<<<<<<
 *     """Return list of major format *integers*."""
 *     cdef int st, nmajor
 */

static  PyObject *__pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile__major_formats_int(void) {
  int __pyx_v_st;
  int __pyx_v_nmajor;
  int __pyx_v_i;
  SF_FORMAT_INFO __pyx_v_info;
  PyObject *__pyx_v_majors;
  PyObject *__pyx_r;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __pyx_v_majors = Py_None; Py_INCREF(Py_None);

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":372
 *     cdef SF_FORMAT_INFO info
 * 
 *     st = sf_command (NULL, SFC_GET_FORMAT_MAJOR_COUNT, &nmajor, sizeof(int))             # <<<<<<<<<<<<<<
 *     if st:
 *         raise RuntimeError("Error while calling sf_command")
 */
  __pyx_v_st = sf_command(NULL, SFC_GET_FORMAT_MAJOR_COUNT, (&__pyx_v_nmajor), (sizeof(int)));

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":373
 * 
 *     st = sf_command (NULL, SFC_GET_FORMAT_MAJOR_COUNT, &nmajor, sizeof(int))
 *     if st:             # <<<<<<<<<<<<<<
 *         raise RuntimeError("Error while calling sf_command")
 * 
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = __pyx_v_st;
  if (__pyx_t_1) {
    /* __pyx_t_1 released */

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":374
 *     st = sf_command (NULL, SFC_GET_FORMAT_MAJOR_COUNT, &nmajor, sizeof(int))
 *     if st:
 *         raise RuntimeError("Error while calling sf_command")             # <<<<<<<<<<<<<<
 * 
 *     majors = []
 */
    /* __pyx_t_2 allocated */
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_INCREF(__pyx_kp_114);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_114);
    /* __pyx_t_3 allocated */
    __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((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;}
    Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    /* __pyx_t_2 released */
    __Pyx_Raise(__pyx_t_3, 0, 0);
    Py_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    /* __pyx_t_3 released */
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":376
 *         raise RuntimeError("Error while calling sf_command")
 * 
 *     majors = []             # <<<<<<<<<<<<<<
 *     for i in range(nmajor):
 *         info.format = i
 */
  /* __pyx_t_3 allocated */
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_v_majors);
  __pyx_v_majors = ((PyObject *)__pyx_t_3);
  __pyx_t_3 = 0;
  /* __pyx_t_3 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":377
 * 
 *     majors = []
 *     for i in range(nmajor):             # <<<<<<<<<<<<<<
 *         info.format = i
 *         sf_command (NULL, SFC_GET_FORMAT_MAJOR, &info, sizeof (info))
 */
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_nmajor; __pyx_v_i+=1) {

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":378
 *     majors = []
 *     for i in range(nmajor):
 *         info.format = i             # <<<<<<<<<<<<<<
 *         sf_command (NULL, SFC_GET_FORMAT_MAJOR, &info, sizeof (info))
 *         majors.append(info.format)
 */
    __pyx_v_info.format = __pyx_v_i;

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":379
 *     for i in range(nmajor):
 *         info.format = i
 *         sf_command (NULL, SFC_GET_FORMAT_MAJOR, &info, sizeof (info))             # <<<<<<<<<<<<<<
 *         majors.append(info.format)
 * 
 */
    sf_command(NULL, SFC_GET_FORMAT_MAJOR, (&__pyx_v_info), (sizeof(__pyx_v_info)));

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":380
 *         info.format = i
 *         sf_command (NULL, SFC_GET_FORMAT_MAJOR, &info, sizeof (info))
 *         majors.append(info.format)             # <<<<<<<<<<<<<<
 * 
 *     return majors
 */
    /* __pyx_t_3 allocated */
    __pyx_t_3 = PyInt_FromLong(__pyx_v_info.format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    /* __pyx_t_2 allocated */
    __pyx_t_2 = __Pyx_PyObject_Append(__pyx_v_majors, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    /* __pyx_t_3 released */
    Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    /* __pyx_t_2 released */
  }

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":382
 *         majors.append(info.format)
 * 
 *     return majors             # <<<<<<<<<<<<<<
 * 
 * cdef class Sndfile:
 */
  Py_INCREF(__pyx_v_majors);
  __pyx_r = __pyx_v_majors;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  Py_XDECREF(__pyx_t_2);
  Py_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile._major_formats_int");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_majors);
  return __pyx_r;
}

/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":419
 *     cdef int _mode
 *     cdef SF_INFO _sfinfo
 *     def __init__(Sndfile self, filename, mode='r', Format format=None,             # <<<<<<<<<<<<<<
 *                  int channels=0, int samplerate=0):
 *         cdef int sfmode
 */

static int __pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_filename = 0;
  PyObject *__pyx_v_mode = 0;
  struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *__pyx_v_format = 0;
  int __pyx_v_channels;
  int __pyx_v_samplerate;
  int __pyx_v_sfmode;
  PyObject *__pyx_v_msg;
  PyObject *__pyx_v_type;
  PyObject *__pyx_v_enc;
  PyObject *__pyx_v_endian;
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  char *__pyx_t_8;
  static PyObject **__pyx_pyargnames[] = {&__pyx_kp_filename,&__pyx_kp_mode,&__pyx_kp_format,&__pyx_kp_channels,&__pyx_kp_samplerate,0};
  __pyx_v_mode = __pyx_kp_90;
  __pyx_v_format = ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)Py_None);
  __pyx_v_channels = 0;
  __pyx_v_samplerate = 0;
  if (unlikely(__pyx_kwds)) {
    PyObject* values[5] = {0,0,0,0,0};
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    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:
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_filename);
      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 = 419; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_filename = values[0];
    if (values[1]) {
      __pyx_v_mode = values[1];
    }
    if (values[2]) {
      __pyx_v_format = ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)values[2]);
    }
    if (values[3]) {
      __pyx_v_channels = __pyx_PyInt_int(values[3]); if (unlikely((__pyx_v_channels == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    if (values[4]) {
      __pyx_v_samplerate = __pyx_PyInt_int(values[4]); if (unlikely((__pyx_v_samplerate == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
  } else {
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  5: __pyx_v_samplerate = __pyx_PyInt_int(PyTuple_GET_ITEM(__pyx_args, 4)); if (unlikely((__pyx_v_samplerate == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      case  4: __pyx_v_channels = __pyx_PyInt_int(PyTuple_GET_ITEM(__pyx_args, 3)); if (unlikely((__pyx_v_channels == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      case  3: __pyx_v_format = ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)PyTuple_GET_ITEM(__pyx_args, 2));
      case  2: __pyx_v_mode = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: __pyx_v_filename = 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("__init__", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.Sndfile.__init__");
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_v_msg = Py_None; Py_INCREF(Py_None);
  __pyx_v_type = Py_None; Py_INCREF(Py_None);
  __pyx_v_enc = Py_None; Py_INCREF(Py_None);
  __pyx_v_endian = Py_None; Py_INCREF(Py_None);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_format), __pyx_ptype_7scikits_8audiolab_9pysndfile_8_sndfile_Format, 1, "format", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":424
 *         # -1 will indicate that the file has been open from filename, not from
 *         # file descriptor
 *         self.fd = -1             # <<<<<<<<<<<<<<
 * 
 *         self.hdl = NULL
 */
  ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->fd = -1;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":426
 *         self.fd = -1
 * 
 *         self.hdl = NULL             # <<<<<<<<<<<<<<
 * 
 *         # Check the mode is one of the expected values
 */
  ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->hdl = NULL;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":429
 * 
 *         # Check the mode is one of the expected values
 *         if mode == 'r':             # <<<<<<<<<<<<<<
 *             sfmode = SFM_READ
 *         elif mode == 'w':
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_mode, __pyx_kp_115, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /* __pyx_t_2 allocated */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /* __pyx_t_1 released */
  if (__pyx_t_2) {
    /* __pyx_t_2 released */

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":430
 *         # Check the mode is one of the expected values
 *         if mode == 'r':
 *             sfmode = SFM_READ             # <<<<<<<<<<<<<<
 *         elif mode == 'w':
 *             sfmode = SFM_WRITE
 */
    __pyx_v_sfmode = SFM_READ;
    goto __pyx_L6;
  }

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":431
 *         if mode == 'r':
 *             sfmode = SFM_READ
 *         elif mode == 'w':             # <<<<<<<<<<<<<<
 *             sfmode = SFM_WRITE
 *             if format is None:
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_mode, __pyx_kp_116, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /* __pyx_t_2 allocated */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /* __pyx_t_1 released */
  if (__pyx_t_2) {
    /* __pyx_t_2 released */

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":432
 *             sfmode = SFM_READ
 *         elif mode == 'w':
 *             sfmode = SFM_WRITE             # <<<<<<<<<<<<<<
 *             if format is None:
 *                 raise ValueError, \
 */
    __pyx_v_sfmode = SFM_WRITE;

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":433
 *         elif mode == 'w':
 *             sfmode = SFM_WRITE
 *             if format is None:             # <<<<<<<<<<<<<<
 *                 raise ValueError, \
 *                       "For write mode, you should provide"\
 */
    /* __pyx_t_2 allocated */
    __pyx_t_2 = (((PyObject *)__pyx_v_format) == Py_None);
    if (__pyx_t_2) {
      /* __pyx_t_2 released */

      /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":435
 *             if format is None:
 *                 raise ValueError, \
 *                       "For write mode, you should provide"\             # <<<<<<<<<<<<<<
 *                       "a format argument !"
 *         elif mode == 'rw':
 */
      __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_117, 0);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L7;
    }
    __pyx_L7:;
    goto __pyx_L6;
  }

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":437
 *                       "For write mode, you should provide"\
 *                       "a format argument !"
 *         elif mode == 'rw':             # <<<<<<<<<<<<<<
 *             sfmode  = SFM_RDWR
 *             if format is None:
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_mode, __pyx_kp_118, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /* __pyx_t_2 allocated */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /* __pyx_t_1 released */
  if (__pyx_t_2) {
    /* __pyx_t_2 released */

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":438
 *                       "a format argument !"
 *         elif mode == 'rw':
 *             sfmode  = SFM_RDWR             # <<<<<<<<<<<<<<
 *             if format is None:
 *                 raise ValueError, \
 */
    __pyx_v_sfmode = SFM_RDWR;

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":439
 *         elif mode == 'rw':
 *             sfmode  = SFM_RDWR
 *             if format is None:             # <<<<<<<<<<<<<<
 *                 raise ValueError, \
 *                       "For write mode, you should provide"\
 */
    /* __pyx_t_2 allocated */
    __pyx_t_2 = (((PyObject *)__pyx_v_format) == Py_None);
    if (__pyx_t_2) {
      /* __pyx_t_2 released */

      /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":441
 *             if format is None:
 *                 raise ValueError, \
 *                       "For write mode, you should provide"\             # <<<<<<<<<<<<<<
 *                       "a format argument !"
 *         else:
 */
      __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_119, 0);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L8;
    }
    __pyx_L8:;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":444
 *                       "a format argument !"
 *         else:
 *             raise ValueError("mode %s not recognized" % str(mode))             # <<<<<<<<<<<<<<
 * 
 *         # Fill the sfinfo struct
 */
    /* __pyx_t_1 allocated */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_INCREF(__pyx_v_mode);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_mode);
    /* __pyx_t_3 allocated */
    __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)&PyString_Type)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    /* __pyx_t_1 released */
    /* __pyx_t_1 allocated */
    __pyx_t_1 = PyNumber_Remainder(__pyx_kp_120, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    /* __pyx_t_3 released */
    /* __pyx_t_3 allocated */
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
    __pyx_t_1 = 0;
    /* __pyx_t_1 released */
    /* __pyx_t_1 allocated */
    __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    /* __pyx_t_3 released */
    __Pyx_Raise(__pyx_t_1, 0, 0);
    Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    /* __pyx_t_1 released */
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L6:;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":447
 * 
 *         # Fill the sfinfo struct
 *         self._sfinfo.frames = 0             # <<<<<<<<<<<<<<
 *         self._sfinfo.channels = channels
 *         self._sfinfo.samplerate = samplerate
 */
  ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_sfinfo.frames = 0;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":448
 *         # Fill the sfinfo struct
 *         self._sfinfo.frames = 0
 *         self._sfinfo.channels = channels             # <<<<<<<<<<<<<<
 *         self._sfinfo.samplerate = samplerate
 * 
 */
  ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_sfinfo.channels = __pyx_v_channels;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":449
 *         self._sfinfo.frames = 0
 *         self._sfinfo.channels = channels
 *         self._sfinfo.samplerate = samplerate             # <<<<<<<<<<<<<<
 * 
 *         self._sfinfo.sections = 0
 */
  ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_sfinfo.samplerate = __pyx_v_samplerate;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":451
 *         self._sfinfo.samplerate = samplerate
 * 
 *         self._sfinfo.sections = 0             # <<<<<<<<<<<<<<
 *         self._sfinfo.seekable = SF_FALSE
 *         if mode == 'r' and format is None:
 */
  ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_sfinfo.sections = 0;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":452
 * 
 *         self._sfinfo.sections = 0
 *         self._sfinfo.seekable = SF_FALSE             # <<<<<<<<<<<<<<
 *         if mode == 'r' and format is None:
 *             self._sfinfo.format = 0
 */
  ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_sfinfo.seekable = SF_FALSE;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":453
 *         self._sfinfo.sections = 0
 *         self._sfinfo.seekable = SF_FALSE
 *         if mode == 'r' and format is None:             # <<<<<<<<<<<<<<
 *             self._sfinfo.format = 0
 *         else:
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_mode, __pyx_kp_121, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /* __pyx_t_2 allocated */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /* __pyx_t_1 released */
  if (__pyx_t_2) {
    /* __pyx_t_4 allocated */
    __pyx_t_4 = (((PyObject *)__pyx_v_format) == Py_None);
    /* __pyx_t_5 allocated */
    __pyx_t_5 = __pyx_t_4;
    /* __pyx_t_4 released */
  } else {
    __pyx_t_5 = __pyx_t_2;
    /* __pyx_t_2 released */
  }
  if (__pyx_t_5) {
    /* __pyx_t_5 released */

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":454
 *         self._sfinfo.seekable = SF_FALSE
 *         if mode == 'r' and format is None:
 *             self._sfinfo.format = 0             # <<<<<<<<<<<<<<
 *         else:
 *             # XXX: do this correctly, by using sf_check
 */
    ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_sfinfo.format = 0;
    goto __pyx_L9;
  }
  /*else*/ {

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":457
 *         else:
 *             # XXX: do this correctly, by using sf_check
 *             if samplerate == 0 or channels == 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError, \
 *                       "Bad value of samplerate (%d) or channels (%d)" % \
 */
    if (!(__pyx_v_samplerate == 0)) {
      /* __pyx_t_5 allocated */
      __pyx_t_5 = (__pyx_v_channels == 0);
    } else {
      __pyx_t_5 = (__pyx_v_samplerate == 0);
    }
    if (__pyx_t_5) {
      /* __pyx_t_5 released */

      /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":460
 *                 raise ValueError, \
 *                       "Bad value of samplerate (%d) or channels (%d)" % \
 *                       (samplerate, channels)             # <<<<<<<<<<<<<<
 *             self._sfinfo.format = format.format_int()
 *             if sf_format_check(&self._sfinfo) == SF_FALSE:
 */
      /* __pyx_t_1 allocated */
      __pyx_t_1 = PyInt_FromLong(__pyx_v_samplerate); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      /* __pyx_t_3 allocated */
      __pyx_t_3 = PyInt_FromLong(__pyx_v_channels); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      /* __pyx_t_6 allocated */
      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3);
      __pyx_t_1 = 0;
      __pyx_t_3 = 0;
      /* __pyx_t_1 released */
      /* __pyx_t_3 released */
      /* __pyx_t_3 allocated */
      __pyx_t_3 = PyNumber_Remainder(__pyx_kp_122, ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
      /* __pyx_t_6 released */
      __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_3, 0);
      Py_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      /* __pyx_t_3 released */
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L10;
    }
    __pyx_L10:;

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":461
 *                       "Bad value of samplerate (%d) or channels (%d)" % \
 *                       (samplerate, channels)
 *             self._sfinfo.format = format.format_int()             # <<<<<<<<<<<<<<
 *             if sf_format_check(&self._sfinfo) == SF_FALSE:
 *                 raise ValueError("Bad format specification: check arguments.")
 */
    ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_sfinfo.format = ((struct __pyx_vtabstruct_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_format->__pyx_vtab)->format_int(__pyx_v_format);

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":462
 *                       (samplerate, channels)
 *             self._sfinfo.format = format.format_int()
 *             if sf_format_check(&self._sfinfo) == SF_FALSE:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Bad format specification: check arguments.")
 * 
 */
    /* __pyx_t_5 allocated */
    __pyx_t_5 = (sf_format_check((&((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_sfinfo)) == SF_FALSE);
    if (__pyx_t_5) {
      /* __pyx_t_5 released */

      /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":463
 *             self._sfinfo.format = format.format_int()
 *             if sf_format_check(&self._sfinfo) == SF_FALSE:
 *                 raise ValueError("Bad format specification: check arguments.")             # <<<<<<<<<<<<<<
 * 
 *         # XXX: check how cython behave with this kind of code
 */
      /* __pyx_t_3 allocated */
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_INCREF(__pyx_kp_123);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_123);
      /* __pyx_t_6 allocated */
      __pyx_t_6 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      /* __pyx_t_3 released */
      __Pyx_Raise(__pyx_t_6, 0, 0);
      Py_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      /* __pyx_t_6 released */
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L11;
    }
    __pyx_L11:;
  }
  __pyx_L9:;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":466
 * 
 *         # XXX: check how cython behave with this kind of code
 *         if isinstance(filename, int):             # <<<<<<<<<<<<<<
 *             self.hdl = sf_open_fd(filename, sfmode, &self._sfinfo, SF_FALSE)
 *             self.fd = filename
 */
  /* __pyx_t_5 allocated */
  __pyx_t_5 = PyObject_TypeCheck(__pyx_v_filename, ((PyTypeObject *)((PyObject*)&PyInt_Type))); 
  if (__pyx_t_5) {
    /* __pyx_t_5 released */

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":467
 *         # XXX: check how cython behave with this kind of code
 *         if isinstance(filename, int):
 *             self.hdl = sf_open_fd(filename, sfmode, &self._sfinfo, SF_FALSE)             # <<<<<<<<<<<<<<
 *             self.fd = filename
 *             self.filename = ""
 */
    /* __pyx_t_7 allocated */
    __pyx_t_7 = __pyx_PyInt_int(__pyx_v_filename); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->hdl = sf_open_fd(__pyx_t_7, __pyx_v_sfmode, (&((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_sfinfo), SF_FALSE);
    /* __pyx_t_7 released */

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":468
 *         if isinstance(filename, int):
 *             self.hdl = sf_open_fd(filename, sfmode, &self._sfinfo, SF_FALSE)
 *             self.fd = filename             # <<<<<<<<<<<<<<
 *             self.filename = ""
 *         else:
 */
    /* __pyx_t_7 allocated */
    __pyx_t_7 = __pyx_PyInt_int(__pyx_v_filename); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->fd = __pyx_t_7;
    /* __pyx_t_7 released */

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":469
 *             self.hdl = sf_open_fd(filename, sfmode, &self._sfinfo, SF_FALSE)
 *             self.fd = filename
 *             self.filename = ""             # <<<<<<<<<<<<<<
 *         else:
 *             self.hdl = sf_open(filename, sfmode, &self._sfinfo)
 */
    Py_INCREF(__pyx_kp_124);
    Py_DECREF(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->filename);
    ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->filename = __pyx_kp_124;
    goto __pyx_L12;
  }
  /*else*/ {

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":471
 *             self.filename = ""
 *         else:
 *             self.hdl = sf_open(filename, sfmode, &self._sfinfo)             # <<<<<<<<<<<<<<
 *             self.filename = filename
 *         self._mode = sfmode
 */
    /* __pyx_t_8 allocated */
    __pyx_t_8 = __Pyx_PyBytes_AsString(__pyx_v_filename); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->hdl = sf_open(__pyx_t_8, __pyx_v_sfmode, (&((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_sfinfo));
    /* __pyx_t_8 released */

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":472
 *         else:
 *             self.hdl = sf_open(filename, sfmode, &self._sfinfo)
 *             self.filename = filename             # <<<<<<<<<<<<<<
 *         self._mode = sfmode
 * 
 */
    Py_INCREF(__pyx_v_filename);
    Py_DECREF(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->filename);
    ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->filename = __pyx_v_filename;
  }
  __pyx_L12:;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":473
 *             self.hdl = sf_open(filename, sfmode, &self._sfinfo)
 *             self.filename = filename
 *         self._mode = sfmode             # <<<<<<<<<<<<<<
 * 
 *         if self.hdl == NULL:
 */
  ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_mode = __pyx_v_sfmode;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":475
 *         self._mode = sfmode
 * 
 *         if self.hdl == NULL:             # <<<<<<<<<<<<<<
 *             if self.fd == -1:
 *                 msg = "error while opening file %s\n\t-> " % self.filename
 */
  /* __pyx_t_5 allocated */
  __pyx_t_5 = (((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->hdl == NULL);
  if (__pyx_t_5) {
    /* __pyx_t_5 released */

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":476
 * 
 *         if self.hdl == NULL:
 *             if self.fd == -1:             # <<<<<<<<<<<<<<
 *                 msg = "error while opening file %s\n\t-> " % self.filename
 *             else:
 */
    /* __pyx_t_5 allocated */
    __pyx_t_5 = (((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->fd == -1);
    if (__pyx_t_5) {
      /* __pyx_t_5 released */

      /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":477
 *         if self.hdl == NULL:
 *             if self.fd == -1:
 *                 msg = "error while opening file %s\n\t-> " % self.filename             # <<<<<<<<<<<<<<
 *             else:
 *                 msg = "error while opening file descriptor %d\n\t->" % self.fd
 */
      /* __pyx_t_6 allocated */
      __pyx_t_6 = PyNumber_Remainder(__pyx_kp_125, ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->filename); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_v_msg);
      __pyx_v_msg = __pyx_t_6;
      __pyx_t_6 = 0;
      /* __pyx_t_6 released */
      goto __pyx_L14;
    }
    /*else*/ {

      /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":479
 *                 msg = "error while opening file %s\n\t-> " % self.filename
 *             else:
 *                 msg = "error while opening file descriptor %d\n\t->" % self.fd             # <<<<<<<<<<<<<<
 *             msg += sf_strerror(self.hdl)
 *             if not self.fd == -1:
 */
      /* __pyx_t_6 allocated */
      __pyx_t_6 = PyInt_FromLong(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->fd); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      /* __pyx_t_3 allocated */
      __pyx_t_3 = PyNumber_Remainder(__pyx_kp_126, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      /* __pyx_t_6 released */
      Py_DECREF(__pyx_v_msg);
      __pyx_v_msg = __pyx_t_3;
      __pyx_t_3 = 0;
      /* __pyx_t_3 released */
    }
    __pyx_L14:;

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":480
 *             else:
 *                 msg = "error while opening file descriptor %d\n\t->" % self.fd
 *             msg += sf_strerror(self.hdl)             # <<<<<<<<<<<<<<
 *             if not self.fd == -1:
 *                 msg += """
 */
    /* __pyx_t_3 allocated */
    __pyx_t_3 = __Pyx_PyBytes_FromString(sf_strerror(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->hdl)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_1 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_t_3); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    /* __pyx_t_3 released */
    Py_DECREF(__pyx_v_msg);
    __pyx_v_msg = __pyx_1;
    __pyx_1 = 0;

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":481
 *                 msg = "error while opening file descriptor %d\n\t->" % self.fd
 *             msg += sf_strerror(self.hdl)
 *             if not self.fd == -1:             # <<<<<<<<<<<<<<
 *                 msg += """
 * (Check that the mode argument passed to sndfile is the same than the one used
 */
    /* __pyx_t_5 allocated */
    __pyx_t_5 = (!(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->fd == -1));
    if (__pyx_t_5) {
      /* __pyx_t_5 released */

      /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":482
 *             msg += sf_strerror(self.hdl)
 *             if not self.fd == -1:
 *                 msg += """             # <<<<<<<<<<<<<<
 * (Check that the mode argument passed to sndfile is the same than the one used
 * when getting the file descriptor, eg do not pass 'r' to sndfile if you
 */
      __pyx_1 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_kp_127); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_v_msg);
      __pyx_v_msg = __pyx_1;
      __pyx_1 = 0;
      goto __pyx_L15;
    }
    __pyx_L15:;

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":488
 * win32, you are out of luck, because its implementation of POSIX open is
 * broken)"""
 *             raise IOError("error while opening %s\n\t->%s" % (filename, msg))             # <<<<<<<<<<<<<<
 * 
 *         if mode == 'r':
 */
    /* __pyx_t_3 allocated */
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_INCREF(__pyx_v_filename);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_filename);
    Py_INCREF(__pyx_v_msg);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_msg);
    /* __pyx_t_6 allocated */
    __pyx_t_6 = PyNumber_Remainder(__pyx_kp_128, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    /* __pyx_t_3 released */
    /* __pyx_t_3 allocated */
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6);
    __pyx_t_6 = 0;
    /* __pyx_t_6 released */
    /* __pyx_t_6 allocated */
    __pyx_t_6 = PyObject_Call(__pyx_builtin_IOError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    /* __pyx_t_3 released */
    __Pyx_Raise(__pyx_t_6, 0, 0);
    Py_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    /* __pyx_t_6 released */
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L13;
  }
  __pyx_L13:;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":490
 *             raise IOError("error while opening %s\n\t->%s" % (filename, msg))
 * 
 *         if mode == 'r':             # <<<<<<<<<<<<<<
 *             type, enc, endian = int_to_format(self._sfinfo.format)
 *             self._format = Format(type, enc, endian)
 */
  /* __pyx_t_6 allocated */
  __pyx_t_6 = PyObject_RichCompare(__pyx_v_mode, __pyx_kp_129, Py_EQ); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /* __pyx_t_5 allocated */
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  /* __pyx_t_6 released */
  if (__pyx_t_5) {
    /* __pyx_t_5 released */

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":491
 * 
 *         if mode == 'r':
 *             type, enc, endian = int_to_format(self._sfinfo.format)             # <<<<<<<<<<<<<<
 *             self._format = Format(type, enc, endian)
 *         else:
 */
    /* __pyx_t_6 allocated */
    __pyx_t_6 = __pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_int_to_format(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_sfinfo.format); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (PyTuple_CheckExact(__pyx_t_6) && PyTuple_GET_SIZE(__pyx_t_6) == 3) {
      PyObject* tuple = __pyx_t_6;
      __pyx_2 = PyTuple_GET_ITEM(tuple, 0); Py_INCREF(__pyx_2);
      __pyx_3 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(__pyx_3);
      __pyx_4 = PyTuple_GET_ITEM(tuple, 2); Py_INCREF(__pyx_4);
      Py_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      Py_DECREF(__pyx_v_type);
      __pyx_v_type = __pyx_2;
      __pyx_2 = 0;
      Py_DECREF(__pyx_v_enc);
      __pyx_v_enc = __pyx_3;
      __pyx_3 = 0;
      Py_DECREF(__pyx_v_endian);
      __pyx_v_endian = __pyx_4;
      __pyx_4 = 0;
    } else {
      __pyx_1 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_4 = __Pyx_UnpackItem(__pyx_1, 2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_1); __pyx_1 = 0;
      Py_DECREF(__pyx_v_type);
      __pyx_v_type = __pyx_2;
      __pyx_2 = 0;
      Py_DECREF(__pyx_v_enc);
      __pyx_v_enc = __pyx_3;
      __pyx_3 = 0;
      Py_DECREF(__pyx_v_endian);
      __pyx_v_endian = __pyx_4;
      __pyx_4 = 0;
    }
    /* __pyx_t_6 released */

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":492
 *         if mode == 'r':
 *             type, enc, endian = int_to_format(self._sfinfo.format)
 *             self._format = Format(type, enc, endian)             # <<<<<<<<<<<<<<
 *         else:
 *             self._format = format
 */
    /* __pyx_t_6 allocated */
    __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_INCREF(__pyx_v_type);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_type);
    Py_INCREF(__pyx_v_enc);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_enc);
    Py_INCREF(__pyx_v_endian);
    PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_endian);
    /* __pyx_t_3 allocated */
    __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_7scikits_8audiolab_9pysndfile_8_sndfile_Format)), ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    /* __pyx_t_6 released */
    if (!(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7scikits_8audiolab_9pysndfile_8_sndfile_Format))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(((PyObject *)((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_format));
    ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_format = ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_t_3);
    __pyx_t_3 = 0;
    /* __pyx_t_3 released */
    goto __pyx_L16;
  }
  /*else*/ {

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":494
 *             self._format = Format(type, enc, endian)
 *         else:
 *             self._format = format             # <<<<<<<<<<<<<<
 * 
 *         # XXX: Handle FLAC problem
 */
    Py_INCREF(((PyObject *)__pyx_v_format));
    Py_DECREF(((PyObject *)((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_format));
    ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_format = __pyx_v_format;
  }
  __pyx_L16:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_t_1);
  Py_XDECREF(__pyx_t_3);
  Py_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.Sndfile.__init__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_msg);
  Py_DECREF(__pyx_v_type);
  Py_DECREF(__pyx_v_enc);
  Py_DECREF(__pyx_v_endian);
  return __pyx_r;
}

/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":498
 *         # XXX: Handle FLAC problem
 * 
 *     def __dealloc__(Sndfile self):             # <<<<<<<<<<<<<<
 *         self._close()
 * 
 */

static void __pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile___dealloc__(PyObject *__pyx_v_self) {
  PyObject *__pyx_t_1 = NULL;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":499
 * 
 *     def __dealloc__(Sndfile self):
 *         self._close()             # <<<<<<<<<<<<<<
 * 
 *     cdef _close(Sndfile self):
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->__pyx_vtab)->_close(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /* __pyx_t_1 released */

  goto __pyx_L0;
  __pyx_L1_error:;
  Py_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.Sndfile.__dealloc__");
  __pyx_L0:;
}

/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":501
 *         self._close()
 * 
 *     cdef _close(Sndfile self):             # <<<<<<<<<<<<<<
 *         if self.hdl:
 *             sf_close(self.hdl)
 */

static  PyObject *__pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile__close(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *__pyx_v_self) {
  PyObject *__pyx_r;
  int __pyx_t_1;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":502
 * 
 *     cdef _close(Sndfile self):
 *         if self.hdl:             # <<<<<<<<<<<<<<
 *             sf_close(self.hdl)
 *             self.hdl = NULL
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = (__pyx_v_self->hdl != 0);
  if (__pyx_t_1) {
    /* __pyx_t_1 released */

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":503
 *     cdef _close(Sndfile self):
 *         if self.hdl:
 *             sf_close(self.hdl)             # <<<<<<<<<<<<<<
 *             self.hdl = NULL
 * 
 */
    sf_close(__pyx_v_self->hdl);

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":504
 *         if self.hdl:
 *             sf_close(self.hdl)
 *             self.hdl = NULL             # <<<<<<<<<<<<<<
 * 
 *     def close(Sndfile self):
 */
    __pyx_v_self->hdl = NULL;
    goto __pyx_L3;
  }
  __pyx_L3:;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  return __pyx_r;
}

/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":506
 *             self.hdl = NULL
 * 
 *     def close(Sndfile self):             # <<<<<<<<<<<<<<
 *         """close the file."""
 *         self._close()
 */

static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_close(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_close[] = "Sndfile.close(self)\nclose the file.";
static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_close(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r;
  PyObject *__pyx_t_1 = NULL;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":508
 *     def close(Sndfile self):
 *         """close the file."""
 *         self._close()             # <<<<<<<<<<<<<<
 * 
 *     def sync(Sndfile self):
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->__pyx_vtab)->_close(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /* __pyx_t_1 released */

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  Py_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.Sndfile.close");
  __pyx_r = NULL;
  __pyx_L0:;
  return __pyx_r;
}

/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":510
 *         self._close()
 * 
 *     def sync(Sndfile self):             # <<<<<<<<<<<<<<
 *         """\
 *         call the operating system's function to force the writing of all
 */

static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_sync(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_sync[] = "Sndfile.sync(self)\n        call the operating system's function to force the writing of all\n        file cache buffers to disk the file.\n\n        No effect if file is open as read";
static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_sync(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":516
 * 
 *         No effect if file is open as read"""
 *         sf_write_sync(self.hdl)             # <<<<<<<<<<<<<<
 * 
 *     # Functions to get informations about the file
 */
  sf_write_sync(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->hdl);

  __pyx_r = Py_None; Py_INCREF(Py_None);
  return __pyx_r;
}

/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":524
 *     #    return self.nframes
 * 
 *     cdef sf_count_t _get_nframes(self):             # <<<<<<<<<<<<<<
 *         """ Return the number of frames of the file"""
 *         if self._mode == SFM_READ:
 */

static  sf_count_t __pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile__get_nframes(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *__pyx_v_self) {
  sf_count_t __pyx_r;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":526
 *     cdef sf_count_t _get_nframes(self):
 *         """ Return the number of frames of the file"""
 *         if self._mode == SFM_READ:             # <<<<<<<<<<<<<<
 *             # XXX: is this reliable for any file (think pipe and co ?)
 *             return self._sfinfo.frames
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = (__pyx_v_self->_mode == SFM_READ);
  if (__pyx_t_1) {
    /* __pyx_t_1 released */

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":528
 *         if self._mode == SFM_READ:
 *             # XXX: is this reliable for any file (think pipe and co ?)
 *             return self._sfinfo.frames             # <<<<<<<<<<<<<<
 * 
 *         # In write/rwrite mode, the only reliable way to get the number of
 */
    __pyx_r = __pyx_v_self->_sfinfo.frames;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":532
 *         # In write/rwrite mode, the only reliable way to get the number of
 *         # frames is to use seek.
 *         raise NotImplementedError("Sorry, getting the current number of"             # <<<<<<<<<<<<<<
 *                 "frames in write modes is not supported yet")
 * 
 */
  /* __pyx_t_2 allocated */
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_INCREF(__pyx_kp_130);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_130);
  /* __pyx_t_3 allocated */
  __pyx_t_3 = PyObject_Call(__pyx_builtin_NotImplementedError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  /* __pyx_t_2 released */
  __Pyx_Raise(__pyx_t_3, 0, 0);
  Py_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  /* __pyx_t_3 released */
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  Py_XDECREF(__pyx_t_2);
  Py_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("scikits.audiolab.pysndfile._sndfile.Sndfile._get_nframes");
  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}

/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":537
 *     property nframes:
 *         """Number of frames of the file."""
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._get_nframes()
 * 
 */

static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_7nframes___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_7nframes___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;
  PyObject *__pyx_t_1 = NULL;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":538
 *         """Number of frames of the file."""
 *         def __get__(self):
 *             return self._get_nframes()             # <<<<<<<<<<<<<<
 * 
 *     property samplerate:
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyLong_FromLongLong(((struct __pyx_vtabstruct_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->__pyx_vtab)->_get_nframes(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  /* __pyx_t_1 released */
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  Py_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.Sndfile.nframes.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  return __pyx_r;
}

/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":542
 *     property samplerate:
 *         """Sampling rate (in Hz)."""
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._sfinfo.samplerate
 * 
 */

static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_10samplerate___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_10samplerate___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;
  PyObject *__pyx_t_1 = NULL;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":543
 *         """Sampling rate (in Hz)."""
 *         def __get__(self):
 *             return self._sfinfo.samplerate             # <<<<<<<<<<<<<<
 * 
 *     property channels:
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_sfinfo.samplerate); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  /* __pyx_t_1 released */
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  Py_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.Sndfile.samplerate.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  return __pyx_r;
}

/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":547
 *     property channels:
 *         """Number of channels."""
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._sfinfo.channels
 * 
 */

static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_8channels___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_8channels___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;
  PyObject *__pyx_t_1 = NULL;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":548
 *         """Number of channels."""
 *         def __get__(self):
 *             return self._sfinfo.channels             # <<<<<<<<<<<<<<
 * 
 *     property format:
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_sfinfo.channels); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  /* __pyx_t_1 released */
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  Py_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.Sndfile.channels.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  return __pyx_r;
}

/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":552
 *     property format:
 *         """Format instance attached to the Sndfile instance."""
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return copy.copy(self._format)
 * 
 */

static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_6format___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_6format___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":553
 *         """Format instance attached to the Sndfile instance."""
 *         def __get__(self):
 *             return copy.copy(self._format)             # <<<<<<<<<<<<<<
 * 
 *     # Those are convenience: they can be accessed from the format object
 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_copy); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_copy); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_INCREF(((PyObject *)((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_format));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_format));
  /* __pyx_t_2 allocated */
  __pyx_t_2 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  /* __pyx_t_1 released */
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  /* __pyx_t_2 released */
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_t_1);
  Py_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.Sndfile.format.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  return __pyx_r;
}

/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":558
 *     # attached to the Sndfile instance.
 *     property file_format:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._format.file_format
 * 
 */

static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_11file_format___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_11file_format___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":559
 *     property file_format:
 *         def __get__(self):
 *             return self._format.file_format             # <<<<<<<<<<<<<<
 * 
 *     property encoding:
 */
  __pyx_1 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_format), __pyx_kp_file_format); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.Sndfile.file_format.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  return __pyx_r;
}

/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":562
 * 
 *     property encoding:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._format.encoding
 * 
 */

static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_8encoding___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_8encoding___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":563
 *     property encoding:
 *         def __get__(self):
 *             return self._format.encoding             # <<<<<<<<<<<<<<
 * 
 *     property endianness:
 */
  __pyx_1 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_format), __pyx_kp_encoding); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.Sndfile.encoding.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  return __pyx_r;
}

/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":566
 * 
 *     property endianness:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._format.endianness
 * 
 */

static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_10endianness___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_10endianness___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":567
 *     property endianness:
 *         def __get__(self):
 *             return self._format.endianness             # <<<<<<<<<<<<<<
 * 
 *     def __str__(Sndfile self):
 */
  __pyx_1 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_format), __pyx_kp_endianness); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.Sndfile.endianness.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  return __pyx_r;
}

/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":569
 *             return self._format.endianness
 * 
 *     def __str__(Sndfile self):             # <<<<<<<<<<<<<<
 *         repstr = ["----------------------------------------"]
 *         if not self.fd == -1:
 */

static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile___str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile___str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_v_repstr;
  PyObject *__pyx_v_seek;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __pyx_v_repstr = Py_None; Py_INCREF(Py_None);
  __pyx_v_seek = Py_None; Py_INCREF(Py_None);

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":570
 * 
 *     def __str__(Sndfile self):
 *         repstr = ["----------------------------------------"]             # <<<<<<<<<<<<<<
 *         if not self.fd == -1:
 *             repstr += ["File        : %d (opened by file descriptor)" % self.fd]
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_INCREF(__pyx_kp_131);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_kp_131);
  Py_DECREF(__pyx_v_repstr);
  __pyx_v_repstr = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  /* __pyx_t_1 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":571
 *     def __str__(Sndfile self):
 *         repstr = ["----------------------------------------"]
 *         if not self.fd == -1:             # <<<<<<<<<<<<<<
 *             repstr += ["File        : %d (opened by file descriptor)" % self.fd]
 *         else:
 */
  /* __pyx_t_2 allocated */
  __pyx_t_2 = (!(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->fd == -1));
  if (__pyx_t_2) {
    /* __pyx_t_2 released */

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":572
 *         repstr = ["----------------------------------------"]
 *         if not self.fd == -1:
 *             repstr += ["File        : %d (opened by file descriptor)" % self.fd]             # <<<<<<<<<<<<<<
 *         else:
 *             repstr += ["File        : %s" % self.filename]
 */
    /* __pyx_t_1 allocated */
    __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->fd); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    /* __pyx_t_3 allocated */
    __pyx_t_3 = PyNumber_Remainder(__pyx_kp_132, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    /* __pyx_t_1 released */
    /* __pyx_t_1 allocated */
    __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
    __pyx_t_3 = 0;
    /* __pyx_t_3 released */
    __pyx_1 = PyNumber_InPlaceAdd(__pyx_v_repstr, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    /* __pyx_t_1 released */
    Py_DECREF(__pyx_v_repstr);
    __pyx_v_repstr = __pyx_1;
    __pyx_1 = 0;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":574
 *             repstr += ["File        : %d (opened by file descriptor)" % self.fd]
 *         else:
 *             repstr += ["File        : %s" % self.filename]             # <<<<<<<<<<<<<<
 *         repstr  += ["Channels    : %d" % self._sfinfo.channels]
 *         repstr  += ["Sample rate : %d" % self._sfinfo.samplerate]
 */
    /* __pyx_t_1 allocated */
    __pyx_t_1 = PyNumber_Remainder(__pyx_kp_133, ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->filename); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    /* __pyx_t_3 allocated */
    __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
    __pyx_t_1 = 0;
    /* __pyx_t_1 released */
    __pyx_1 = PyNumber_InPlaceAdd(__pyx_v_repstr, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    /* __pyx_t_3 released */
    Py_DECREF(__pyx_v_repstr);
    __pyx_v_repstr = __pyx_1;
    __pyx_1 = 0;
  }
  __pyx_L5:;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":575
 *         else:
 *             repstr += ["File        : %s" % self.filename]
 *         repstr  += ["Channels    : %d" % self._sfinfo.channels]             # <<<<<<<<<<<<<<
 *         repstr  += ["Sample rate : %d" % self._sfinfo.samplerate]
 *         repstr  += ["Frames      : %d" % self._sfinfo.frames]
 */
  /* __pyx_t_3 allocated */
  __pyx_t_3 = PyInt_FromLong(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_sfinfo.channels); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyNumber_Remainder(__pyx_kp_134, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  /* __pyx_t_3 released */
  /* __pyx_t_3 allocated */
  __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  /* __pyx_t_1 released */
  __pyx_1 = PyNumber_InPlaceAdd(__pyx_v_repstr, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  /* __pyx_t_3 released */
  Py_DECREF(__pyx_v_repstr);
  __pyx_v_repstr = __pyx_1;
  __pyx_1 = 0;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":576
 *             repstr += ["File        : %s" % self.filename]
 *         repstr  += ["Channels    : %d" % self._sfinfo.channels]
 *         repstr  += ["Sample rate : %d" % self._sfinfo.samplerate]             # <<<<<<<<<<<<<<
 *         repstr  += ["Frames      : %d" % self._sfinfo.frames]
 *         repstr  += ["Raw Format  : %#010x" % self._format.format_int()]
 */
  /* __pyx_t_3 allocated */
  __pyx_t_3 = PyInt_FromLong(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_sfinfo.samplerate); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyNumber_Remainder(__pyx_kp_135, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  /* __pyx_t_3 released */
  /* __pyx_t_3 allocated */
  __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  /* __pyx_t_1 released */
  __pyx_1 = PyNumber_InPlaceAdd(__pyx_v_repstr, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  /* __pyx_t_3 released */
  Py_DECREF(__pyx_v_repstr);
  __pyx_v_repstr = __pyx_1;
  __pyx_1 = 0;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":577
 *         repstr  += ["Channels    : %d" % self._sfinfo.channels]
 *         repstr  += ["Sample rate : %d" % self._sfinfo.samplerate]
 *         repstr  += ["Frames      : %d" % self._sfinfo.frames]             # <<<<<<<<<<<<<<
 *         repstr  += ["Raw Format  : %#010x" % self._format.format_int()]
 *         repstr  += ["File format : %s" % self.file_format]
 */
  /* __pyx_t_3 allocated */
  __pyx_t_3 = PyLong_FromLongLong(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_sfinfo.frames); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyNumber_Remainder(__pyx_kp_136, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  /* __pyx_t_3 released */
  /* __pyx_t_3 allocated */
  __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  /* __pyx_t_1 released */
  __pyx_1 = PyNumber_InPlaceAdd(__pyx_v_repstr, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  /* __pyx_t_3 released */
  Py_DECREF(__pyx_v_repstr);
  __pyx_v_repstr = __pyx_1;
  __pyx_1 = 0;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":578
 *         repstr  += ["Sample rate : %d" % self._sfinfo.samplerate]
 *         repstr  += ["Frames      : %d" % self._sfinfo.frames]
 *         repstr  += ["Raw Format  : %#010x" % self._format.format_int()]             # <<<<<<<<<<<<<<
 *         repstr  += ["File format : %s" % self.file_format]
 *         repstr  += ["Encoding    : %s" % self.encoding]
 */
  /* __pyx_t_3 allocated */
  __pyx_t_3 = PyInt_FromLong(((struct __pyx_vtabstruct_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_format->__pyx_vtab)->format_int(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_format)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyNumber_Remainder(__pyx_kp_137, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  /* __pyx_t_3 released */
  /* __pyx_t_3 allocated */
  __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  /* __pyx_t_1 released */
  __pyx_1 = PyNumber_InPlaceAdd(__pyx_v_repstr, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  /* __pyx_t_3 released */
  Py_DECREF(__pyx_v_repstr);
  __pyx_v_repstr = __pyx_1;
  __pyx_1 = 0;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":579
 *         repstr  += ["Frames      : %d" % self._sfinfo.frames]
 *         repstr  += ["Raw Format  : %#010x" % self._format.format_int()]
 *         repstr  += ["File format : %s" % self.file_format]             # <<<<<<<<<<<<<<
 *         repstr  += ["Encoding    : %s" % self.encoding]
 *         repstr  += ["Endianness  : %s" % self.endianness]
 */
  __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_file_format); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /* __pyx_t_3 allocated */
  __pyx_t_3 = PyNumber_Remainder(__pyx_kp_138, __pyx_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
  __pyx_t_3 = 0;
  /* __pyx_t_3 released */
  __pyx_1 = PyNumber_InPlaceAdd(__pyx_v_repstr, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  /* __pyx_t_1 released */
  Py_DECREF(__pyx_v_repstr);
  __pyx_v_repstr = __pyx_1;
  __pyx_1 = 0;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":580
 *         repstr  += ["Raw Format  : %#010x" % self._format.format_int()]
 *         repstr  += ["File format : %s" % self.file_format]
 *         repstr  += ["Encoding    : %s" % self.encoding]             # <<<<<<<<<<<<<<
 *         repstr  += ["Endianness  : %s" % self.endianness]
 *         #repstr  += "Sections    : %d\n" % self._sfinfo.sections
 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_encoding); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyNumber_Remainder(__pyx_kp_139, __pyx_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  /* __pyx_t_3 allocated */
  __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  /* __pyx_t_1 released */
  __pyx_2 = PyNumber_InPlaceAdd(__pyx_v_repstr, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  /* __pyx_t_3 released */
  Py_DECREF(__pyx_v_repstr);
  __pyx_v_repstr = __pyx_2;
  __pyx_2 = 0;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":581
 *         repstr  += ["File format : %s" % self.file_format]
 *         repstr  += ["Encoding    : %s" % self.encoding]
 *         repstr  += ["Endianness  : %s" % self.endianness]             # <<<<<<<<<<<<<<
 *         #repstr  += "Sections    : %d\n" % self._sfinfo.sections
 *         if self._sfinfo.seekable == SF_TRUE:
 */
  __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_endianness); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /* __pyx_t_3 allocated */
  __pyx_t_3 = PyNumber_Remainder(__pyx_kp_140, __pyx_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
  __pyx_t_3 = 0;
  /* __pyx_t_3 released */
  __pyx_1 = PyNumber_InPlaceAdd(__pyx_v_repstr, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  /* __pyx_t_1 released */
  Py_DECREF(__pyx_v_repstr);
  __pyx_v_repstr = __pyx_1;
  __pyx_1 = 0;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":583
 *         repstr  += ["Endianness  : %s" % self.endianness]
 *         #repstr  += "Sections    : %d\n" % self._sfinfo.sections
 *         if self._sfinfo.seekable == SF_TRUE:             # <<<<<<<<<<<<<<
 *             seek    = True
 *         else:
 */
  /* __pyx_t_2 allocated */
  __pyx_t_2 = (((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_sfinfo.seekable == SF_TRUE);
  if (__pyx_t_2) {
    /* __pyx_t_2 released */

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":584
 *         #repstr  += "Sections    : %d\n" % self._sfinfo.sections
 *         if self._sfinfo.seekable == SF_TRUE:
 *             seek    = True             # <<<<<<<<<<<<<<
 *         else:
 *             seek    = False
 */
    /* __pyx_t_1 allocated */
    __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(__pyx_v_seek);
    __pyx_v_seek = __pyx_t_1;
    __pyx_t_1 = 0;
    /* __pyx_t_1 released */
    goto __pyx_L6;
  }
  /*else*/ {

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":586
 *             seek    = True
 *         else:
 *             seek    = False             # <<<<<<<<<<<<<<
 *         repstr  += ["Seekable    : %s\n" % seek]
 *         #repstr  += "Duration    : %s\n" % self._generate_duration_str()
 */
    /* __pyx_t_1 allocated */
    __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(__pyx_v_seek);
    __pyx_v_seek = __pyx_t_1;
    __pyx_t_1 = 0;
    /* __pyx_t_1 released */
  }
  __pyx_L6:;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":587
 *         else:
 *             seek    = False
 *         repstr  += ["Seekable    : %s\n" % seek]             # <<<<<<<<<<<<<<
 *         #repstr  += "Duration    : %s\n" % self._generate_duration_str()
 *         return "\n".join(repstr)
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyNumber_Remainder(__pyx_kp_141, __pyx_v_seek); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /* __pyx_t_3 allocated */
  __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  /* __pyx_t_1 released */
  __pyx_2 = PyNumber_InPlaceAdd(__pyx_v_repstr, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  /* __pyx_t_3 released */
  Py_DECREF(__pyx_v_repstr);
  __pyx_v_repstr = __pyx_2;
  __pyx_2 = 0;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":589
 *         repstr  += ["Seekable    : %s\n" % seek]
 *         #repstr  += "Duration    : %s\n" % self._generate_duration_str()
 *         return "\n".join(repstr)             # <<<<<<<<<<<<<<
 * 
 *     def read_frames(self, sf_count_t nframes, dtype=np.float64):
 */
  __pyx_1 = PyObject_GetAttr(__pyx_kp_142, __pyx_kp_join); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /* __pyx_t_3 allocated */
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_INCREF(__pyx_v_repstr);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_repstr);
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  /* __pyx_t_3 released */
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  /* __pyx_t_1 released */
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_t_1);
  Py_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.Sndfile.__str__");
  __pyx_r = NULL;
  __pyx_L0:;
  Py_DECREF(__pyx_v_repstr);
  Py_DECREF(__pyx_v_seek);
  return __pyx_r;
}

/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":591
 *         return "\n".join(repstr)
 * 
 *     def read_frames(self, sf_count_t nframes, dtype=np.float64):             # <<<<<<<<<<<<<<
 *         """\
 *         Read the given number of frames and put the data into a numpy array of
 */

static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_read_frames(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_read_frames[] = "Sndfile.read_frames(self, scikits.audiolab.pysndfile.sndfile.sf_count_t nframes, dtype=<\077\077?>)\n        Read the given number of frames and put the data into a numpy array of\n        the requested dtype.\n\n        Parameters\n        ----------\n        nframes : int\n            number of frames to read.\n        dtype : numpy dtype\n            dtype of the returned array containing read data (see note).\n\n        Notes\n        -----\n        One column per channel.\n\n        Updates the read pointer.\n\n        Notes\n        -----\n        if float are requested when the file contains integer data, you will\n        get normalized data (that is the max possible integer will be 1.0, and\n        the minimal possible value -1.0).\n\n        if integers are requested when the file contains floating point data,\n        it may give wrong results because there is an ambiguity: if the\n        floating data are normalized, you can get a file with only 0 ! Getting\n        integer data from files encoded in normalized floating point is not\n        supported (this is an audiolab limitation: sndfile supports it).";
static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_read_frames(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  sf_count_t __pyx_v_nframes;
  PyObject *__pyx_v_dtype = 0;
  PyObject *__pyx_v_y;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  static PyObject **__pyx_pyargnames[] = {&__pyx_kp_nframes,&__pyx_kp_dtype,0};
  __pyx_v_dtype = __pyx_k_92;
  if (unlikely(__pyx_kwds)) {
    PyObject* values[2] = {0,0};
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    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_kp_nframes);
      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), "read_frames") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_nframes = __pyx_PyInt_AsLongLong(values[0]); if (unlikely((__pyx_v_nframes == (PY_LONG_LONG)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    if (values[1]) {
      __pyx_v_dtype = values[1];
    }
  } else {
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  2: __pyx_v_dtype = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: __pyx_v_nframes = __pyx_PyInt_AsLongLong(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_nframes == (PY_LONG_LONG)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      break;
      default: goto __pyx_L5_argtuple_error;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("read_frames", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.Sndfile.read_frames");
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_v_y = Py_None; Py_INCREF(Py_None);

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":620
 *         integer data from files encoded in normalized floating point is not
 *         supported (this is an audiolab limitation: sndfile supports it)."""
 *         if nframes < 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("number of frames has to be >= 0 (was %d)" %
 *                              nframes)
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = (__pyx_v_nframes < 0);
  if (__pyx_t_1) {
    /* __pyx_t_1 released */

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":622
 *         if nframes < 0:
 *             raise ValueError("number of frames has to be >= 0 (was %d)" %
 *                              nframes)             # <<<<<<<<<<<<<<
 * 
 *         # TODO: inout argument
 */
    /* __pyx_t_2 allocated */
    __pyx_t_2 = PyLong_FromLongLong(__pyx_v_nframes); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    /* __pyx_t_3 allocated */
    __pyx_t_3 = PyNumber_Remainder(__pyx_kp_143, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    /* __pyx_t_2 released */
    /* __pyx_t_2 allocated */
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
    __pyx_t_3 = 0;
    /* __pyx_t_3 released */
    /* __pyx_t_3 allocated */
    __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    /* __pyx_t_2 released */
    __Pyx_Raise(__pyx_t_3, 0, 0);
    Py_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    /* __pyx_t_3 released */
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":627
 *         # XXX: rank 1 vs rank 2 for mono ?
 *         # XXX: endianness of dtype vs endianness of sndfile ?
 *         if dtype == np.float64:             # <<<<<<<<<<<<<<
 *             y = self.read_frames_double(nframes)
 *         elif dtype == np.float32:
 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_91); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  /* __pyx_t_3 allocated */
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_dtype, __pyx_2, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  /* __pyx_t_1 allocated */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  /* __pyx_t_3 released */
  if (__pyx_t_1) {
    /* __pyx_t_1 released */

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":628
 *         # XXX: endianness of dtype vs endianness of sndfile ?
 *         if dtype == np.float64:
 *             y = self.read_frames_double(nframes)             # <<<<<<<<<<<<<<
 *         elif dtype == np.float32:
 *             y = self.read_frames_float(nframes)
 */
    /* __pyx_t_3 allocated */
    __pyx_t_3 = ((struct __pyx_vtabstruct_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->__pyx_vtab)->read_frames_double(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self), __pyx_v_nframes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(__pyx_v_y);
    __pyx_v_y = __pyx_t_3;
    __pyx_t_3 = 0;
    /* __pyx_t_3 released */
    goto __pyx_L7;
  }

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":629
 *         if dtype == np.float64:
 *             y = self.read_frames_double(nframes)
 *         elif dtype == np.float32:             # <<<<<<<<<<<<<<
 *             y = self.read_frames_float(nframes)
 *         elif dtype == np.int32:
 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_144); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  /* __pyx_t_3 allocated */
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_dtype, __pyx_2, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  /* __pyx_t_1 allocated */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  /* __pyx_t_3 released */
  if (__pyx_t_1) {
    /* __pyx_t_1 released */

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":630
 *             y = self.read_frames_double(nframes)
 *         elif dtype == np.float32:
 *             y = self.read_frames_float(nframes)             # <<<<<<<<<<<<<<
 *         elif dtype == np.int32:
 *             y = self.read_frames_int(nframes)
 */
    /* __pyx_t_3 allocated */
    __pyx_t_3 = ((struct __pyx_vtabstruct_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->__pyx_vtab)->read_frames_float(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self), __pyx_v_nframes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(__pyx_v_y);
    __pyx_v_y = __pyx_t_3;
    __pyx_t_3 = 0;
    /* __pyx_t_3 released */
    goto __pyx_L7;
  }

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":631
 *         elif dtype == np.float32:
 *             y = self.read_frames_float(nframes)
 *         elif dtype == np.int32:             # <<<<<<<<<<<<<<
 *             y = self.read_frames_int(nframes)
 *         elif dtype == np.int16:
 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_145); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  /* __pyx_t_3 allocated */
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_dtype, __pyx_2, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  /* __pyx_t_1 allocated */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  /* __pyx_t_3 released */
  if (__pyx_t_1) {
    /* __pyx_t_1 released */

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":632
 *             y = self.read_frames_float(nframes)
 *         elif dtype == np.int32:
 *             y = self.read_frames_int(nframes)             # <<<<<<<<<<<<<<
 *         elif dtype == np.int16:
 *             y = self.read_frames_short(nframes)
 */
    /* __pyx_t_3 allocated */
    __pyx_t_3 = ((struct __pyx_vtabstruct_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->__pyx_vtab)->read_frames_int(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self), __pyx_v_nframes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(__pyx_v_y);
    __pyx_v_y = __pyx_t_3;
    __pyx_t_3 = 0;
    /* __pyx_t_3 released */
    goto __pyx_L7;
  }

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":633
 *         elif dtype == np.int32:
 *             y = self.read_frames_int(nframes)
 *         elif dtype == np.int16:             # <<<<<<<<<<<<<<
 *             y = self.read_frames_short(nframes)
 *         else:
 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_146); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  /* __pyx_t_3 allocated */
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_dtype, __pyx_2, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  /* __pyx_t_1 allocated */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  /* __pyx_t_3 released */
  if (__pyx_t_1) {
    /* __pyx_t_1 released */

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":634
 *             y = self.read_frames_int(nframes)
 *         elif dtype == np.int16:
 *             y = self.read_frames_short(nframes)             # <<<<<<<<<<<<<<
 *         else:
 *             RuntimeError("Sorry, dtype %s not supported" % str(dtype))
 */
    /* __pyx_t_3 allocated */
    __pyx_t_3 = ((struct __pyx_vtabstruct_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->__pyx_vtab)->read_frames_short(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self), __pyx_v_nframes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(__pyx_v_y);
    __pyx_v_y = __pyx_t_3;
    __pyx_t_3 = 0;
    /* __pyx_t_3 released */
    goto __pyx_L7;
  }
  /*else*/ {

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":636
 *             y = self.read_frames_short(nframes)
 *         else:
 *             RuntimeError("Sorry, dtype %s not supported" % str(dtype))             # <<<<<<<<<<<<<<
 * 
 *         if y.shape[1] == 1:
 */
    /* __pyx_t_3 allocated */
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_INCREF(__pyx_v_dtype);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_dtype);
    /* __pyx_t_2 allocated */
    __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 = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    /* __pyx_t_3 released */
    /* __pyx_t_3 allocated */
    __pyx_t_3 = PyNumber_Remainder(__pyx_kp_147, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    /* __pyx_t_2 released */
    /* __pyx_t_2 allocated */
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
    __pyx_t_3 = 0;
    /* __pyx_t_3 released */
    /* __pyx_t_3 allocated */
    __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    /* __pyx_t_2 released */
    Py_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    /* __pyx_t_3 released */
  }
  __pyx_L7:;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":638
 *             RuntimeError("Sorry, dtype %s not supported" % str(dtype))
 * 
 *         if y.shape[1] == 1:             # <<<<<<<<<<<<<<
 *             return y[:, 0]
 *         return y
 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_y, __pyx_kp_shape); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_2 = __Pyx_GetItemInt(__pyx_1, 1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  /* __pyx_t_3 allocated */
  __pyx_t_3 = PyObject_RichCompare(__pyx_2, __pyx_int_1, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  /* __pyx_t_1 allocated */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  /* __pyx_t_3 released */
  if (__pyx_t_1) {
    /* __pyx_t_1 released */

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":639
 * 
 *         if y.shape[1] == 1:
 *             return y[:, 0]             # <<<<<<<<<<<<<<
 *         return y
 * 
 */
    __pyx_1 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    /* __pyx_t_3 allocated */
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_1);
    Py_INCREF(__pyx_int_0);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
    __pyx_1 = 0;
    __pyx_2 = PyObject_GetItem(__pyx_v_y, ((PyObject *)__pyx_t_3)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    /* __pyx_t_3 released */
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":640
 *         if y.shape[1] == 1:
 *             return y[:, 0]
 *         return y             # <<<<<<<<<<<<<<
 * 
 *     cdef read_frames_double(Sndfile self, sf_count_t nframes):
 */
  Py_INCREF(__pyx_v_y);
  __pyx_r = __pyx_v_y;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_t_2);
  Py_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.Sndfile.read_frames");
  __pyx_r = NULL;
  __pyx_L0:;
  Py_DECREF(__pyx_v_y);
  return __pyx_r;
}

/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":642
 *         return y
 * 
 *     cdef read_frames_double(Sndfile self, sf_count_t nframes):             # <<<<<<<<<<<<<<
 *         cdef cnp.ndarray[cnp.float64_t, ndim=2] ty
 *         cdef sf_count_t res
 */

static  PyObject *__pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_read_frames_double(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *__pyx_v_self, sf_count_t __pyx_v_nframes) {
  PyArrayObject *__pyx_v_ty;
  sf_count_t __pyx_v_res;
  Py_buffer __pyx_bstruct_ty;
  Py_ssize_t __pyx_bstride_0_ty = 0;
  Py_ssize_t __pyx_bstride_1_ty = 0;
  Py_ssize_t __pyx_bshape_0_ty = 0;
  Py_ssize_t __pyx_bshape_1_ty = 0;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyArrayObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  __pyx_v_ty = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  __pyx_bstruct_ty.buf = NULL;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":646
 *         cdef sf_count_t res
 * 
 *         ty = np.empty((nframes, self._sfinfo.channels),             # <<<<<<<<<<<<<<
 *                       dtype=np.float64, order='C')
 * 
 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyLong_FromLongLong(__pyx_v_nframes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /* __pyx_t_2 allocated */
  __pyx_t_2 = PyInt_FromLong(__pyx_v_self->_sfinfo.channels); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /* __pyx_t_3 allocated */
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  /* __pyx_t_1 released */
  /* __pyx_t_2 released */
  /* __pyx_t_2 allocated */
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_3));
  __pyx_t_3 = 0;
  /* __pyx_t_3 released */
  __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":647
 * 
 *         ty = np.empty((nframes, self._sfinfo.channels),
 *                       dtype=np.float64, order='C')             # <<<<<<<<<<<<<<
 * 
 *         res = sf_readf_double(self.hdl, <double*>ty.data, nframes)
 */
  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_kp_91); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  if (PyDict_SetItem(__pyx_1, __pyx_kp_dtype, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  if (PyDict_SetItem(__pyx_1, __pyx_kp_order, __pyx_kp_148) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /* __pyx_t_3 allocated */
  __pyx_t_3 = PyEval_CallObjectWithKeywords(__pyx_2, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
  /* __pyx_t_2 released */
  if (!(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /* __pyx_t_4 allocated */
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_3);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_ty);
  /* __pyx_t_5 allocated */
  __pyx_t_5 = __Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_t_4, &__pyx_bstruct_ty, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0);
  if (unlikely(__pyx_t_5 < 0)) {
    /* __pyx_t_6 allocated */
    /* __pyx_t_7 allocated */
    /* __pyx_t_8 allocated */
    PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
    if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_v_ty, &__pyx_bstruct_ty, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0) == -1)) {
      Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
      __Pyx_RaiseBufferFallbackError();
    } else {
      PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      /* __pyx_t_6 released */
      /* __pyx_t_7 released */
      /* __pyx_t_8 released */
    }
  }
  __pyx_bstride_0_ty = __pyx_bstruct_ty.strides[0]; __pyx_bstride_1_ty = __pyx_bstruct_ty.strides[1];
  __pyx_bshape_0_ty = __pyx_bstruct_ty.shape[0]; __pyx_bshape_1_ty = __pyx_bstruct_ty.shape[1];
  if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /* __pyx_t_5 released */
  __pyx_t_4 = 0;
  /* __pyx_t_4 released */
  Py_DECREF(((PyObject *)__pyx_v_ty));
  __pyx_v_ty = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;
  /* __pyx_t_3 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":649
 *                       dtype=np.float64, order='C')
 * 
 *         res = sf_readf_double(self.hdl, <double*>ty.data, nframes)             # <<<<<<<<<<<<<<
 *         if not res == nframes:
 *             raise RuntimeError("Asked %d frames, read %d" % (nframes, res))
 */
  __pyx_v_res = sf_readf_double(__pyx_v_self->hdl, ((double *)__pyx_v_ty->data), __pyx_v_nframes);

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":650
 * 
 *         res = sf_readf_double(self.hdl, <double*>ty.data, nframes)
 *         if not res == nframes:             # <<<<<<<<<<<<<<
 *             raise RuntimeError("Asked %d frames, read %d" % (nframes, res))
 *         return ty
 */
  /* __pyx_t_9 allocated */
  __pyx_t_9 = (!(__pyx_v_res == __pyx_v_nframes));
  if (__pyx_t_9) {
    /* __pyx_t_9 released */

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":651
 *         res = sf_readf_double(self.hdl, <double*>ty.data, nframes)
 *         if not res == nframes:
 *             raise RuntimeError("Asked %d frames, read %d" % (nframes, res))             # <<<<<<<<<<<<<<
 *         return ty
 * 
 */
    /* __pyx_t_3 allocated */
    __pyx_t_3 = PyLong_FromLongLong(__pyx_v_nframes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    /* __pyx_t_2 allocated */
    __pyx_t_2 = PyLong_FromLongLong(__pyx_v_res); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    /* __pyx_t_1 allocated */
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
    __pyx_t_3 = 0;
    __pyx_t_2 = 0;
    /* __pyx_t_3 released */
    /* __pyx_t_2 released */
    /* __pyx_t_2 allocated */
    __pyx_t_2 = PyNumber_Remainder(__pyx_kp_149, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    /* __pyx_t_1 released */
    /* __pyx_t_1 allocated */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
    __pyx_t_2 = 0;
    /* __pyx_t_2 released */
    /* __pyx_t_2 allocated */
    __pyx_t_2 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    /* __pyx_t_1 released */
    __Pyx_Raise(__pyx_t_2, 0, 0);
    Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    /* __pyx_t_2 released */
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":652
 *         if not res == nframes:
 *             raise RuntimeError("Asked %d frames, read %d" % (nframes, res))
 *         return ty             # <<<<<<<<<<<<<<
 * 
 *     cdef read_frames_float(Sndfile self, sf_count_t nframes):
 */
  Py_INCREF(((PyObject *)__pyx_v_ty));
  __pyx_r = ((PyObject *)__pyx_v_ty);
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_t_1);
  Py_XDECREF(__pyx_t_2);
  Py_XDECREF(__pyx_t_3);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_ty);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.Sndfile.read_frames_double");
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_ty);
  __pyx_L2:;
  Py_DECREF(__pyx_v_ty);
  return __pyx_r;
}

/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":654
 *         return ty
 * 
 *     cdef read_frames_float(Sndfile self, sf_count_t nframes):             # <<<<<<<<<<<<<<
 *         cdef cnp.ndarray[cnp.float32_t, ndim=2] ty
 *         cdef sf_count_t res
 */

static  PyObject *__pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_read_frames_float(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *__pyx_v_self, sf_count_t __pyx_v_nframes) {
  PyArrayObject *__pyx_v_ty;
  sf_count_t __pyx_v_res;
  Py_buffer __pyx_bstruct_ty;
  Py_ssize_t __pyx_bstride_0_ty = 0;
  Py_ssize_t __pyx_bstride_1_ty = 0;
  Py_ssize_t __pyx_bshape_0_ty = 0;
  Py_ssize_t __pyx_bshape_1_ty = 0;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyArrayObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  __pyx_v_ty = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  __pyx_bstruct_ty.buf = NULL;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":659
 * 
 *         # Use Fortran order to cope with interleaving
 *         ty = np.empty((nframes, self._sfinfo.channels),             # <<<<<<<<<<<<<<
 *                       dtype=np.float32, order='F')
 * 
 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyLong_FromLongLong(__pyx_v_nframes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /* __pyx_t_2 allocated */
  __pyx_t_2 = PyInt_FromLong(__pyx_v_self->_sfinfo.channels); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /* __pyx_t_3 allocated */
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  /* __pyx_t_1 released */
  /* __pyx_t_2 released */
  /* __pyx_t_2 allocated */
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_3));
  __pyx_t_3 = 0;
  /* __pyx_t_3 released */
  __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":660
 *         # Use Fortran order to cope with interleaving
 *         ty = np.empty((nframes, self._sfinfo.channels),
 *                       dtype=np.float32, order='F')             # <<<<<<<<<<<<<<
 * 
 *         res = sf_readf_float(self.hdl, <float*>ty.data, nframes)
 */
  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_kp_144); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  if (PyDict_SetItem(__pyx_1, __pyx_kp_dtype, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  if (PyDict_SetItem(__pyx_1, __pyx_kp_order, __pyx_kp_150) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /* __pyx_t_3 allocated */
  __pyx_t_3 = PyEval_CallObjectWithKeywords(__pyx_2, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
  /* __pyx_t_2 released */
  if (!(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /* __pyx_t_4 allocated */
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_3);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_ty);
  /* __pyx_t_5 allocated */
  __pyx_t_5 = __Pyx_GetBuffer_nn___pyx_t_5numpy_float32_t((PyObject*)__pyx_t_4, &__pyx_bstruct_ty, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0);
  if (unlikely(__pyx_t_5 < 0)) {
    /* __pyx_t_6 allocated */
    /* __pyx_t_7 allocated */
    /* __pyx_t_8 allocated */
    PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
    if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float32_t((PyObject*)__pyx_v_ty, &__pyx_bstruct_ty, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0) == -1)) {
      Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
      __Pyx_RaiseBufferFallbackError();
    } else {
      PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      /* __pyx_t_6 released */
      /* __pyx_t_7 released */
      /* __pyx_t_8 released */
    }
  }
  __pyx_bstride_0_ty = __pyx_bstruct_ty.strides[0]; __pyx_bstride_1_ty = __pyx_bstruct_ty.strides[1];
  __pyx_bshape_0_ty = __pyx_bstruct_ty.shape[0]; __pyx_bshape_1_ty = __pyx_bstruct_ty.shape[1];
  if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /* __pyx_t_5 released */
  __pyx_t_4 = 0;
  /* __pyx_t_4 released */
  Py_DECREF(((PyObject *)__pyx_v_ty));
  __pyx_v_ty = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;
  /* __pyx_t_3 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":662
 *                       dtype=np.float32, order='F')
 * 
 *         res = sf_readf_float(self.hdl, <float*>ty.data, nframes)             # <<<<<<<<<<<<<<
 *         if not res == nframes:
 *             raise RuntimeError("Asked %d frames, read %d" % (nframes, res))
 */
  __pyx_v_res = sf_readf_float(__pyx_v_self->hdl, ((float *)__pyx_v_ty->data), __pyx_v_nframes);

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":663
 * 
 *         res = sf_readf_float(self.hdl, <float*>ty.data, nframes)
 *         if not res == nframes:             # <<<<<<<<<<<<<<
 *             raise RuntimeError("Asked %d frames, read %d" % (nframes, res))
 *         return ty
 */
  /* __pyx_t_9 allocated */
  __pyx_t_9 = (!(__pyx_v_res == __pyx_v_nframes));
  if (__pyx_t_9) {
    /* __pyx_t_9 released */

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":664
 *         res = sf_readf_float(self.hdl, <float*>ty.data, nframes)
 *         if not res == nframes:
 *             raise RuntimeError("Asked %d frames, read %d" % (nframes, res))             # <<<<<<<<<<<<<<
 *         return ty
 * 
 */
    /* __pyx_t_3 allocated */
    __pyx_t_3 = PyLong_FromLongLong(__pyx_v_nframes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    /* __pyx_t_2 allocated */
    __pyx_t_2 = PyLong_FromLongLong(__pyx_v_res); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    /* __pyx_t_1 allocated */
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
    __pyx_t_3 = 0;
    __pyx_t_2 = 0;
    /* __pyx_t_3 released */
    /* __pyx_t_2 released */
    /* __pyx_t_2 allocated */
    __pyx_t_2 = PyNumber_Remainder(__pyx_kp_151, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    /* __pyx_t_1 released */
    /* __pyx_t_1 allocated */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
    __pyx_t_2 = 0;
    /* __pyx_t_2 released */
    /* __pyx_t_2 allocated */
    __pyx_t_2 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    /* __pyx_t_1 released */
    __Pyx_Raise(__pyx_t_2, 0, 0);
    Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    /* __pyx_t_2 released */
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":665
 *         if not res == nframes:
 *             raise RuntimeError("Asked %d frames, read %d" % (nframes, res))
 *         return ty             # <<<<<<<<<<<<<<
 * 
 *     cdef read_frames_int(Sndfile self, sf_count_t nframes):
 */
  Py_INCREF(((PyObject *)__pyx_v_ty));
  __pyx_r = ((PyObject *)__pyx_v_ty);
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_t_1);
  Py_XDECREF(__pyx_t_2);
  Py_XDECREF(__pyx_t_3);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_ty);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.Sndfile.read_frames_float");
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_ty);
  __pyx_L2:;
  Py_DECREF(__pyx_v_ty);
  return __pyx_r;
}

/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":667
 *         return ty
 * 
 *     cdef read_frames_int(Sndfile self, sf_count_t nframes):             # <<<<<<<<<<<<<<
 *         cdef cnp.ndarray[cnp.int32_t, ndim=2] ty
 *         cdef sf_count_t res
 */

static  PyObject *__pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_read_frames_int(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *__pyx_v_self, sf_count_t __pyx_v_nframes) {
  PyArrayObject *__pyx_v_ty;
  sf_count_t __pyx_v_res;
  Py_buffer __pyx_bstruct_ty;
  Py_ssize_t __pyx_bstride_0_ty = 0;
  Py_ssize_t __pyx_bstride_1_ty = 0;
  Py_ssize_t __pyx_bshape_0_ty = 0;
  Py_ssize_t __pyx_bshape_1_ty = 0;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyArrayObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  __pyx_v_ty = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  __pyx_bstruct_ty.buf = NULL;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":672
 * 
 *         # Use Fortran order to cope with interleaving
 *         ty = np.empty((nframes, self._sfinfo.channels),             # <<<<<<<<<<<<<<
 *                       dtype=np.int, order='F')
 * 
 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyLong_FromLongLong(__pyx_v_nframes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /* __pyx_t_2 allocated */
  __pyx_t_2 = PyInt_FromLong(__pyx_v_self->_sfinfo.channels); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /* __pyx_t_3 allocated */
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  /* __pyx_t_1 released */
  /* __pyx_t_2 released */
  /* __pyx_t_2 allocated */
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_3));
  __pyx_t_3 = 0;
  /* __pyx_t_3 released */
  __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":673
 *         # Use Fortran order to cope with interleaving
 *         ty = np.empty((nframes, self._sfinfo.channels),
 *                       dtype=np.int, order='F')             # <<<<<<<<<<<<<<
 * 
 *         res = sf_readf_int(self.hdl, <int*>ty.data, nframes)
 */
  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_kp_int); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  if (PyDict_SetItem(__pyx_1, __pyx_kp_dtype, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  if (PyDict_SetItem(__pyx_1, __pyx_kp_order, __pyx_kp_152) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /* __pyx_t_3 allocated */
  __pyx_t_3 = PyEval_CallObjectWithKeywords(__pyx_2, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
  /* __pyx_t_2 released */
  if (!(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /* __pyx_t_4 allocated */
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_3);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_ty);
  /* __pyx_t_5 allocated */
  __pyx_t_5 = __Pyx_GetBuffer_nn___pyx_t_5numpy_int32_t((PyObject*)__pyx_t_4, &__pyx_bstruct_ty, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0);
  if (unlikely(__pyx_t_5 < 0)) {
    /* __pyx_t_6 allocated */
    /* __pyx_t_7 allocated */
    /* __pyx_t_8 allocated */
    PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
    if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_int32_t((PyObject*)__pyx_v_ty, &__pyx_bstruct_ty, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0) == -1)) {
      Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
      __Pyx_RaiseBufferFallbackError();
    } else {
      PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      /* __pyx_t_6 released */
      /* __pyx_t_7 released */
      /* __pyx_t_8 released */
    }
  }
  __pyx_bstride_0_ty = __pyx_bstruct_ty.strides[0]; __pyx_bstride_1_ty = __pyx_bstruct_ty.strides[1];
  __pyx_bshape_0_ty = __pyx_bstruct_ty.shape[0]; __pyx_bshape_1_ty = __pyx_bstruct_ty.shape[1];
  if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /* __pyx_t_5 released */
  __pyx_t_4 = 0;
  /* __pyx_t_4 released */
  Py_DECREF(((PyObject *)__pyx_v_ty));
  __pyx_v_ty = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;
  /* __pyx_t_3 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":675
 *                       dtype=np.int, order='F')
 * 
 *         res = sf_readf_int(self.hdl, <int*>ty.data, nframes)             # <<<<<<<<<<<<<<
 *         if not res == nframes:
 *             raise RuntimeError("Asked %d frames, read %d" % (nframes, res))
 */
  __pyx_v_res = sf_readf_int(__pyx_v_self->hdl, ((int *)__pyx_v_ty->data), __pyx_v_nframes);

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":676
 * 
 *         res = sf_readf_int(self.hdl, <int*>ty.data, nframes)
 *         if not res == nframes:             # <<<<<<<<<<<<<<
 *             raise RuntimeError("Asked %d frames, read %d" % (nframes, res))
 *         return ty
 */
  /* __pyx_t_9 allocated */
  __pyx_t_9 = (!(__pyx_v_res == __pyx_v_nframes));
  if (__pyx_t_9) {
    /* __pyx_t_9 released */

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":677
 *         res = sf_readf_int(self.hdl, <int*>ty.data, nframes)
 *         if not res == nframes:
 *             raise RuntimeError("Asked %d frames, read %d" % (nframes, res))             # <<<<<<<<<<<<<<
 *         return ty
 * 
 */
    /* __pyx_t_3 allocated */
    __pyx_t_3 = PyLong_FromLongLong(__pyx_v_nframes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    /* __pyx_t_2 allocated */
    __pyx_t_2 = PyLong_FromLongLong(__pyx_v_res); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    /* __pyx_t_1 allocated */
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
    __pyx_t_3 = 0;
    __pyx_t_2 = 0;
    /* __pyx_t_3 released */
    /* __pyx_t_2 released */
    /* __pyx_t_2 allocated */
    __pyx_t_2 = PyNumber_Remainder(__pyx_kp_153, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    /* __pyx_t_1 released */
    /* __pyx_t_1 allocated */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
    __pyx_t_2 = 0;
    /* __pyx_t_2 released */
    /* __pyx_t_2 allocated */
    __pyx_t_2 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    /* __pyx_t_1 released */
    __Pyx_Raise(__pyx_t_2, 0, 0);
    Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    /* __pyx_t_2 released */
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":678
 *         if not res == nframes:
 *             raise RuntimeError("Asked %d frames, read %d" % (nframes, res))
 *         return ty             # <<<<<<<<<<<<<<
 * 
 *     cdef read_frames_short(Sndfile self, sf_count_t nframes):
 */
  Py_INCREF(((PyObject *)__pyx_v_ty));
  __pyx_r = ((PyObject *)__pyx_v_ty);
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_t_1);
  Py_XDECREF(__pyx_t_2);
  Py_XDECREF(__pyx_t_3);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_ty);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.Sndfile.read_frames_int");
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_ty);
  __pyx_L2:;
  Py_DECREF(__pyx_v_ty);
  return __pyx_r;
}

/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":680
 *         return ty
 * 
 *     cdef read_frames_short(Sndfile self, sf_count_t nframes):             # <<<<<<<<<<<<<<
 *         cdef cnp.ndarray[cnp.int16_t, ndim=2] ty
 *         cdef sf_count_t res
 */

static  PyObject *__pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_read_frames_short(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *__pyx_v_self, sf_count_t __pyx_v_nframes) {
  PyArrayObject *__pyx_v_ty;
  sf_count_t __pyx_v_res;
  Py_buffer __pyx_bstruct_ty;
  Py_ssize_t __pyx_bstride_0_ty = 0;
  Py_ssize_t __pyx_bstride_1_ty = 0;
  Py_ssize_t __pyx_bshape_0_ty = 0;
  Py_ssize_t __pyx_bshape_1_ty = 0;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyArrayObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  __pyx_v_ty = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  __pyx_bstruct_ty.buf = NULL;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":685
 * 
 *         # Use Fortran order to cope with interleaving
 *         ty = np.empty((nframes, self._sfinfo.channels),             # <<<<<<<<<<<<<<
 *                       dtype=np.short, order='F')
 * 
 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyLong_FromLongLong(__pyx_v_nframes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /* __pyx_t_2 allocated */
  __pyx_t_2 = PyInt_FromLong(__pyx_v_self->_sfinfo.channels); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /* __pyx_t_3 allocated */
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  /* __pyx_t_1 released */
  /* __pyx_t_2 released */
  /* __pyx_t_2 allocated */
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_3));
  __pyx_t_3 = 0;
  /* __pyx_t_3 released */
  __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":686
 *         # Use Fortran order to cope with interleaving
 *         ty = np.empty((nframes, self._sfinfo.channels),
 *                       dtype=np.short, order='F')             # <<<<<<<<<<<<<<
 * 
 *         res = sf_readf_short(self.hdl, <short*>ty.data, nframes)
 */
  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_kp_short); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  if (PyDict_SetItem(__pyx_1, __pyx_kp_dtype, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  if (PyDict_SetItem(__pyx_1, __pyx_kp_order, __pyx_kp_154) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /* __pyx_t_3 allocated */
  __pyx_t_3 = PyEval_CallObjectWithKeywords(__pyx_2, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
  /* __pyx_t_2 released */
  if (!(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /* __pyx_t_4 allocated */
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_3);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_ty);
  /* __pyx_t_5 allocated */
  __pyx_t_5 = __Pyx_GetBuffer_nn___pyx_t_5numpy_int16_t((PyObject*)__pyx_t_4, &__pyx_bstruct_ty, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0);
  if (unlikely(__pyx_t_5 < 0)) {
    /* __pyx_t_6 allocated */
    /* __pyx_t_7 allocated */
    /* __pyx_t_8 allocated */
    PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
    if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_int16_t((PyObject*)__pyx_v_ty, &__pyx_bstruct_ty, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0) == -1)) {
      Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
      __Pyx_RaiseBufferFallbackError();
    } else {
      PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      /* __pyx_t_6 released */
      /* __pyx_t_7 released */
      /* __pyx_t_8 released */
    }
  }
  __pyx_bstride_0_ty = __pyx_bstruct_ty.strides[0]; __pyx_bstride_1_ty = __pyx_bstruct_ty.strides[1];
  __pyx_bshape_0_ty = __pyx_bstruct_ty.shape[0]; __pyx_bshape_1_ty = __pyx_bstruct_ty.shape[1];
  if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /* __pyx_t_5 released */
  __pyx_t_4 = 0;
  /* __pyx_t_4 released */
  Py_DECREF(((PyObject *)__pyx_v_ty));
  __pyx_v_ty = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;
  /* __pyx_t_3 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":688
 *                       dtype=np.short, order='F')
 * 
 *         res = sf_readf_short(self.hdl, <short*>ty.data, nframes)             # <<<<<<<<<<<<<<
 *         if not res == nframes:
 *             raise RuntimeError("Asked %d frames, read %d" % (nframes, res))
 */
  __pyx_v_res = sf_readf_short(__pyx_v_self->hdl, ((short *)__pyx_v_ty->data), __pyx_v_nframes);

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":689
 * 
 *         res = sf_readf_short(self.hdl, <short*>ty.data, nframes)
 *         if not res == nframes:             # <<<<<<<<<<<<<<
 *             raise RuntimeError("Asked %d frames, read %d" % (nframes, res))
 *         return ty
 */
  /* __pyx_t_9 allocated */
  __pyx_t_9 = (!(__pyx_v_res == __pyx_v_nframes));
  if (__pyx_t_9) {
    /* __pyx_t_9 released */

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":690
 *         res = sf_readf_short(self.hdl, <short*>ty.data, nframes)
 *         if not res == nframes:
 *             raise RuntimeError("Asked %d frames, read %d" % (nframes, res))             # <<<<<<<<<<<<<<
 *         return ty
 * 
 */
    /* __pyx_t_3 allocated */
    __pyx_t_3 = PyLong_FromLongLong(__pyx_v_nframes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    /* __pyx_t_2 allocated */
    __pyx_t_2 = PyLong_FromLongLong(__pyx_v_res); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    /* __pyx_t_1 allocated */
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
    __pyx_t_3 = 0;
    __pyx_t_2 = 0;
    /* __pyx_t_3 released */
    /* __pyx_t_2 released */
    /* __pyx_t_2 allocated */
    __pyx_t_2 = PyNumber_Remainder(__pyx_kp_155, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    /* __pyx_t_1 released */
    /* __pyx_t_1 allocated */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
    __pyx_t_2 = 0;
    /* __pyx_t_2 released */
    /* __pyx_t_2 allocated */
    __pyx_t_2 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    /* __pyx_t_1 released */
    __Pyx_Raise(__pyx_t_2, 0, 0);
    Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    /* __pyx_t_2 released */
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":691
 *         if not res == nframes:
 *             raise RuntimeError("Asked %d frames, read %d" % (nframes, res))
 *         return ty             # <<<<<<<<<<<<<<
 * 
 *     def write_frames(self, cnp.ndarray input):
 */
  Py_INCREF(((PyObject *)__pyx_v_ty));
  __pyx_r = ((PyObject *)__pyx_v_ty);
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_t_1);
  Py_XDECREF(__pyx_t_2);
  Py_XDECREF(__pyx_t_3);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_ty);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.Sndfile.read_frames_short");
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_ty);
  __pyx_L2:;
  Py_DECREF(__pyx_v_ty);
  return __pyx_r;
}

/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":693
 *         return ty
 * 
 *     def write_frames(self, cnp.ndarray input):             # <<<<<<<<<<<<<<
 *         """\
 *         write given number frames into file.
 */

static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_write_frames(PyObject *__pyx_v_self, PyObject *__pyx_v_input); /*proto*/
static char __pyx_doc_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_write_frames[] = "Sndfile.write_frames(self, ndarray input)\n        write given number frames into file.\n\n        Parameters\n        ----------\n        input : ndarray\n            array containing data to write.\n\n        Notes\n        -----\n        One column per channel.\n\n        updates the write pointer.\n\n        if the input type is float, and the file encoding is an integer type,\n        you should make sure the input data are normalized normalized data\n        (that is in the range [-1..1] - which will corresponds to the maximum\n        range allowed by the integer bitwidth).";
static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_write_frames(PyObject *__pyx_v_self, PyObject *__pyx_v_input) {
  int __pyx_v_nc;
  sf_count_t __pyx_v_nframes;
  PyObject *__pyx_v_res;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  sf_count_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  Py_INCREF(__pyx_v_input);
  __pyx_v_res = Py_None; Py_INCREF(Py_None);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":716
 * 
 *         # First, get the number of channels and frames from input
 *         if input.ndim == 2:             # <<<<<<<<<<<<<<
 *             nc = input.shape[1]
 *             nframes = input.size / nc
 */
  switch (((PyArrayObject *)__pyx_v_input)->nd) {
    case 2:

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":717
 *         # First, get the number of channels and frames from input
 *         if input.ndim == 2:
 *             nc = input.shape[1]             # <<<<<<<<<<<<<<
 *             nframes = input.size / nc
 *         elif input.ndim == 1:
 */
    __pyx_v_nc = (((PyArrayObject *)__pyx_v_input)->dimensions[1]);

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":718
 *         if input.ndim == 2:
 *             nc = input.shape[1]
 *             nframes = input.size / nc             # <<<<<<<<<<<<<<
 *         elif input.ndim == 1:
 *             nc = 1
 */
    __pyx_1 = PyObject_GetAttr(__pyx_v_input, __pyx_kp_size); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    /* __pyx_t_1 allocated */
    __pyx_t_1 = PyInt_FromLong(__pyx_v_nc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    /* __pyx_t_2 allocated */
    __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_1, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    /* __pyx_t_1 released */
    /* __pyx_t_3 allocated */
    __pyx_t_3 = __pyx_PyInt_AsLongLong(__pyx_t_2); if (unlikely((__pyx_t_3 == (PY_LONG_LONG)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    /* __pyx_t_2 released */
    __pyx_v_nframes = __pyx_t_3;
    /* __pyx_t_3 released */
    break;
    case 1:

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":720
 *             nframes = input.size / nc
 *         elif input.ndim == 1:
 *             nc = 1             # <<<<<<<<<<<<<<
 *             input = input[:, None]
 *             nframes = input.size
 */
    __pyx_v_nc = 1;

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":721
 *         elif input.ndim == 1:
 *             nc = 1
 *             input = input[:, None]             # <<<<<<<<<<<<<<
 *             nframes = input.size
 *         else:
 */
    __pyx_1 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    /* __pyx_t_2 allocated */
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_1);
    Py_INCREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
    __pyx_1 = 0;
    __pyx_1 = PyObject_GetItem(__pyx_v_input, ((PyObject *)__pyx_t_2)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    /* __pyx_t_2 released */
    if (!(__Pyx_TypeTest(__pyx_1, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(__pyx_v_input);
    __pyx_v_input = __pyx_1;
    __pyx_1 = 0;

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":722
 *             nc = 1
 *             input = input[:, None]
 *             nframes = input.size             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError("Expect array of rank 2, got %d" % input.ndim)
 */
    __pyx_1 = PyObject_GetAttr(__pyx_v_input, __pyx_kp_size); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    /* __pyx_t_3 allocated */
    __pyx_t_3 = __pyx_PyInt_AsLongLong(__pyx_1); if (unlikely((__pyx_t_3 == (PY_LONG_LONG)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    __pyx_v_nframes = __pyx_t_3;
    /* __pyx_t_3 released */
    break;
    default:

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":724
 *             nframes = input.size
 *         else:
 *             raise ValueError("Expect array of rank 2, got %d" % input.ndim)             # <<<<<<<<<<<<<<
 * 
 *         # Number of channels should be the one expected
 */
    /* __pyx_t_2 allocated */
    __pyx_t_2 = PyInt_FromLong(((PyArrayObject *)__pyx_v_input)->nd); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    /* __pyx_t_1 allocated */
    __pyx_t_1 = PyNumber_Remainder(__pyx_kp_156, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    /* __pyx_t_2 released */
    /* __pyx_t_2 allocated */
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
    __pyx_t_1 = 0;
    /* __pyx_t_1 released */
    /* __pyx_t_1 allocated */
    __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    /* __pyx_t_2 released */
    __Pyx_Raise(__pyx_t_1, 0, 0);
    Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    /* __pyx_t_1 released */
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    break;
  }

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":727
 * 
 *         # Number of channels should be the one expected
 *         if not nc == self._sfinfo.channels:             # <<<<<<<<<<<<<<
 *             raise ValueError("Expected %d channels, got %d" %
 *                              (self._sfinfo.channels, nc))
 */
  /* __pyx_t_4 allocated */
  __pyx_t_4 = (!(__pyx_v_nc == ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_sfinfo.channels));
  if (__pyx_t_4) {
    /* __pyx_t_4 released */

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":729
 *         if not nc == self._sfinfo.channels:
 *             raise ValueError("Expected %d channels, got %d" %
 *                              (self._sfinfo.channels, nc))             # <<<<<<<<<<<<<<
 * 
 *         input = np.require(input, requirements = 'C')
 */
    /* __pyx_t_1 allocated */
    __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_sfinfo.channels); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    /* __pyx_t_2 allocated */
    __pyx_t_2 = PyInt_FromLong(__pyx_v_nc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    /* __pyx_t_5 allocated */
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
    __pyx_t_1 = 0;
    __pyx_t_2 = 0;
    /* __pyx_t_1 released */
    /* __pyx_t_2 released */
    /* __pyx_t_2 allocated */
    __pyx_t_2 = PyNumber_Remainder(__pyx_kp_157, ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    /* __pyx_t_5 released */
    /* __pyx_t_5 allocated */
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
    __pyx_t_2 = 0;
    /* __pyx_t_2 released */
    /* __pyx_t_2 allocated */
    __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    /* __pyx_t_5 released */
    __Pyx_Raise(__pyx_t_2, 0, 0);
    Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    /* __pyx_t_2 released */
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":731
 *                              (self._sfinfo.channels, nc))
 * 
 *         input = np.require(input, requirements = 'C')             # <<<<<<<<<<<<<<
 * 
 *         # XXX: check for overflow ?
 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_require); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  /* __pyx_t_2 allocated */
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_INCREF(__pyx_v_input);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_input);
  __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_1, __pyx_kp_requirements, __pyx_kp_158) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /* __pyx_t_5 allocated */
  __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_2, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
  /* __pyx_t_2 released */
  if (!(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_v_input);
  __pyx_v_input = __pyx_t_5;
  __pyx_t_5 = 0;
  /* __pyx_t_5 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":734
 * 
 *         # XXX: check for overflow ?
 *         if input.dtype == np.float64:             # <<<<<<<<<<<<<<
 *             res = self.write_frames_double(input, nframes)
 *         elif input.dtype == np.float32:
 */
  __pyx_2 = PyObject_GetAttr(__pyx_v_input, __pyx_kp_dtype); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_91); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  /* __pyx_t_5 allocated */
  __pyx_t_5 = PyObject_RichCompare(__pyx_2, __pyx_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  /* __pyx_t_4 allocated */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  /* __pyx_t_5 released */
  if (__pyx_t_4) {
    /* __pyx_t_4 released */

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":735
 *         # XXX: check for overflow ?
 *         if input.dtype == np.float64:
 *             res = self.write_frames_double(input, nframes)             # <<<<<<<<<<<<<<
 *         elif input.dtype == np.float32:
 *             res = self.write_frames_float(input, nframes)
 */
    /* __pyx_t_5 allocated */
    __pyx_t_5 = PyLong_FromLongLong(((struct __pyx_vtabstruct_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->__pyx_vtab)->write_frames_double(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self), ((PyArrayObject *)__pyx_v_input), __pyx_v_nframes)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(__pyx_v_res);
    __pyx_v_res = __pyx_t_5;
    __pyx_t_5 = 0;
    /* __pyx_t_5 released */
    goto __pyx_L6;
  }

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":736
 *         if input.dtype == np.float64:
 *             res = self.write_frames_double(input, nframes)
 *         elif input.dtype == np.float32:             # <<<<<<<<<<<<<<
 *             res = self.write_frames_float(input, nframes)
 *         elif input.dtype == np.int:
 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_input, __pyx_kp_dtype); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_kp_144); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  /* __pyx_t_5 allocated */
  __pyx_t_5 = PyObject_RichCompare(__pyx_1, __pyx_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  /* __pyx_t_4 allocated */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  /* __pyx_t_5 released */
  if (__pyx_t_4) {
    /* __pyx_t_4 released */

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":737
 *             res = self.write_frames_double(input, nframes)
 *         elif input.dtype == np.float32:
 *             res = self.write_frames_float(input, nframes)             # <<<<<<<<<<<<<<
 *         elif input.dtype == np.int:
 *             res = self.write_frames_int(input, nframes)
 */
    /* __pyx_t_5 allocated */
    __pyx_t_5 = PyLong_FromLongLong(((struct __pyx_vtabstruct_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->__pyx_vtab)->write_frames_float(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self), ((PyArrayObject *)__pyx_v_input), __pyx_v_nframes)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(__pyx_v_res);
    __pyx_v_res = __pyx_t_5;
    __pyx_t_5 = 0;
    /* __pyx_t_5 released */
    goto __pyx_L6;
  }

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":738
 *         elif input.dtype == np.float32:
 *             res = self.write_frames_float(input, nframes)
 *         elif input.dtype == np.int:             # <<<<<<<<<<<<<<
 *             res = self.write_frames_int(input, nframes)
 *         elif input.dtype == np.short:
 */
  __pyx_2 = PyObject_GetAttr(__pyx_v_input, __pyx_kp_dtype); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_int); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  /* __pyx_t_5 allocated */
  __pyx_t_5 = PyObject_RichCompare(__pyx_2, __pyx_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  /* __pyx_t_4 allocated */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  /* __pyx_t_5 released */
  if (__pyx_t_4) {
    /* __pyx_t_4 released */

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":739
 *             res = self.write_frames_float(input, nframes)
 *         elif input.dtype == np.int:
 *             res = self.write_frames_int(input, nframes)             # <<<<<<<<<<<<<<
 *         elif input.dtype == np.short:
 *             res = self.write_frames_short(input, nframes)
 */
    /* __pyx_t_5 allocated */
    __pyx_t_5 = PyLong_FromLongLong(((struct __pyx_vtabstruct_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->__pyx_vtab)->write_frames_int(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self), ((PyArrayObject *)__pyx_v_input), __pyx_v_nframes)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(__pyx_v_res);
    __pyx_v_res = __pyx_t_5;
    __pyx_t_5 = 0;
    /* __pyx_t_5 released */
    goto __pyx_L6;
  }

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":740
 *         elif input.dtype == np.int:
 *             res = self.write_frames_int(input, nframes)
 *         elif input.dtype == np.short:             # <<<<<<<<<<<<<<
 *             res = self.write_frames_short(input, nframes)
 *         else:
 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_input, __pyx_kp_dtype); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_kp_short); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  /* __pyx_t_5 allocated */
  __pyx_t_5 = PyObject_RichCompare(__pyx_1, __pyx_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  /* __pyx_t_4 allocated */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  /* __pyx_t_5 released */
  if (__pyx_t_4) {
    /* __pyx_t_4 released */

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":741
 *             res = self.write_frames_int(input, nframes)
 *         elif input.dtype == np.short:
 *             res = self.write_frames_short(input, nframes)             # <<<<<<<<<<<<<<
 *         else:
 *             raise Exception("type of input &s not understood" % str(input.dtype))
 */
    /* __pyx_t_5 allocated */
    __pyx_t_5 = PyLong_FromLongLong(((struct __pyx_vtabstruct_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->__pyx_vtab)->write_frames_short(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self), ((PyArrayObject *)__pyx_v_input), __pyx_v_nframes)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(__pyx_v_res);
    __pyx_v_res = __pyx_t_5;
    __pyx_t_5 = 0;
    /* __pyx_t_5 released */
    goto __pyx_L6;
  }
  /*else*/ {

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":743
 *             res = self.write_frames_short(input, nframes)
 *         else:
 *             raise Exception("type of input &s not understood" % str(input.dtype))             # <<<<<<<<<<<<<<
 * 
 *         if not(res == nframes):
 */
    __pyx_2 = PyObject_GetAttr(__pyx_v_input, __pyx_kp_dtype); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    /* __pyx_t_5 allocated */
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_2);
    __pyx_2 = 0;
    /* __pyx_t_2 allocated */
    __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)&PyString_Type)), ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    /* __pyx_t_5 released */
    /* __pyx_t_5 allocated */
    __pyx_t_5 = PyNumber_Remainder(__pyx_kp_159, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    /* __pyx_t_2 released */
    /* __pyx_t_2 allocated */
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
    __pyx_t_5 = 0;
    /* __pyx_t_5 released */
    /* __pyx_t_5 allocated */
    __pyx_t_5 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    /* __pyx_t_2 released */
    __Pyx_Raise(__pyx_t_5, 0, 0);
    Py_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    /* __pyx_t_5 released */
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L6:;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":745
 *             raise Exception("type of input &s not understood" % str(input.dtype))
 * 
 *         if not(res == nframes):             # <<<<<<<<<<<<<<
 *             raise IOError("write %d frames, expected to write %d"
 *                           % res, nframes)
 */
  /* __pyx_t_5 allocated */
  __pyx_t_5 = PyLong_FromLongLong(__pyx_v_nframes); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /* __pyx_t_2 allocated */
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_res, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  /* __pyx_t_5 released */
  /* __pyx_t_4 allocated */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  /* __pyx_t_2 released */
  /* __pyx_t_6 allocated */
  __pyx_t_6 = (!__pyx_t_4);
  if (__pyx_t_6) {
    /* __pyx_t_6 released */

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":747
 *         if not(res == nframes):
 *             raise IOError("write %d frames, expected to write %d"
 *                           % res, nframes)             # <<<<<<<<<<<<<<
 * 
 *     cdef sf_count_t write_frames_double(self, cnp.ndarray input,
 */
    /* __pyx_t_2 allocated */
    __pyx_t_2 = PyNumber_Remainder(__pyx_kp_160, __pyx_v_res); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    /* __pyx_t_5 allocated */
    __pyx_t_5 = PyLong_FromLongLong(__pyx_v_nframes); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    /* __pyx_t_1 allocated */
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5);
    __pyx_t_2 = 0;
    __pyx_t_5 = 0;
    /* __pyx_t_2 released */
    /* __pyx_t_5 released */
    /* __pyx_t_5 allocated */
    __pyx_t_5 = PyObject_Call(__pyx_builtin_IOError, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    /* __pyx_t_1 released */
    __Pyx_Raise(__pyx_t_5, 0, 0);
    Py_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    /* __pyx_t_5 released */
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L7;
  }
  __pyx_L7:;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_t_1);
  Py_XDECREF(__pyx_t_2);
  Py_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.Sndfile.write_frames");
  __pyx_r = NULL;
  __pyx_L0:;
  Py_DECREF(__pyx_v_res);
  Py_DECREF(__pyx_v_input);
  return __pyx_r;
}

/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":749
 *                           % res, nframes)
 * 
 *     cdef sf_count_t write_frames_double(self, cnp.ndarray input,             # <<<<<<<<<<<<<<
 *                                         sf_count_t nframes):
 *         cdef cnp.ndarray[cnp.float64_t, ndim=2] ty
 */

static  sf_count_t __pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_write_frames_double(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *__pyx_v_self, PyArrayObject *__pyx_v_input, sf_count_t __pyx_v_nframes) {
  sf_count_t __pyx_r;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":753
 *         cdef cnp.ndarray[cnp.float64_t, ndim=2] ty
 * 
 *         return sf_writef_double(self.hdl, <double*>input.data, nframes)             # <<<<<<<<<<<<<<
 * 
 *     cdef sf_count_t write_frames_float(self, cnp.ndarray input,
 */
  __pyx_r = sf_writef_double(__pyx_v_self->hdl, ((double *)__pyx_v_input->data), __pyx_v_nframes);
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}

/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":755
 *         return sf_writef_double(self.hdl, <double*>input.data, nframes)
 * 
 *     cdef sf_count_t write_frames_float(self, cnp.ndarray input,             # <<<<<<<<<<<<<<
 *                                        sf_count_t nframes):
 *         cdef cnp.ndarray[cnp.float32_t, ndim=2] ty
 */

static  sf_count_t __pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_write_frames_float(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *__pyx_v_self, PyArrayObject *__pyx_v_input, sf_count_t __pyx_v_nframes) {
  sf_count_t __pyx_r;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":759
 *         cdef cnp.ndarray[cnp.float32_t, ndim=2] ty
 * 
 *         return sf_writef_float(self.hdl, <float*>input.data, nframes)             # <<<<<<<<<<<<<<
 * 
 *     cdef sf_count_t write_frames_int(self, cnp.ndarray input,
 */
  __pyx_r = sf_writef_float(__pyx_v_self->hdl, ((float *)__pyx_v_input->data), __pyx_v_nframes);
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}

/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":761
 *         return sf_writef_float(self.hdl, <float*>input.data, nframes)
 * 
 *     cdef sf_count_t write_frames_int(self, cnp.ndarray input,             # <<<<<<<<<<<<<<
 *                                      sf_count_t nframes):
 *         cdef cnp.ndarray[cnp.int32_t, ndim=2] ty
 */

static  sf_count_t __pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_write_frames_int(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *__pyx_v_self, PyArrayObject *__pyx_v_input, sf_count_t __pyx_v_nframes) {
  sf_count_t __pyx_r;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":765
 *         cdef cnp.ndarray[cnp.int32_t, ndim=2] ty
 * 
 *         return sf_writef_int(self.hdl, <int*>input.data, nframes)             # <<<<<<<<<<<<<<
 * 
 *     cdef sf_count_t write_frames_short(self, cnp.ndarray input,
 */
  __pyx_r = sf_writef_int(__pyx_v_self->hdl, ((int *)__pyx_v_input->data), __pyx_v_nframes);
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}

/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":767
 *         return sf_writef_int(self.hdl, <int*>input.data, nframes)
 * 
 *     cdef sf_count_t write_frames_short(self, cnp.ndarray input,             # <<<<<<<<<<<<<<
 *                                        sf_count_t nframes):
 *         cdef cnp.ndarray[cnp.int16_t, ndim=2] ty
 */

static  sf_count_t __pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_write_frames_short(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *__pyx_v_self, PyArrayObject *__pyx_v_input, sf_count_t __pyx_v_nframes) {
  sf_count_t __pyx_r;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":771
 *         cdef cnp.ndarray[cnp.int16_t, ndim=2] ty
 * 
 *         return sf_writef_short(self.hdl, <short*>input.data, nframes)             # <<<<<<<<<<<<<<
 * 
 *     def seek(Sndfile self, sf_count_t offset, int whence=0, mode='rw'):
 */
  __pyx_r = sf_writef_short(__pyx_v_self->hdl, ((short *)__pyx_v_input->data), __pyx_v_nframes);
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}

/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":773
 *         return sf_writef_short(self.hdl, <short*>input.data, nframes)
 * 
 *     def seek(Sndfile self, sf_count_t offset, int whence=0, mode='rw'):             # <<<<<<<<<<<<<<
 *         """\
 *         Seek into audio file: similar to python seek function, taking only in
 */

static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_seek(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_seek[] = "Sndfile.seek(self, scikits.audiolab.pysndfile.sndfile.sf_count_t offset, int whence=0, mode=rw)\n        Seek into audio file: similar to python seek function, taking only in\n        account audio data.\n\n        Parameters\n        ----------\n        offset : int\n            the number of frames (eg two samples for stereo files) to move\n            relatively to position set by whence.\n        whence : int\n            only 0 (beginning), 1 (current) and 2 (end of the file) are\n            valid.\n        mode : string\n            If set to 'rw', both read and write pointers are updated. If\n            'r' is given, only read pointer is updated, if 'w', only the\n            write one is (this may of course make sense only if you open\n            the file in a certain mode).\n\n        Returns\n        -------\n        offset : int\n            the number of frames from the beginning of the file\n\n        Notes\n        -----\n\n        Offset relative to audio data: meta-data are ignored.\n\n        if an invalid seek is given (beyond or before the file), an IOError is\n        launched; note that this is different from the seek method of a File\n        object.";
static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_seek(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  sf_count_t __pyx_v_offset;
  int __pyx_v_whence;
  PyObject *__pyx_v_mode = 0;
  sf_count_t __pyx_v_st;
  PyObject *__pyx_v_msg;
  PyObject *__pyx_r;
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  static PyObject **__pyx_pyargnames[] = {&__pyx_kp_offset,&__pyx_kp_whence,&__pyx_kp_mode,0};
  __pyx_v_whence = 0;
  __pyx_v_mode = __pyx_kp_93;
  if (unlikely(__pyx_kwds)) {
    PyObject* values[3] = {0,0,0};
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      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_kp_offset);
      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), "seek") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_offset = __pyx_PyInt_AsLongLong(values[0]); if (unlikely((__pyx_v_offset == (PY_LONG_LONG)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    if (values[1]) {
      __pyx_v_whence = __pyx_PyInt_int(values[1]); if (unlikely((__pyx_v_whence == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    if (values[2]) {
      __pyx_v_mode = values[2];
    }
  } else {
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  3: __pyx_v_mode = PyTuple_GET_ITEM(__pyx_args, 2);
      case  2: __pyx_v_whence = __pyx_PyInt_int(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_whence == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      case  1: __pyx_v_offset = __pyx_PyInt_AsLongLong(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_offset == (PY_LONG_LONG)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      break;
      default: goto __pyx_L5_argtuple_error;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("seek", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.Sndfile.seek");
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_v_msg = Py_None; Py_INCREF(Py_None);

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":806
 *         object."""
 *         cdef sf_count_t st
 *         if mode == 'rw':             # <<<<<<<<<<<<<<
 *             # Update both read and write pointers
 *             st = sf_seek(self.hdl, offset, whence)
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_mode, __pyx_kp_161, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /* __pyx_t_2 allocated */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /* __pyx_t_1 released */
  if (__pyx_t_2) {
    /* __pyx_t_2 released */

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":808
 *         if mode == 'rw':
 *             # Update both read and write pointers
 *             st = sf_seek(self.hdl, offset, whence)             # <<<<<<<<<<<<<<
 *         elif mode == 'r':
 *             whence = whence | SFM_READ
 */
    __pyx_v_st = sf_seek(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->hdl, __pyx_v_offset, __pyx_v_whence);
    goto __pyx_L6;
  }

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":809
 *             # Update both read and write pointers
 *             st = sf_seek(self.hdl, offset, whence)
 *         elif mode == 'r':             # <<<<<<<<<<<<<<
 *             whence = whence | SFM_READ
 *             st = sf_seek(self.hdl, offset, whence)
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_mode, __pyx_kp_162, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /* __pyx_t_2 allocated */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /* __pyx_t_1 released */
  if (__pyx_t_2) {
    /* __pyx_t_2 released */

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":810
 *             st = sf_seek(self.hdl, offset, whence)
 *         elif mode == 'r':
 *             whence = whence | SFM_READ             # <<<<<<<<<<<<<<
 *             st = sf_seek(self.hdl, offset, whence)
 *         elif mode == 'w':
 */
    __pyx_v_whence = (__pyx_v_whence | SFM_READ);

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":811
 *         elif mode == 'r':
 *             whence = whence | SFM_READ
 *             st = sf_seek(self.hdl, offset, whence)             # <<<<<<<<<<<<<<
 *         elif mode == 'w':
 *             whence = whence | SFM_WRITE
 */
    __pyx_v_st = sf_seek(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->hdl, __pyx_v_offset, __pyx_v_whence);
    goto __pyx_L6;
  }

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":812
 *             whence = whence | SFM_READ
 *             st = sf_seek(self.hdl, offset, whence)
 *         elif mode == 'w':             # <<<<<<<<<<<<<<
 *             whence = whence | SFM_WRITE
 *             st = sf_seek(self.hdl, offset, whence)
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_mode, __pyx_kp_163, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /* __pyx_t_2 allocated */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /* __pyx_t_1 released */
  if (__pyx_t_2) {
    /* __pyx_t_2 released */

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":813
 *             st = sf_seek(self.hdl, offset, whence)
 *         elif mode == 'w':
 *             whence = whence | SFM_WRITE             # <<<<<<<<<<<<<<
 *             st = sf_seek(self.hdl, offset, whence)
 *         else:
 */
    __pyx_v_whence = (__pyx_v_whence | SFM_WRITE);

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":814
 *         elif mode == 'w':
 *             whence = whence | SFM_WRITE
 *             st = sf_seek(self.hdl, offset, whence)             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError("mode should be one of 'r', 'w' or 'rw' only")
 */
    __pyx_v_st = sf_seek(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->hdl, __pyx_v_offset, __pyx_v_whence);
    goto __pyx_L6;
  }
  /*else*/ {

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":816
 *             st = sf_seek(self.hdl, offset, whence)
 *         else:
 *             raise ValueError("mode should be one of 'r', 'w' or 'rw' only")             # <<<<<<<<<<<<<<
 * 
 *         if st == -1:
 */
    /* __pyx_t_1 allocated */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_INCREF(__pyx_kp_164);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_164);
    /* __pyx_t_3 allocated */
    __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    /* __pyx_t_1 released */
    __Pyx_Raise(__pyx_t_3, 0, 0);
    Py_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    /* __pyx_t_3 released */
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L6:;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":818
 *             raise ValueError("mode should be one of 'r', 'w' or 'rw' only")
 * 
 *         if st == -1:             # <<<<<<<<<<<<<<
 *             msg = "Error while seeking, libsndfile error is %s" \
 *                   % sf_strerror(self.hdl)
 */
  /* __pyx_t_2 allocated */
  __pyx_t_2 = (__pyx_v_st == -1);
  if (__pyx_t_2) {
    /* __pyx_t_2 released */

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":820
 *         if st == -1:
 *             msg = "Error while seeking, libsndfile error is %s" \
 *                   % sf_strerror(self.hdl)             # <<<<<<<<<<<<<<
 *             raise IOError(msg)
 *         return st
 */
    /* __pyx_t_3 allocated */
    __pyx_t_3 = __Pyx_PyBytes_FromString(sf_strerror(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->hdl)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    /* __pyx_t_1 allocated */
    __pyx_t_1 = PyNumber_Remainder(__pyx_kp_165, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    /* __pyx_t_3 released */
    Py_DECREF(__pyx_v_msg);
    __pyx_v_msg = __pyx_t_1;
    __pyx_t_1 = 0;
    /* __pyx_t_1 released */

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":821
 *             msg = "Error while seeking, libsndfile error is %s" \
 *                   % sf_strerror(self.hdl)
 *             raise IOError(msg)             # <<<<<<<<<<<<<<
 *         return st
 * 
 */
    /* __pyx_t_1 allocated */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_INCREF(__pyx_v_msg);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_msg);
    /* __pyx_t_3 allocated */
    __pyx_t_3 = PyObject_Call(__pyx_builtin_IOError, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    /* __pyx_t_1 released */
    __Pyx_Raise(__pyx_t_3, 0, 0);
    Py_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    /* __pyx_t_3 released */
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":822
 *                   % sf_strerror(self.hdl)
 *             raise IOError(msg)
 *         return st             # <<<<<<<<<<<<<<
 * 
 * cdef int_to_format(int format):
 */
  /* __pyx_t_3 allocated */
  __pyx_t_3 = PyLong_FromLongLong(__pyx_v_st); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  /* __pyx_t_3 released */
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  Py_XDECREF(__pyx_t_1);
  Py_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.Sndfile.seek");
  __pyx_r = NULL;
  __pyx_L0:;
  Py_DECREF(__pyx_v_msg);
  return __pyx_r;
}

/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":824
 *         return st
 * 
 * cdef int_to_format(int format):             # <<<<<<<<<<<<<<
 *     """Gives a triple of strings (format, encoding, endian) given actual format
 *     integer, as used internally by sndfile."""
 */

static  PyObject *__pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_int_to_format(int __pyx_v_format) {
  int __pyx_v_ctype;
  int __pyx_v_cencoding;
  int __pyx_v_cendian;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":828
 *     integer, as used internally by sndfile."""
 *     cdef int ctype, cencoding, cendian
 *     ctype = format & SF_FORMAT_TYPEMASK             # <<<<<<<<<<<<<<
 *     cencoding = format & SF_FORMAT_SUBMASK
 *     cendian = format & SF_FORMAT_ENDMASK
 */
  __pyx_v_ctype = (__pyx_v_format & SF_FORMAT_TYPEMASK);

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":829
 *     cdef int ctype, cencoding, cendian
 *     ctype = format & SF_FORMAT_TYPEMASK
 *     cencoding = format & SF_FORMAT_SUBMASK             # <<<<<<<<<<<<<<
 *     cendian = format & SF_FORMAT_ENDMASK
 * 
 */
  __pyx_v_cencoding = (__pyx_v_format & SF_FORMAT_SUBMASK);

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":830
 *     ctype = format & SF_FORMAT_TYPEMASK
 *     cencoding = format & SF_FORMAT_SUBMASK
 *     cendian = format & SF_FORMAT_ENDMASK             # <<<<<<<<<<<<<<
 * 
 *     if not format == (ctype | cencoding | cendian):
 */
  __pyx_v_cendian = (__pyx_v_format & SF_FORMAT_ENDMASK);

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":832
 *     cendian = format & SF_FORMAT_ENDMASK
 * 
 *     if not format == (ctype | cencoding | cendian):             # <<<<<<<<<<<<<<
 *         raise RuntimeError("Inconsistent format: this is a bug")
 * 
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = (!(__pyx_v_format == ((__pyx_v_ctype | __pyx_v_cencoding) | __pyx_v_cendian)));
  if (__pyx_t_1) {
    /* __pyx_t_1 released */

    /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":833
 * 
 *     if not format == (ctype | cencoding | cendian):
 *         raise RuntimeError("Inconsistent format: this is a bug")             # <<<<<<<<<<<<<<
 * 
 *     return _ENUM_TO_STR_FILE_FORMAT[ctype], \
 */
    /* __pyx_t_2 allocated */
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_INCREF(__pyx_kp_166);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_166);
    /* __pyx_t_3 allocated */
    __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    /* __pyx_t_2 released */
    __Pyx_Raise(__pyx_t_3, 0, 0);
    Py_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    /* __pyx_t_3 released */
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":835
 *         raise RuntimeError("Inconsistent format: this is a bug")
 * 
 *     return _ENUM_TO_STR_FILE_FORMAT[ctype], \             # <<<<<<<<<<<<<<
 *            _ENUM_TO_STR_ENCODING[cencoding], \
 *            _ENUM_TO_STR_ENDIAN[cendian]
 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_86); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_2 = __Pyx_GetItemInt(__pyx_1, __pyx_v_ctype, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":836
 * 
 *     return _ENUM_TO_STR_FILE_FORMAT[ctype], \
 *            _ENUM_TO_STR_ENCODING[cencoding], \             # <<<<<<<<<<<<<<
 *            _ENUM_TO_STR_ENDIAN[cendian]
 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_85); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_3 = __Pyx_GetItemInt(__pyx_1, __pyx_v_cencoding, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":837
 *     return _ENUM_TO_STR_FILE_FORMAT[ctype], \
 *            _ENUM_TO_STR_ENCODING[cencoding], \
 *            _ENUM_TO_STR_ENDIAN[cendian]             # <<<<<<<<<<<<<<
 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__ENUM_TO_STR_ENDIAN); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_4 = __Pyx_GetItemInt(__pyx_1, __pyx_v_cendian, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  /* __pyx_t_3 allocated */
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_3);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_4);
  __pyx_2 = 0;
  __pyx_3 = 0;
  __pyx_4 = 0;
  __pyx_r = ((PyObject *)__pyx_t_3);
  __pyx_t_3 = 0;
  /* __pyx_t_3 released */
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_t_2);
  Py_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.int_to_format");
  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}

/* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":50
 *         # experimental exception made for __getbuffer__ and __releasebuffer__
 *         # -- the details of this may change.
 *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
 *             # This implementation of getbuffer is geared towards Cython
 *             # requirements, and does not yet fullfill the PEP.
 */

static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  int __pyx_v_copy_shape;
  int __pyx_v_i;
  int __pyx_v_ndim;
  int __pyx_v_t;
  char *__pyx_v_f;
  PyArray_Descr *__pyx_v_descr = 0;
  int __pyx_v_hasfields;
  int __pyx_r;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  char *__pyx_t_5;
  if (__pyx_v_info == NULL) return 0;
  __pyx_v_info->obj = Py_None; Py_INCREF(Py_None);

  /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":56
 *             # of flags
 *             cdef int copy_shape, i, ndim
 *             ndim = PyArray_NDIM(self)             # <<<<<<<<<<<<<<
 * 
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 */
  __pyx_v_ndim = PyArray_NDIM(((PyArrayObject *)__pyx_v_self));

  /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":58
 *             ndim = PyArray_NDIM(self)
 * 
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
 *                 copy_shape = 1
 *             else:
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t)));
  if (__pyx_t_1) {
    /* __pyx_t_1 released */

    /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":59
 * 
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 *                 copy_shape = 1             # <<<<<<<<<<<<<<
 *             else:
 *                 copy_shape = 0
 */
    __pyx_v_copy_shape = 1;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":61
 *                 copy_shape = 1
 *             else:
 *                 copy_shape = 0             # <<<<<<<<<<<<<<
 * 
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
 */
    __pyx_v_copy_shape = 0;
  }
  __pyx_L5:;

  /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":63
 *                 copy_shape = 0
 * 
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
 *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
 *                 raise ValueError("ndarray is not C contiguous")
 */
  if (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS)) {

    /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":64
 * 
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):             # <<<<<<<<<<<<<<
 *                 raise ValueError("ndarray is not C contiguous")
 * 
 */
    /* __pyx_t_1 allocated */
    __pyx_t_1 = (!PyArray_CHKFLAGS(((PyArrayObject *)__pyx_v_self), NPY_C_CONTIGUOUS));
  } else {
    __pyx_t_1 = ((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS);
  }
  if (__pyx_t_1) {
    /* __pyx_t_1 released */

    /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":65
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
 *                 raise ValueError("ndarray is not C contiguous")             # <<<<<<<<<<<<<<
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 */
    /* __pyx_t_2 allocated */
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_INCREF(__pyx_kp_1);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_1);
    /* __pyx_t_3 allocated */
    __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    /* __pyx_t_2 released */
    __Pyx_Raise(__pyx_t_3, 0, 0);
    Py_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    /* __pyx_t_3 released */
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":67
 *                 raise ValueError("ndarray is not C contiguous")
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
 *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
 *                 raise ValueError("ndarray is not Fortran contiguous")
 */
  if (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS)) {

    /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":68
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):             # <<<<<<<<<<<<<<
 *                 raise ValueError("ndarray is not Fortran contiguous")
 * 
 */
    /* __pyx_t_1 allocated */
    __pyx_t_1 = (!PyArray_CHKFLAGS(((PyArrayObject *)__pyx_v_self), NPY_F_CONTIGUOUS));
  } else {
    __pyx_t_1 = ((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS);
  }
  if (__pyx_t_1) {
    /* __pyx_t_1 released */

    /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":69
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
 *                 raise ValueError("ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
 * 
 *             info.buf = PyArray_DATA(self)
 */
    /* __pyx_t_3 allocated */
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_INCREF(__pyx_kp_2);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_2);
    /* __pyx_t_2 allocated */
    __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    /* __pyx_t_3 released */
    __Pyx_Raise(__pyx_t_2, 0, 0);
    Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    /* __pyx_t_2 released */
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":71
 *                 raise ValueError("ndarray is not Fortran contiguous")
 * 
 *             info.buf = PyArray_DATA(self)             # <<<<<<<<<<<<<<
 *             info.ndim = ndim
 *             if copy_shape:
 */
  __pyx_v_info->buf = PyArray_DATA(((PyArrayObject *)__pyx_v_self));

  /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":72
 * 
 *             info.buf = PyArray_DATA(self)
 *             info.ndim = ndim             # <<<<<<<<<<<<<<
 *             if copy_shape:
 *                 # Allocate new buffer for strides and shape info. This is allocated
 */
  __pyx_v_info->ndim = __pyx_v_ndim;

  /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":73
 *             info.buf = PyArray_DATA(self)
 *             info.ndim = ndim
 *             if copy_shape:             # <<<<<<<<<<<<<<
 *                 # Allocate new buffer for strides and shape info. This is allocated
 *                 # as one block, strides first.
 */
  /* __pyx_t_4 allocated */
  __pyx_t_4 = __pyx_v_copy_shape;
  if (__pyx_t_4) {
    /* __pyx_t_4 released */

    /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":76
 *                 # Allocate new buffer for strides and shape info. This is allocated
 *                 # as one block, strides first.
 *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2)             # <<<<<<<<<<<<<<
 *                 info.shape = info.strides + ndim
 *                 for i in range(ndim):
 */
    __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * __pyx_v_ndim) * 2)));

    /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":77
 *                 # as one block, strides first.
 *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2)
 *                 info.shape = info.strides + ndim             # <<<<<<<<<<<<<<
 *                 for i in range(ndim):
 *                     info.strides[i] = PyArray_STRIDES(self)[i]
 */
    __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);

    /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":78
 *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2)
 *                 info.shape = info.strides + ndim
 *                 for i in range(ndim):             # <<<<<<<<<<<<<<
 *                     info.strides[i] = PyArray_STRIDES(self)[i]
 *                     info.shape[i] = PyArray_DIMS(self)[i]
 */
    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_ndim; __pyx_v_i+=1) {

      /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":79
 *                 info.shape = info.strides + ndim
 *                 for i in range(ndim):
 *                     info.strides[i] = PyArray_STRIDES(self)[i]             # <<<<<<<<<<<<<<
 *                     info.shape[i] = PyArray_DIMS(self)[i]
 *             else:
 */
      (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(((PyArrayObject *)__pyx_v_self))[__pyx_v_i]);

      /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":80
 *                 for i in range(ndim):
 *                     info.strides[i] = PyArray_STRIDES(self)[i]
 *                     info.shape[i] = PyArray_DIMS(self)[i]             # <<<<<<<<<<<<<<
 *             else:
 *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
 */
      (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(((PyArrayObject *)__pyx_v_self))[__pyx_v_i]);
    }
    goto __pyx_L8;
  }
  /*else*/ {

    /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":82
 *                     info.shape[i] = PyArray_DIMS(self)[i]
 *             else:
 *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)             # <<<<<<<<<<<<<<
 *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
 *             info.suboffsets = NULL
 */
    __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(((PyArrayObject *)__pyx_v_self)));

    /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":83
 *             else:
 *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
 *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)             # <<<<<<<<<<<<<<
 *             info.suboffsets = NULL
 *             info.itemsize = PyArray_ITEMSIZE(self)
 */
    __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(((PyArrayObject *)__pyx_v_self)));
  }
  __pyx_L8:;

  /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":84
 *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
 *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
 *             info.suboffsets = NULL             # <<<<<<<<<<<<<<
 *             info.itemsize = PyArray_ITEMSIZE(self)
 *             info.readonly = not PyArray_ISWRITEABLE(self)
 */
  __pyx_v_info->suboffsets = NULL;

  /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":85
 *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
 *             info.suboffsets = NULL
 *             info.itemsize = PyArray_ITEMSIZE(self)             # <<<<<<<<<<<<<<
 *             info.readonly = not PyArray_ISWRITEABLE(self)
 * 
 */
  __pyx_v_info->itemsize = PyArray_ITEMSIZE(((PyArrayObject *)__pyx_v_self));

  /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":86
 *             info.suboffsets = NULL
 *             info.itemsize = PyArray_ITEMSIZE(self)
 *             info.readonly = not PyArray_ISWRITEABLE(self)             # <<<<<<<<<<<<<<
 * 
 *             cdef int t
 */
  __pyx_v_info->readonly = (!PyArray_ISWRITEABLE(((PyArrayObject *)__pyx_v_self)));

  /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":89
 * 
 *             cdef int t
 *             cdef char* f = NULL             # <<<<<<<<<<<<<<
 *             cdef dtype descr = self.descr
 *             cdef list stack
 */
  __pyx_v_f = NULL;

  /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":90
 *             cdef int t
 *             cdef char* f = NULL
 *             cdef dtype descr = self.descr             # <<<<<<<<<<<<<<
 *             cdef list stack
 * 
 */
  Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_v_self)->descr));
  __pyx_v_descr = ((PyArrayObject *)__pyx_v_self)->descr;

  /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":93
 *             cdef list stack
 * 
 *             cdef bint hasfields = PyDataType_HASFIELDS(descr)             # <<<<<<<<<<<<<<
 * 
 *             # Ugly hack warning:
 */
  __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr);

  /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":103
 *             # functions).
 * 
 *             if not hasfields and not copy_shape:             # <<<<<<<<<<<<<<
 *                 # do not call releasebuffer
 *                 info.obj = None
 */
  if ((!__pyx_v_hasfields)) {
    /* __pyx_t_1 allocated */
    __pyx_t_1 = (!__pyx_v_copy_shape);
  } else {
    __pyx_t_1 = (!__pyx_v_hasfields);
  }
  if (__pyx_t_1) {
    /* __pyx_t_1 released */

    /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":105
 *             if not hasfields and not copy_shape:
 *                 # do not call releasebuffer
 *                 info.obj = None             # <<<<<<<<<<<<<<
 *             else:
 *                 # need to call releasebuffer
 */
    Py_INCREF(Py_None);
    Py_DECREF(__pyx_v_info->obj);
    __pyx_v_info->obj = Py_None;
    goto __pyx_L11;
  }
  /*else*/ {

    /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":108
 *             else:
 *                 # need to call releasebuffer
 *                 info.obj = self             # <<<<<<<<<<<<<<
 * 
 *             if not hasfields:
 */
    Py_INCREF(__pyx_v_self);
    Py_DECREF(__pyx_v_info->obj);
    __pyx_v_info->obj = __pyx_v_self;
  }
  __pyx_L11:;

  /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":110
 *                 info.obj = self
 * 
 *             if not hasfields:             # <<<<<<<<<<<<<<
 *                 t = descr.type_num
 *                 if   t == NPY_BYTE:        f = "b"
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = (!__pyx_v_hasfields);
  if (__pyx_t_1) {
    /* __pyx_t_1 released */

    /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":111
 * 
 *             if not hasfields:
 *                 t = descr.type_num             # <<<<<<<<<<<<<<
 *                 if   t == NPY_BYTE:        f = "b"
 *                 elif t == NPY_UBYTE:       f = "B"
 */
    __pyx_v_t = __pyx_v_descr->type_num;

    /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":112
 *             if not hasfields:
 *                 t = descr.type_num
 *                 if   t == NPY_BYTE:        f = "b"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_UBYTE:       f = "B"
 *                 elif t == NPY_SHORT:       f = "h"
 */
    switch (__pyx_v_t) {
      case NPY_BYTE:
      __pyx_v_f = __pyx_k_3;
      break;
      case NPY_UBYTE:

      /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":113
 *                 t = descr.type_num
 *                 if   t == NPY_BYTE:        f = "b"
 *                 elif t == NPY_UBYTE:       f = "B"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_SHORT:       f = "h"
 *                 elif t == NPY_USHORT:      f = "H"
 */
      __pyx_v_f = __pyx_k_4;
      break;
      case NPY_SHORT:

      /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":114
 *                 if   t == NPY_BYTE:        f = "b"
 *                 elif t == NPY_UBYTE:       f = "B"
 *                 elif t == NPY_SHORT:       f = "h"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_USHORT:      f = "H"
 *                 elif t == NPY_INT:         f = "i"
 */
      __pyx_v_f = __pyx_k_5;
      break;
      case NPY_USHORT:

      /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":115
 *                 elif t == NPY_UBYTE:       f = "B"
 *                 elif t == NPY_SHORT:       f = "h"
 *                 elif t == NPY_USHORT:      f = "H"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_INT:         f = "i"
 *                 elif t == NPY_UINT:        f = "I"
 */
      __pyx_v_f = __pyx_k_6;
      break;
      case NPY_INT:

      /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":116
 *                 elif t == NPY_SHORT:       f = "h"
 *                 elif t == NPY_USHORT:      f = "H"
 *                 elif t == NPY_INT:         f = "i"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_UINT:        f = "I"
 *                 elif t == NPY_LONG:        f = "l"
 */
      __pyx_v_f = __pyx_k_7;
      break;
      case NPY_UINT:

      /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":117
 *                 elif t == NPY_USHORT:      f = "H"
 *                 elif t == NPY_INT:         f = "i"
 *                 elif t == NPY_UINT:        f = "I"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_LONG:        f = "l"
 *                 elif t == NPY_ULONG:       f = "L"
 */
      __pyx_v_f = __pyx_k_8;
      break;
      case NPY_LONG:

      /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":118
 *                 elif t == NPY_INT:         f = "i"
 *                 elif t == NPY_UINT:        f = "I"
 *                 elif t == NPY_LONG:        f = "l"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_ULONG:       f = "L"
 *                 elif t == NPY_LONGLONG:    f = "q"
 */
      __pyx_v_f = __pyx_k_9;
      break;
      case NPY_ULONG:

      /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":119
 *                 elif t == NPY_UINT:        f = "I"
 *                 elif t == NPY_LONG:        f = "l"
 *                 elif t == NPY_ULONG:       f = "L"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_LONGLONG:    f = "q"
 *                 elif t == NPY_ULONGLONG:   f = "Q"
 */
      __pyx_v_f = __pyx_k_10;
      break;
      case NPY_LONGLONG:

      /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":120
 *                 elif t == NPY_LONG:        f = "l"
 *                 elif t == NPY_ULONG:       f = "L"
 *                 elif t == NPY_LONGLONG:    f = "q"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_ULONGLONG:   f = "Q"
 *                 elif t == NPY_FLOAT:       f = "f"
 */
      __pyx_v_f = __pyx_k_11;
      break;
      case NPY_ULONGLONG:

      /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":121
 *                 elif t == NPY_ULONG:       f = "L"
 *                 elif t == NPY_LONGLONG:    f = "q"
 *                 elif t == NPY_ULONGLONG:   f = "Q"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_FLOAT:       f = "f"
 *                 elif t == NPY_DOUBLE:      f = "d"
 */
      __pyx_v_f = __pyx_k_12;
      break;
      case NPY_FLOAT:

      /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":122
 *                 elif t == NPY_LONGLONG:    f = "q"
 *                 elif t == NPY_ULONGLONG:   f = "Q"
 *                 elif t == NPY_FLOAT:       f = "f"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_DOUBLE:      f = "d"
 *                 elif t == NPY_LONGDOUBLE:  f = "g"
 */
      __pyx_v_f = __pyx_k_13;
      break;
      case NPY_DOUBLE:

      /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":123
 *                 elif t == NPY_ULONGLONG:   f = "Q"
 *                 elif t == NPY_FLOAT:       f = "f"
 *                 elif t == NPY_DOUBLE:      f = "d"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_LONGDOUBLE:  f = "g"
 *                 elif t == NPY_CFLOAT:      f = "Zf"
 */
      __pyx_v_f = __pyx_k_14;
      break;
      case NPY_LONGDOUBLE:

      /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":124
 *                 elif t == NPY_FLOAT:       f = "f"
 *                 elif t == NPY_DOUBLE:      f = "d"
 *                 elif t == NPY_LONGDOUBLE:  f = "g"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_CFLOAT:      f = "Zf"
 *                 elif t == NPY_CDOUBLE:     f = "Zd"
 */
      __pyx_v_f = __pyx_k_15;
      break;
      case NPY_CFLOAT:

      /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":125
 *                 elif t == NPY_DOUBLE:      f = "d"
 *                 elif t == NPY_LONGDOUBLE:  f = "g"
 *                 elif t == NPY_CFLOAT:      f = "Zf"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_CDOUBLE:     f = "Zd"
 *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
 */
      __pyx_v_f = __pyx_k_16;
      break;
      case NPY_CDOUBLE:

      /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":126
 *                 elif t == NPY_LONGDOUBLE:  f = "g"
 *                 elif t == NPY_CFLOAT:      f = "Zf"
 *                 elif t == NPY_CDOUBLE:     f = "Zd"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
 *                 elif t == NPY_OBJECT:      f = "O"
 */
      __pyx_v_f = __pyx_k_17;
      break;
      case NPY_CLONGDOUBLE:

      /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":127
 *                 elif t == NPY_CFLOAT:      f = "Zf"
 *                 elif t == NPY_CDOUBLE:     f = "Zd"
 *                 elif t == NPY_CLONGDOUBLE: f = "Zg"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_OBJECT:      f = "O"
 *                 else:
 */
      __pyx_v_f = __pyx_k_18;
      break;
      case NPY_OBJECT:

      /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":128
 *                 elif t == NPY_CDOUBLE:     f = "Zd"
 *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
 *                 elif t == NPY_OBJECT:      f = "O"             # <<<<<<<<<<<<<<
 *                 else:
 *                     raise ValueError("unknown dtype code in numpy.pxd (%d)" % t)
 */
      __pyx_v_f = __pyx_k_19;
      break;
      default:

      /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":130
 *                 elif t == NPY_OBJECT:      f = "O"
 *                 else:
 *                     raise ValueError("unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
 *                 info.format = f
 *                 return
 */
      /* __pyx_t_2 allocated */
      __pyx_t_2 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      /* __pyx_t_3 allocated */
      __pyx_t_3 = PyNumber_Remainder(__pyx_kp_20, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      /* __pyx_t_2 released */
      /* __pyx_t_2 allocated */
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
      __pyx_t_3 = 0;
      /* __pyx_t_3 released */
      /* __pyx_t_3 allocated */
      __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      /* __pyx_t_2 released */
      __Pyx_Raise(__pyx_t_3, 0, 0);
      Py_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      /* __pyx_t_3 released */
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      break;
    }

    /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":131
 *                 else:
 *                     raise ValueError("unknown dtype code in numpy.pxd (%d)" % t)
 *                 info.format = f             # <<<<<<<<<<<<<<
 *                 return
 *             else:
 */
    __pyx_v_info->format = __pyx_v_f;

    /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":132
 *                     raise ValueError("unknown dtype code in numpy.pxd (%d)" % t)
 *                 info.format = f
 *                 return             # <<<<<<<<<<<<<<
 *             else:
 *                 info.format = <char*>stdlib.malloc(255) # static size
 */
    __pyx_r = 0;
    goto __pyx_L0;
    goto __pyx_L12;
  }
  /*else*/ {

    /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":134
 *                 return
 *             else:
 *                 info.format = <char*>stdlib.malloc(255) # static size             # <<<<<<<<<<<<<<
 *                 f = _util_dtypestring(descr, info.format, info.format + 255)
 *                 f[0] = 0 # Terminate format string
 */
    __pyx_v_info->format = ((char *)malloc(255));

    /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":135
 *             else:
 *                 info.format = <char*>stdlib.malloc(255) # static size
 *                 f = _util_dtypestring(descr, info.format, info.format + 255)             # <<<<<<<<<<<<<<
 *                 f[0] = 0 # Terminate format string
 * 
 */
    /* __pyx_t_5 allocated */
    __pyx_t_5 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, __pyx_v_info->format, (__pyx_v_info->format + 255)); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_f = __pyx_t_5;
    /* __pyx_t_5 released */

    /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":136
 *                 info.format = <char*>stdlib.malloc(255) # static size
 *                 f = _util_dtypestring(descr, info.format, info.format + 255)
 *                 f[0] = 0 # Terminate format string             # <<<<<<<<<<<<<<
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):
 */
    (__pyx_v_f[0]) = 0;
  }
  __pyx_L12:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  Py_XDECREF(__pyx_t_2);
  Py_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("numpy.ndarray.__getbuffer__");
  __pyx_r = -1;
  Py_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  if (__pyx_v_info->obj == Py_None) { Py_DECREF(Py_None); __pyx_v_info->obj = NULL; }
  __pyx_L2:;
  Py_XDECREF(__pyx_v_descr);
  return __pyx_r;
}

/* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":138
 *                 f[0] = 0 # Terminate format string
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
 *             if PyArray_HASFIELDS(self):
 *                 stdlib.free(info.format)
 */

static void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
static void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
  int __pyx_t_1;
  int __pyx_t_2;

  /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":139
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):
 *             if PyArray_HASFIELDS(self):             # <<<<<<<<<<<<<<
 *                 stdlib.free(info.format)
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyArray_HASFIELDS(((PyArrayObject *)__pyx_v_self));
  if (__pyx_t_1) {
    /* __pyx_t_1 released */

    /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":140
 *         def __releasebuffer__(ndarray self, Py_buffer* info):
 *             if PyArray_HASFIELDS(self):
 *                 stdlib.free(info.format)             # <<<<<<<<<<<<<<
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 *                 stdlib.free(info.strides)
 */
    free(__pyx_v_info->format);
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":141
 *             if PyArray_HASFIELDS(self):
 *                 stdlib.free(info.format)
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
 *                 stdlib.free(info.strides)
 *                 # info.shape was stored after info.strides in the same block
 */
  /* __pyx_t_2 allocated */
  __pyx_t_2 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t)));
  if (__pyx_t_2) {
    /* __pyx_t_2 released */

    /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":142
 *                 stdlib.free(info.format)
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 *                 stdlib.free(info.strides)             # <<<<<<<<<<<<<<
 *                 # info.shape was stored after info.strides in the same block
 * 
 */
    free(__pyx_v_info->strides);
    goto __pyx_L6;
  }
  __pyx_L6:;

}

/* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":248
 * 
 * 
 * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end) except NULL:             # <<<<<<<<<<<<<<
 *     # Recursive utility function used in __getbuffer__ to get format
 *     # string. The new location in the format string is returned.
 */

static INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end) {
  PyArray_Descr *__pyx_v_child;
  PyObject *__pyx_v_i;
  PyObject *__pyx_v_t;
  char *__pyx_r;
  PyObject *__pyx_1 = 0;
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  char *__pyx_t_6;
  __pyx_v_child = ((PyArray_Descr *)Py_None); Py_INCREF(Py_None);
  __pyx_v_i = ((PyObject *)Py_None); Py_INCREF(Py_None);
  __pyx_v_t = Py_None; Py_INCREF(Py_None);

  /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":254
 *     cdef dtype child
 *     cdef tuple i
 *     for i in descr.fields.itervalues():             # <<<<<<<<<<<<<<
 *         child = i[0]
 *         if not PyDataType_HASFIELDS(child):
 */
  /* __pyx_t_1 allocated */
  __pyx_1 = PyObject_GetAttr(__pyx_v_descr->fields, __pyx_kp_itervalues); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /* __pyx_t_2 allocated */
  __pyx_t_2 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  /* __pyx_t_3 allocated */
  if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_1 = 0; __pyx_t_3 = __pyx_t_2; Py_INCREF(__pyx_t_3);
  } else {
    __pyx_t_1 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  /* __pyx_t_2 released */
  for (;;) {
    /* __pyx_t_2 allocated */
    if (likely(PyList_CheckExact(__pyx_t_3))) {
      if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_3)) break;
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_1); Py_INCREF(__pyx_t_2); __pyx_t_1++;
    } else if (likely(PyTuple_CheckExact(__pyx_t_3))) {
      if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); Py_INCREF(__pyx_t_2); __pyx_t_1++;
    } else {
      __pyx_t_2 = PyIter_Next(__pyx_t_3);
      if (!__pyx_t_2) {
        if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        break;
      }
    }
    if (!(likely(PyTuple_CheckExact(__pyx_t_2)) || (__pyx_t_2) == Py_None || (PyErr_Format(PyExc_TypeError, "Expected tuple, got %s", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(((PyObject *)__pyx_v_i));
    __pyx_v_i = ((PyObject *)__pyx_t_2);
    __pyx_t_2 = 0;
    /* __pyx_t_2 released */

    /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":255
 *     cdef tuple i
 *     for i in descr.fields.itervalues():
 *         child = i[0]             # <<<<<<<<<<<<<<
 *         if not PyDataType_HASFIELDS(child):
 *             t = child.type_num
 */
    __pyx_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_i), 0, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (!(__Pyx_TypeTest(__pyx_1, __pyx_ptype_5numpy_dtype))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(((PyObject *)__pyx_v_child));
    __pyx_v_child = ((PyArray_Descr *)__pyx_1);
    __pyx_1 = 0;

    /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":256
 *     for i in descr.fields.itervalues():
 *         child = i[0]
 *         if not PyDataType_HASFIELDS(child):             # <<<<<<<<<<<<<<
 *             t = child.type_num
 *             if end - f < 15: # this should leave room for "T{" and "}" as well
 */
    /* __pyx_t_4 allocated */
    __pyx_t_4 = (!PyDataType_HASFIELDS(__pyx_v_child));
    if (__pyx_t_4) {
      /* __pyx_t_4 released */

      /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":257
 *         child = i[0]
 *         if not PyDataType_HASFIELDS(child):
 *             t = child.type_num             # <<<<<<<<<<<<<<
 *             if end - f < 15: # this should leave room for "T{" and "}" as well
 *                 raise RuntimeError("Format string allocated too short.")
 */
      /* __pyx_t_2 allocated */
      __pyx_t_2 = PyInt_FromLong(__pyx_v_child->type_num); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_v_t);
      __pyx_v_t = __pyx_t_2;
      __pyx_t_2 = 0;
      /* __pyx_t_2 released */

      /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":258
 *         if not PyDataType_HASFIELDS(child):
 *             t = child.type_num
 *             if end - f < 15: # this should leave room for "T{" and "}" as well             # <<<<<<<<<<<<<<
 *                 raise RuntimeError("Format string allocated too short.")
 * 
 */
      /* __pyx_t_4 allocated */
      __pyx_t_4 = ((__pyx_v_end - __pyx_v_f) < 15);
      if (__pyx_t_4) {
        /* __pyx_t_4 released */

        /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":259
 *             t = child.type_num
 *             if end - f < 15: # this should leave room for "T{" and "}" as well
 *                 raise RuntimeError("Format string allocated too short.")             # <<<<<<<<<<<<<<
 * 
 *             # Until ticket #99 is fixed, use integers to avoid warnings
 */
        /* __pyx_t_2 allocated */
        __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        Py_INCREF(__pyx_kp_21);
        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_21);
        /* __pyx_t_5 allocated */
        __pyx_t_5 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
        /* __pyx_t_2 released */
        __Pyx_Raise(__pyx_t_5, 0, 0);
        Py_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        /* __pyx_t_5 released */
        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        goto __pyx_L6;
      }
      __pyx_L6:;

      /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":262
 * 
 *             # Until ticket #99 is fixed, use integers to avoid warnings
 *             if   t == NPY_BYTE:        f[0] =  98 #"b"             # <<<<<<<<<<<<<<
 *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"
 */
      /* __pyx_t_5 allocated */
      __pyx_t_5 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      /* __pyx_t_2 allocated */
      __pyx_t_2 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      /* __pyx_t_5 released */
      /* __pyx_t_4 allocated */
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      /* __pyx_t_2 released */
      if (__pyx_t_4) {
        /* __pyx_t_4 released */
        (__pyx_v_f[0]) = 98;
        goto __pyx_L7;
      }

      /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":263
 *             # Until ticket #99 is fixed, use integers to avoid warnings
 *             if   t == NPY_BYTE:        f[0] =  98 #"b"
 *             elif t == NPY_UBYTE:       f[0] =  66 #"B"             # <<<<<<<<<<<<<<
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"
 */
      /* __pyx_t_2 allocated */
      __pyx_t_2 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      /* __pyx_t_5 allocated */
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_2, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      /* __pyx_t_2 released */
      /* __pyx_t_4 allocated */
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      /* __pyx_t_5 released */
      if (__pyx_t_4) {
        /* __pyx_t_4 released */
        (__pyx_v_f[0]) = 66;
        goto __pyx_L7;
      }

      /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":264
 *             if   t == NPY_BYTE:        f[0] =  98 #"b"
 *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"             # <<<<<<<<<<<<<<
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"
 *             elif t == NPY_INT:         f[0] = 105 #"i"
 */
      /* __pyx_t_5 allocated */
      __pyx_t_5 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      /* __pyx_t_2 allocated */
      __pyx_t_2 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      /* __pyx_t_5 released */
      /* __pyx_t_4 allocated */
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      /* __pyx_t_2 released */
      if (__pyx_t_4) {
        /* __pyx_t_4 released */
        (__pyx_v_f[0]) = 104;
        goto __pyx_L7;
      }

      /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":265
 *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"             # <<<<<<<<<<<<<<
 *             elif t == NPY_INT:         f[0] = 105 #"i"
 *             elif t == NPY_UINT:        f[0] =  73 #"I"
 */
      /* __pyx_t_2 allocated */
      __pyx_t_2 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      /* __pyx_t_5 allocated */
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_2, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      /* __pyx_t_2 released */
      /* __pyx_t_4 allocated */
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      /* __pyx_t_5 released */
      if (__pyx_t_4) {
        /* __pyx_t_4 released */
        (__pyx_v_f[0]) = 72;
        goto __pyx_L7;
      }

      /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":266
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"
 *             elif t == NPY_INT:         f[0] = 105 #"i"             # <<<<<<<<<<<<<<
 *             elif t == NPY_UINT:        f[0] =  73 #"I"
 *             elif t == NPY_LONG:        f[0] = 108 #"l"
 */
      /* __pyx_t_5 allocated */
      __pyx_t_5 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      /* __pyx_t_2 allocated */
      __pyx_t_2 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      /* __pyx_t_5 released */
      /* __pyx_t_4 allocated */
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      /* __pyx_t_2 released */
      if (__pyx_t_4) {
        /* __pyx_t_4 released */
        (__pyx_v_f[0]) = 105;
        goto __pyx_L7;
      }

      /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":267
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"
 *             elif t == NPY_INT:         f[0] = 105 #"i"
 *             elif t == NPY_UINT:        f[0] =  73 #"I"             # <<<<<<<<<<<<<<
 *             elif t == NPY_LONG:        f[0] = 108 #"l"
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"
 */
      /* __pyx_t_2 allocated */
      __pyx_t_2 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      /* __pyx_t_5 allocated */
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_2, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      /* __pyx_t_2 released */
      /* __pyx_t_4 allocated */
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      /* __pyx_t_5 released */
      if (__pyx_t_4) {
        /* __pyx_t_4 released */
        (__pyx_v_f[0]) = 73;
        goto __pyx_L7;
      }

      /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":268
 *             elif t == NPY_INT:         f[0] = 105 #"i"
 *             elif t == NPY_UINT:        f[0] =  73 #"I"
 *             elif t == NPY_LONG:        f[0] = 108 #"l"             # <<<<<<<<<<<<<<
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
 */
      /* __pyx_t_5 allocated */
      __pyx_t_5 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      /* __pyx_t_2 allocated */
      __pyx_t_2 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      /* __pyx_t_5 released */
      /* __pyx_t_4 allocated */
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      /* __pyx_t_2 released */
      if (__pyx_t_4) {
        /* __pyx_t_4 released */
        (__pyx_v_f[0]) = 108;
        goto __pyx_L7;
      }

      /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":269
 *             elif t == NPY_UINT:        f[0] =  73 #"I"
 *             elif t == NPY_LONG:        f[0] = 108 #"l"
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"             # <<<<<<<<<<<<<<
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
 */
      /* __pyx_t_2 allocated */
      __pyx_t_2 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      /* __pyx_t_5 allocated */
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_2, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      /* __pyx_t_2 released */
      /* __pyx_t_4 allocated */
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      /* __pyx_t_5 released */
      if (__pyx_t_4) {
        /* __pyx_t_4 released */
        (__pyx_v_f[0]) = 76;
        goto __pyx_L7;
      }

      /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":270
 *             elif t == NPY_LONG:        f[0] = 108 #"l"
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"             # <<<<<<<<<<<<<<
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
 */
      /* __pyx_t_5 allocated */
      __pyx_t_5 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      /* __pyx_t_2 allocated */
      __pyx_t_2 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      /* __pyx_t_5 released */
      /* __pyx_t_4 allocated */
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      /* __pyx_t_2 released */
      if (__pyx_t_4) {
        /* __pyx_t_4 released */
        (__pyx_v_f[0]) = 113;
        goto __pyx_L7;
      }

      /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":271
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"             # <<<<<<<<<<<<<<
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
 */
      /* __pyx_t_2 allocated */
      __pyx_t_2 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      /* __pyx_t_5 allocated */
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_2, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      /* __pyx_t_2 released */
      /* __pyx_t_4 allocated */
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      /* __pyx_t_5 released */
      if (__pyx_t_4) {
        /* __pyx_t_4 released */
        (__pyx_v_f[0]) = 81;
        goto __pyx_L7;
      }

      /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":272
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"             # <<<<<<<<<<<<<<
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
 */
      /* __pyx_t_5 allocated */
      __pyx_t_5 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      /* __pyx_t_2 allocated */
      __pyx_t_2 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      /* __pyx_t_5 released */
      /* __pyx_t_4 allocated */
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      /* __pyx_t_2 released */
      if (__pyx_t_4) {
        /* __pyx_t_4 released */
        (__pyx_v_f[0]) = 102;
        goto __pyx_L7;
      }

      /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":273
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"             # <<<<<<<<<<<<<<
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1
 */
      /* __pyx_t_2 allocated */
      __pyx_t_2 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      /* __pyx_t_5 allocated */
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_2, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      /* __pyx_t_2 released */
      /* __pyx_t_4 allocated */
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      /* __pyx_t_5 released */
      if (__pyx_t_4) {
        /* __pyx_t_4 released */
        (__pyx_v_f[0]) = 100;
        goto __pyx_L7;
      }

      /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":274
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"             # <<<<<<<<<<<<<<
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1
 */
      /* __pyx_t_5 allocated */
      __pyx_t_5 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      /* __pyx_t_2 allocated */
      __pyx_t_2 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      /* __pyx_t_5 released */
      /* __pyx_t_4 allocated */
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      /* __pyx_t_2 released */
      if (__pyx_t_4) {
        /* __pyx_t_4 released */
        (__pyx_v_f[0]) = 103;
        goto __pyx_L7;
      }

      /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":275
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1             # <<<<<<<<<<<<<<
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1
 *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1
 */
      /* __pyx_t_2 allocated */
      __pyx_t_2 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      /* __pyx_t_5 allocated */
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_2, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      /* __pyx_t_2 released */
      /* __pyx_t_4 allocated */
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      /* __pyx_t_5 released */
      if (__pyx_t_4) {
        /* __pyx_t_4 released */
        (__pyx_v_f[0]) = 90;
        (__pyx_v_f[1]) = 102;
        __pyx_v_f += 1;
        goto __pyx_L7;
      }

      /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":276
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1             # <<<<<<<<<<<<<<
 *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1
 *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
 */
      /* __pyx_t_5 allocated */
      __pyx_t_5 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      /* __pyx_t_2 allocated */
      __pyx_t_2 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      /* __pyx_t_5 released */
      /* __pyx_t_4 allocated */
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      /* __pyx_t_2 released */
      if (__pyx_t_4) {
        /* __pyx_t_4 released */
        (__pyx_v_f[0]) = 90;
        (__pyx_v_f[1]) = 100;
        __pyx_v_f += 1;
        goto __pyx_L7;
      }

      /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":277
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1
 *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1             # <<<<<<<<<<<<<<
 *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
 *             else:
 */
      /* __pyx_t_2 allocated */
      __pyx_t_2 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      /* __pyx_t_5 allocated */
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_2, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      /* __pyx_t_2 released */
      /* __pyx_t_4 allocated */
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      /* __pyx_t_5 released */
      if (__pyx_t_4) {
        /* __pyx_t_4 released */
        (__pyx_v_f[0]) = 90;
        (__pyx_v_f[1]) = 103;
        __pyx_v_f += 1;
        goto __pyx_L7;
      }

      /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":278
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1
 *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1
 *             elif t == NPY_OBJECT:      f[0] = 79 #"O"             # <<<<<<<<<<<<<<
 *             else:
 *                 raise ValueError("unknown dtype code in numpy.pxd (%d)" % t)
 */
      /* __pyx_t_5 allocated */
      __pyx_t_5 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      /* __pyx_t_2 allocated */
      __pyx_t_2 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      /* __pyx_t_5 released */
      /* __pyx_t_4 allocated */
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      /* __pyx_t_2 released */
      if (__pyx_t_4) {
        /* __pyx_t_4 released */
        (__pyx_v_f[0]) = 79;
        goto __pyx_L7;
      }
      /*else*/ {

        /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":280
 *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
 *             else:
 *                 raise ValueError("unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
 *             f += 1
 *         else:
 */
        /* __pyx_t_2 allocated */
        __pyx_t_2 = PyNumber_Remainder(__pyx_kp_22, __pyx_v_t); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        /* __pyx_t_5 allocated */
        __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
        __pyx_t_2 = 0;
        /* __pyx_t_2 released */
        /* __pyx_t_2 allocated */
        __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        Py_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
        /* __pyx_t_5 released */
        __Pyx_Raise(__pyx_t_2, 0, 0);
        Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        /* __pyx_t_2 released */
        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_L7:;

      /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":281
 *             else:
 *                 raise ValueError("unknown dtype code in numpy.pxd (%d)" % t)
 *             f += 1             # <<<<<<<<<<<<<<
 *         else:
 *             f[0] = 84 #"T"
 */
      __pyx_v_f += 1;
      goto __pyx_L5;
    }
    /*else*/ {

      /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":283
 *             f += 1
 *         else:
 *             f[0] = 84 #"T"             # <<<<<<<<<<<<<<
 *             f[1] = 123 #"{"
 *             f += 2
 */
      (__pyx_v_f[0]) = 84;

      /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":284
 *         else:
 *             f[0] = 84 #"T"
 *             f[1] = 123 #"{"             # <<<<<<<<<<<<<<
 *             f += 2
 *             f = _util_dtypestring(child, f, end)
 */
      (__pyx_v_f[1]) = 123;

      /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":285
 *             f[0] = 84 #"T"
 *             f[1] = 123 #"{"
 *             f += 2             # <<<<<<<<<<<<<<
 *             f = _util_dtypestring(child, f, end)
 *             f[0] = 125 #"}"
 */
      __pyx_v_f += 2;

      /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":286
 *             f[1] = 123 #"{"
 *             f += 2
 *             f = _util_dtypestring(child, f, end)             # <<<<<<<<<<<<<<
 *             f[0] = 125 #"}"
 *             f += 1
 */
      /* __pyx_t_6 allocated */
      __pyx_t_6 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_v_f = __pyx_t_6;
      /* __pyx_t_6 released */

      /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":287
 *             f += 2
 *             f = _util_dtypestring(child, f, end)
 *             f[0] = 125 #"}"             # <<<<<<<<<<<<<<
 *             f += 1
 *     return f
 */
      (__pyx_v_f[0]) = 125;

      /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":288
 *             f = _util_dtypestring(child, f, end)
 *             f[0] = 125 #"}"
 *             f += 1             # <<<<<<<<<<<<<<
 *     return f
 * 
 */
      __pyx_v_f += 1;
    }
    __pyx_L5:;
  }
  /* __pyx_t_1 released */
  Py_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  /* __pyx_t_3 released */

  /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":289
 *             f[0] = 125 #"}"
 *             f += 1
 *     return f             # <<<<<<<<<<<<<<
 * 
 */
  __pyx_r = __pyx_v_f;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_t_2);
  Py_XDECREF(__pyx_t_3);
  Py_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("numpy._util_dtypestring");
  __pyx_r = NULL;
  __pyx_L0:;
  Py_DECREF(__pyx_v_child);
  Py_DECREF(__pyx_v_i);
  Py_DECREF(__pyx_v_t);
  return __pyx_r;
}
static struct __pyx_vtabstruct_7scikits_8audiolab_9pysndfile_8_sndfile_Format __pyx_vtable_7scikits_8audiolab_9pysndfile_8_sndfile_Format;

static PyObject *__pyx_tp_new_7scikits_8audiolab_9pysndfile_8_sndfile_Format(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)o);
  p->__pyx_vtab = __pyx_vtabptr_7scikits_8audiolab_9pysndfile_8_sndfile_Format;
  p->_type = Py_None; Py_INCREF(Py_None);
  p->_encoding = Py_None; Py_INCREF(Py_None);
  p->_endianness = Py_None; Py_INCREF(Py_None);
  p->_format_str = Py_None; Py_INCREF(Py_None);
  p->_encoding_str = Py_None; Py_INCREF(Py_None);
  p->_endian_str = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7scikits_8audiolab_9pysndfile_8_sndfile_Format(PyObject *o) {
  struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *p = (struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)o;
  Py_XDECREF(p->_type);
  Py_XDECREF(p->_encoding);
  Py_XDECREF(p->_endianness);
  Py_XDECREF(p->_format_str);
  Py_XDECREF(p->_encoding_str);
  Py_XDECREF(p->_endian_str);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7scikits_8audiolab_9pysndfile_8_sndfile_Format(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *p = (struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)o;
  if (p->_type) {
    e = (*v)(p->_type, a); if (e) return e;
  }
  if (p->_encoding) {
    e = (*v)(p->_encoding, a); if (e) return e;
  }
  if (p->_endianness) {
    e = (*v)(p->_endianness, a); if (e) return e;
  }
  if (p->_format_str) {
    e = (*v)(p->_format_str, a); if (e) return e;
  }
  if (p->_encoding_str) {
    e = (*v)(p->_encoding_str, a); if (e) return e;
  }
  if (p->_endian_str) {
    e = (*v)(p->_endian_str, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7scikits_8audiolab_9pysndfile_8_sndfile_Format(PyObject *o) {
  struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *p = (struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->_type);
  p->_type = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_encoding);
  p->_encoding = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_endianness);
  p->_endianness = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_format_str);
  p->_format_str = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_encoding_str);
  p->_encoding_str = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_endian_str);
  p->_endian_str = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_file_format(PyObject *o, void *x) {
  return __pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_11file_format___get__(o);
}

static PyObject *__pyx_getprop_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_encoding(PyObject *o, void *x) {
  return __pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_8encoding___get__(o);
}

static PyObject *__pyx_getprop_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_endianness(PyObject *o, void *x) {
  return __pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_10endianness___get__(o);
}

static PyObject *__pyx_getprop_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_file_format_description(PyObject *o, void *x) {
  return __pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_23file_format_description___get__(o);
}

static PyObject *__pyx_getprop_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_encoding_description(PyObject *o, void *x) {
  return __pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_20encoding_description___get__(o);
}

static struct PyMethodDef __pyx_methods_7scikits_8audiolab_9pysndfile_8_sndfile_Format[] = {
  {"__copy__", (PyCFunction)__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format___copy__, METH_NOARGS, __pyx_doc_7scikits_8audiolab_9pysndfile_8_sndfile_6Format___copy__},
  {"__deepcopy__", (PyCFunction)__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format___deepcopy__, METH_NOARGS, __pyx_doc_7scikits_8audiolab_9pysndfile_8_sndfile_6Format___deepcopy__},
  {"__str__", (PyCFunction)__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format___str__, METH_NOARGS|METH_COEXIST, 0},
  {"__repr__", (PyCFunction)__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format___repr__, METH_NOARGS|METH_COEXIST, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7scikits_8audiolab_9pysndfile_8_sndfile_Format[] = {
  {(char *)"file_format", __pyx_getprop_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_file_format, 0, __pyx_k_23, 0},
  {(char *)"encoding", __pyx_getprop_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_encoding, 0, __pyx_k_24, 0},
  {(char *)"endianness", __pyx_getprop_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_endianness, 0, __pyx_k_25, 0},
  {(char *)"file_format_description", __pyx_getprop_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_file_format_description, 0, __pyx_k_26, 0},
  {(char *)"encoding_description", __pyx_getprop_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_encoding_description, 0, __pyx_k_27, 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Format = {
  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*/
  0, /*nb_long*/
  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_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_Format = {
  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_Format = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Format = {
  #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
};

PyTypeObject __pyx_type_7scikits_8audiolab_9pysndfile_8_sndfile_Format = {
  PyVarObject_HEAD_INIT(0, 0)
  "scikits.audiolab.pysndfile._sndfile.Format", /*tp_name*/
  sizeof(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7scikits_8audiolab_9pysndfile_8_sndfile_Format, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  __pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format___repr__, /*tp_repr*/
  &__pyx_tp_as_number_Format, /*tp_as_number*/
  &__pyx_tp_as_sequence_Format, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Format, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format___str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_Format, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "Format(type=wav, encoding=pcm16, endianness=file)\n    This class represents an audio file format. It knows about audio file\n    format (wav, aiff, etc...), encoding (pcm, etc...) and endianness.\n\n    Parameters\n    ----------\n    type : str\n        the major file format (wav, etc...).\n    encoding : str\n        the encoding (pcm16, etc..).\n    endianness : str\n        the endianess.\n\n    Notes\n    -----\n    The possible values for type, and encoding depend on your installed\n    libsndfile. You can query the possible values with the functions\n    available_file_formats and available_encodings.\n\n    See also\n    --------\n    Sndfile class.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7scikits_8audiolab_9pysndfile_8_sndfile_Format, /*tp_traverse*/
  __pyx_tp_clear_7scikits_8audiolab_9pysndfile_8_sndfile_Format, /*tp_clear*/
  __pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format___richcmp__, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7scikits_8audiolab_9pysndfile_8_sndfile_Format, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7scikits_8audiolab_9pysndfile_8_sndfile_Format, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7scikits_8audiolab_9pysndfile_8_sndfile_Format, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile __pyx_vtable_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile;

static PyObject *__pyx_tp_new_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)o);
  p->__pyx_vtab = __pyx_vtabptr_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile;
  p->filename = Py_None; Py_INCREF(Py_None);
  p->_format = ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile(PyObject *o) {
  struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *p = (struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)o;
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile___dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_XDECREF(p->filename);
  Py_XDECREF(((PyObject *)p->_format));
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *p = (struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)o;
  if (p->filename) {
    e = (*v)(p->filename, a); if (e) return e;
  }
  if (p->_format) {
    e = (*v)(((PyObject*)p->_format), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile(PyObject *o) {
  struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *p = (struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->filename);
  p->filename = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_format);
  p->_format = ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_nframes(PyObject *o, void *x) {
  return __pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_7nframes___get__(o);
}

static PyObject *__pyx_getprop_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_samplerate(PyObject *o, void *x) {
  return __pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_10samplerate___get__(o);
}

static PyObject *__pyx_getprop_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_channels(PyObject *o, void *x) {
  return __pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_8channels___get__(o);
}

static PyObject *__pyx_getprop_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_format(PyObject *o, void *x) {
  return __pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_6format___get__(o);
}

static PyObject *__pyx_getprop_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_file_format(PyObject *o, void *x) {
  return __pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_11file_format___get__(o);
}

static PyObject *__pyx_getprop_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_encoding(PyObject *o, void *x) {
  return __pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_8encoding___get__(o);
}

static PyObject *__pyx_getprop_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_endianness(PyObject *o, void *x) {
  return __pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_10endianness___get__(o);
}

static struct PyMethodDef __pyx_methods_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile[] = {
  {"close", (PyCFunction)__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_close, METH_NOARGS, __pyx_doc_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_close},
  {"sync", (PyCFunction)__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_sync, METH_NOARGS, __pyx_doc_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_sync},
  {"__str__", (PyCFunction)__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile___str__, METH_NOARGS|METH_COEXIST, 0},
  {"read_frames", (PyCFunction)__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_read_frames, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_read_frames},
  {"write_frames", (PyCFunction)__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_write_frames, METH_O, __pyx_doc_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_write_frames},
  {"seek", (PyCFunction)__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_seek, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_seek},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile[] = {
  {(char *)"nframes", __pyx_getprop_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_nframes, 0, __pyx_k_28, 0},
  {(char *)"samplerate", __pyx_getprop_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_samplerate, 0, __pyx_k_29, 0},
  {(char *)"channels", __pyx_getprop_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_channels, 0, __pyx_k_30, 0},
  {(char *)"format", __pyx_getprop_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_format, 0, __pyx_k_31, 0},
  {(char *)"file_format", __pyx_getprop_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_file_format, 0, 0, 0},
  {(char *)"encoding", __pyx_getprop_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_encoding, 0, 0, 0},
  {(char *)"endianness", __pyx_getprop_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_endianness, 0, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Sndfile = {
  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*/
  0, /*nb_long*/
  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_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_Sndfile = {
  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_Sndfile = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Sndfile = {
  #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
};

PyTypeObject __pyx_type_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile = {
  PyVarObject_HEAD_INIT(0, 0)
  "scikits.audiolab.pysndfile._sndfile.Sndfile", /*tp_name*/
  sizeof(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  0, /*tp_repr*/
  &__pyx_tp_as_number_Sndfile, /*tp_as_number*/
  &__pyx_tp_as_sequence_Sndfile, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Sndfile, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile___str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_Sndfile, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "Sndfile(filename, mode=r, Format format=None, int channels=0, int samplerate=0)\n    Sndfile is the core class to read/write audio files. Once an instance is\n    created, it can be used to read and/or writes data from numpy arrays, query\n    the audio file meta-data, etc...\n\n    Parameters\n    ----------\n    filename : string or int\n        name of the file to open (string), or file descriptor (integer)\n    mode : string\n        'r' for read, 'w' for write, or 'rw' for read and\n        write.\n    format : Format\n        Required when opening a new file for writing, or to read raw audio\n        files (without header).\n    channels : int\n        number of channels.\n    samplerate : int\n        sampling rate.\n\n    Returns\n    -------\n        sndfile: as Sndfile instance.\n\n    Notes\n    -----\n    format, channels and samplerate need to be given only in the write modes\n    and for raw files.", /*tp_doc*/
  __pyx_tp_traverse_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile, /*tp_traverse*/
  __pyx_tp_clear_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
};

static struct PyMethodDef __pyx_methods[] = {
  {"sndfile_version", (PyCFunction)__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_sndfile_version, METH_NOARGS, __pyx_doc_7scikits_8audiolab_9pysndfile_8_sndfile_sndfile_version},
  {"available_file_formats", (PyCFunction)__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_available_file_formats, METH_NOARGS, __pyx_doc_7scikits_8audiolab_9pysndfile_8_sndfile_available_file_formats},
  {"available_encodings", (PyCFunction)__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_available_encodings, METH_O, __pyx_doc_7scikits_8audiolab_9pysndfile_8_sndfile_available_encodings},
  {0, 0, 0, 0}
};

static void __pyx_init_filenames(void); /*proto*/

#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef __pyx_moduledef = {
    PyModuleDef_HEAD_INIT,
    "_sndfile",
    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___init__, __pyx_k___init__, sizeof(__pyx_k___init__), 1, 1, 1},
  {&__pyx_kp___copy__, __pyx_k___copy__, sizeof(__pyx_k___copy__), 1, 1, 1},
  {&__pyx_kp___deepcopy__, __pyx_k___deepcopy__, sizeof(__pyx_k___deepcopy__), 1, 1, 1},
  {&__pyx_kp___richcmp__, __pyx_k___richcmp__, sizeof(__pyx_k___richcmp__), 1, 1, 1},
  {&__pyx_kp___str__, __pyx_k___str__, sizeof(__pyx_k___str__), 1, 1, 1},
  {&__pyx_kp___repr__, __pyx_k___repr__, sizeof(__pyx_k___repr__), 1, 1, 1},
  {&__pyx_kp___dealloc__, __pyx_k___dealloc__, sizeof(__pyx_k___dealloc__), 1, 1, 1},
  {&__pyx_kp_close, __pyx_k_close, sizeof(__pyx_k_close), 1, 1, 1},
  {&__pyx_kp_sync, __pyx_k_sync, sizeof(__pyx_k_sync), 1, 1, 1},
  {&__pyx_kp_read_frames, __pyx_k_read_frames, sizeof(__pyx_k_read_frames), 1, 1, 1},
  {&__pyx_kp_write_frames, __pyx_k_write_frames, sizeof(__pyx_k_write_frames), 1, 1, 1},
  {&__pyx_kp_seek, __pyx_k_seek, sizeof(__pyx_k_seek), 1, 1, 1},
  {&__pyx_kp_type, __pyx_k_type, sizeof(__pyx_k_type), 1, 1, 1},
  {&__pyx_kp_encoding, __pyx_k_encoding, sizeof(__pyx_k_encoding), 1, 1, 1},
  {&__pyx_kp_endianness, __pyx_k_endianness, sizeof(__pyx_k_endianness), 1, 1, 1},
  {&__pyx_kp_self, __pyx_k_self, sizeof(__pyx_k_self), 1, 1, 1},
  {&__pyx_kp_other, __pyx_k_other, sizeof(__pyx_k_other), 1, 1, 1},
  {&__pyx_kp_op, __pyx_k_op, sizeof(__pyx_k_op), 1, 1, 1},
  {&__pyx_kp_major, __pyx_k_major, sizeof(__pyx_k_major), 1, 1, 1},
  {&__pyx_kp_filename, __pyx_k_filename, sizeof(__pyx_k_filename), 1, 1, 1},
  {&__pyx_kp_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 1, 1, 1},
  {&__pyx_kp_format, __pyx_k_format, sizeof(__pyx_k_format), 1, 1, 1},
  {&__pyx_kp_channels, __pyx_k_channels, sizeof(__pyx_k_channels), 1, 1, 1},
  {&__pyx_kp_samplerate, __pyx_k_samplerate, sizeof(__pyx_k_samplerate), 1, 1, 1},
  {&__pyx_kp_nframes, __pyx_k_nframes, sizeof(__pyx_k_nframes), 1, 1, 1},
  {&__pyx_kp_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 1, 1, 1},
  {&__pyx_kp_input, __pyx_k_input, sizeof(__pyx_k_input), 1, 1, 1},
  {&__pyx_kp_offset, __pyx_k_offset, sizeof(__pyx_k_offset), 1, 1, 1},
  {&__pyx_kp_whence, __pyx_k_whence, sizeof(__pyx_k_whence), 1, 1, 1},
  {&__pyx_kp_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 1, 1, 1},
  {&__pyx_kp_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 1, 1},
  {&__pyx_kp_warnings, __pyx_k_warnings, sizeof(__pyx_k_warnings), 1, 1, 1},
  {&__pyx_kp_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 1, 1, 1},
  {&__pyx_kp_32, __pyx_k_32, sizeof(__pyx_k_32), 0, 1, 0},
  {&__pyx_kp_33, __pyx_k_33, sizeof(__pyx_k_33), 0, 1, 0},
  {&__pyx_kp_34, __pyx_k_34, sizeof(__pyx_k_34), 0, 1, 0},
  {&__pyx_kp_35, __pyx_k_35, sizeof(__pyx_k_35), 0, 1, 0},
  {&__pyx_kp_36, __pyx_k_36, sizeof(__pyx_k_36), 0, 1, 0},
  {&__pyx_kp_37, __pyx_k_37, sizeof(__pyx_k_37), 0, 1, 0},
  {&__pyx_kp_38, __pyx_k_38, sizeof(__pyx_k_38), 0, 1, 0},
  {&__pyx_kp_39, __pyx_k_39, sizeof(__pyx_k_39), 0, 1, 0},
  {&__pyx_kp_40, __pyx_k_40, sizeof(__pyx_k_40), 0, 1, 0},
  {&__pyx_kp_41, __pyx_k_41, sizeof(__pyx_k_41), 0, 1, 0},
  {&__pyx_kp_42, __pyx_k_42, sizeof(__pyx_k_42), 0, 1, 0},
  {&__pyx_kp_43, __pyx_k_43, sizeof(__pyx_k_43), 0, 1, 0},
  {&__pyx_kp_44, __pyx_k_44, sizeof(__pyx_k_44), 0, 1, 0},
  {&__pyx_kp_45, __pyx_k_45, sizeof(__pyx_k_45), 0, 1, 0},
  {&__pyx_kp_46, __pyx_k_46, sizeof(__pyx_k_46), 0, 1, 0},
  {&__pyx_kp_47, __pyx_k_47, sizeof(__pyx_k_47), 0, 1, 0},
  {&__pyx_kp_48, __pyx_k_48, sizeof(__pyx_k_48), 0, 1, 0},
  {&__pyx_kp_49, __pyx_k_49, sizeof(__pyx_k_49), 0, 1, 0},
  {&__pyx_kp_50, __pyx_k_50, sizeof(__pyx_k_50), 0, 1, 0},
  {&__pyx_kp_51, __pyx_k_51, sizeof(__pyx_k_51), 0, 1, 0},
  {&__pyx_kp_52, __pyx_k_52, sizeof(__pyx_k_52), 0, 1, 0},
  {&__pyx_kp_53, __pyx_k_53, sizeof(__pyx_k_53), 0, 1, 0},
  {&__pyx_kp__SNDFILE_ENCODING, __pyx_k__SNDFILE_ENCODING, sizeof(__pyx_k__SNDFILE_ENCODING), 1, 1, 1},
  {&__pyx_kp_54, __pyx_k_54, sizeof(__pyx_k_54), 0, 1, 0},
  {&__pyx_kp_55, __pyx_k_55, sizeof(__pyx_k_55), 0, 1, 0},
  {&__pyx_kp_56, __pyx_k_56, sizeof(__pyx_k_56), 0, 1, 0},
  {&__pyx_kp_57, __pyx_k_57, sizeof(__pyx_k_57), 0, 1, 0},
  {&__pyx_kp_58, __pyx_k_58, sizeof(__pyx_k_58), 0, 1, 0},
  {&__pyx_kp_59, __pyx_k_59, sizeof(__pyx_k_59), 0, 1, 0},
  {&__pyx_kp_60, __pyx_k_60, sizeof(__pyx_k_60), 0, 1, 0},
  {&__pyx_kp_61, __pyx_k_61, sizeof(__pyx_k_61), 0, 1, 0},
  {&__pyx_kp_62, __pyx_k_62, sizeof(__pyx_k_62), 0, 1, 0},
  {&__pyx_kp_63, __pyx_k_63, sizeof(__pyx_k_63), 0, 1, 0},
  {&__pyx_kp_64, __pyx_k_64, sizeof(__pyx_k_64), 0, 1, 0},
  {&__pyx_kp_65, __pyx_k_65, sizeof(__pyx_k_65), 0, 1, 0},
  {&__pyx_kp_66, __pyx_k_66, sizeof(__pyx_k_66), 0, 1, 0},
  {&__pyx_kp_67, __pyx_k_67, sizeof(__pyx_k_67), 0, 1, 0},
  {&__pyx_kp_68, __pyx_k_68, sizeof(__pyx_k_68), 0, 1, 0},
  {&__pyx_kp_69, __pyx_k_69, sizeof(__pyx_k_69), 0, 1, 0},
  {&__pyx_kp_70, __pyx_k_70, sizeof(__pyx_k_70), 0, 1, 0},
  {&__pyx_kp_71, __pyx_k_71, sizeof(__pyx_k_71), 0, 1, 0},
  {&__pyx_kp_72, __pyx_k_72, sizeof(__pyx_k_72), 0, 1, 0},
  {&__pyx_kp_73, __pyx_k_73, sizeof(__pyx_k_73), 1, 1, 1},
  {&__pyx_kp_74, __pyx_k_74, sizeof(__pyx_k_74), 0, 1, 0},
  {&__pyx_kp_75, __pyx_k_75, sizeof(__pyx_k_75), 0, 1, 0},
  {&__pyx_kp_76, __pyx_k_76, sizeof(__pyx_k_76), 0, 1, 0},
  {&__pyx_kp_77, __pyx_k_77, sizeof(__pyx_k_77), 0, 1, 0},
  {&__pyx_kp_78, __pyx_k_78, sizeof(__pyx_k_78), 0, 1, 0},
  {&__pyx_kp_79, __pyx_k_79, sizeof(__pyx_k_79), 0, 1, 0},
  {&__pyx_kp_80, __pyx_k_80, sizeof(__pyx_k_80), 0, 1, 0},
  {&__pyx_kp_81, __pyx_k_81, sizeof(__pyx_k_81), 0, 1, 0},
  {&__pyx_kp_82, __pyx_k_82, sizeof(__pyx_k_82), 0, 1, 0},
  {&__pyx_kp_83, __pyx_k_83, sizeof(__pyx_k_83), 0, 1, 0},
  {&__pyx_kp_84, __pyx_k_84, sizeof(__pyx_k_84), 0, 1, 0},
  {&__pyx_kp__SNDFILE_ENDIAN, __pyx_k__SNDFILE_ENDIAN, sizeof(__pyx_k__SNDFILE_ENDIAN), 1, 1, 1},
  {&__pyx_kp_85, __pyx_k_85, sizeof(__pyx_k_85), 1, 1, 1},
  {&__pyx_kp_j, __pyx_k_j, sizeof(__pyx_k_j), 1, 1, 1},
  {&__pyx_kp_i, __pyx_k_i, sizeof(__pyx_k_i), 1, 1, 1},
  {&__pyx_kp_items, __pyx_k_items, sizeof(__pyx_k_items), 1, 1, 1},
  {&__pyx_kp_86, __pyx_k_86, sizeof(__pyx_k_86), 1, 1, 1},
  {&__pyx_kp__ENUM_TO_STR_ENDIAN, __pyx_k__ENUM_TO_STR_ENDIAN, sizeof(__pyx_k__ENUM_TO_STR_ENDIAN), 1, 1, 1},
  {&__pyx_kp_87, __pyx_k_87, sizeof(__pyx_k_87), 0, 1, 0},
  {&__pyx_kp_88, __pyx_k_88, sizeof(__pyx_k_88), 0, 1, 0},
  {&__pyx_kp_89, __pyx_k_89, sizeof(__pyx_k_89), 0, 1, 0},
  {&__pyx_kp_90, __pyx_k_90, sizeof(__pyx_k_90), 0, 1, 0},
  {&__pyx_kp_91, __pyx_k_91, sizeof(__pyx_k_91), 1, 1, 1},
  {&__pyx_kp_93, __pyx_k_93, sizeof(__pyx_k_93), 0, 1, 0},
  {&__pyx_kp_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 1, 1, 1},
  {&__pyx_kp_split, __pyx_k_split, sizeof(__pyx_k_split), 1, 1, 1},
  {&__pyx_kp_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 1, 1, 1},
  {&__pyx_kp_97, __pyx_k_97, sizeof(__pyx_k_97), 0, 1, 0},
  {&__pyx_kp_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 1, 1, 1},
  {&__pyx_kp___class__, __pyx_k___class__, sizeof(__pyx_k___class__), 1, 1, 1},
  {&__pyx_kp_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 1, 1, 1},
  {&__pyx_kp_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 1, 1, 1},
  {&__pyx_kp_join, __pyx_k_join, sizeof(__pyx_k_join), 1, 1, 1},
  {&__pyx_kp_has_key, __pyx_k_has_key, sizeof(__pyx_k_has_key), 1, 1, 1},
  {&__pyx_kp_warn, __pyx_k_warn, sizeof(__pyx_k_warn), 1, 1, 1},
  {&__pyx_kp_append, __pyx_k_append, sizeof(__pyx_k_append), 1, 1, 1},
  {&__pyx_kp_115, __pyx_k_115, sizeof(__pyx_k_115), 0, 1, 0},
  {&__pyx_kp_116, __pyx_k_116, sizeof(__pyx_k_116), 0, 1, 0},
  {&__pyx_kp_118, __pyx_k_118, sizeof(__pyx_k_118), 0, 1, 0},
  {&__pyx_kp_121, __pyx_k_121, sizeof(__pyx_k_121), 0, 1, 0},
  {&__pyx_kp_IOError, __pyx_k_IOError, sizeof(__pyx_k_IOError), 1, 1, 1},
  {&__pyx_kp_129, __pyx_k_129, sizeof(__pyx_k_129), 0, 1, 0},
  {&__pyx_kp_file_format, __pyx_k_file_format, sizeof(__pyx_k_file_format), 1, 1, 1},
  {&__pyx_kp_144, __pyx_k_144, sizeof(__pyx_k_144), 1, 1, 1},
  {&__pyx_kp_145, __pyx_k_145, sizeof(__pyx_k_145), 1, 1, 1},
  {&__pyx_kp_146, __pyx_k_146, sizeof(__pyx_k_146), 1, 1, 1},
  {&__pyx_kp_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 1, 1, 1},
  {&__pyx_kp_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 1, 1, 1},
  {&__pyx_kp_order, __pyx_k_order, sizeof(__pyx_k_order), 1, 1, 1},
  {&__pyx_kp_148, __pyx_k_148, sizeof(__pyx_k_148), 0, 1, 0},
  {&__pyx_kp_150, __pyx_k_150, sizeof(__pyx_k_150), 0, 1, 0},
  {&__pyx_kp_int, __pyx_k_int, sizeof(__pyx_k_int), 1, 1, 1},
  {&__pyx_kp_152, __pyx_k_152, sizeof(__pyx_k_152), 0, 1, 0},
  {&__pyx_kp_short, __pyx_k_short, sizeof(__pyx_k_short), 1, 1, 1},
  {&__pyx_kp_154, __pyx_k_154, sizeof(__pyx_k_154), 0, 1, 0},
  {&__pyx_kp_size, __pyx_k_size, sizeof(__pyx_k_size), 1, 1, 1},
  {&__pyx_kp_require, __pyx_k_require, sizeof(__pyx_k_require), 1, 1, 1},
  {&__pyx_kp_requirements, __pyx_k_requirements, sizeof(__pyx_k_requirements), 1, 1, 1},
  {&__pyx_kp_158, __pyx_k_158, sizeof(__pyx_k_158), 0, 1, 0},
  {&__pyx_kp_Exception, __pyx_k_Exception, sizeof(__pyx_k_Exception), 1, 1, 1},
  {&__pyx_kp_161, __pyx_k_161, sizeof(__pyx_k_161), 0, 1, 0},
  {&__pyx_kp_162, __pyx_k_162, sizeof(__pyx_k_162), 0, 1, 0},
  {&__pyx_kp_163, __pyx_k_163, sizeof(__pyx_k_163), 0, 1, 0},
  {&__pyx_kp_94, __pyx_k_94, sizeof(__pyx_k_94), 0, 0, 0},
  {&__pyx_kp_95, __pyx_k_95, sizeof(__pyx_k_95), 0, 0, 0},
  {&__pyx_kp_96, __pyx_k_96, sizeof(__pyx_k_96), 0, 0, 0},
  {&__pyx_kp_98, __pyx_k_98, sizeof(__pyx_k_98), 0, 0, 0},
  {&__pyx_kp_99, __pyx_k_99, sizeof(__pyx_k_99), 0, 0, 0},
  {&__pyx_kp_100, __pyx_k_100, sizeof(__pyx_k_100), 0, 0, 0},
  {&__pyx_kp_101, __pyx_k_101, sizeof(__pyx_k_101), 0, 0, 0},
  {&__pyx_kp_102, __pyx_k_102, sizeof(__pyx_k_102), 0, 0, 0},
  {&__pyx_kp_103, __pyx_k_103, sizeof(__pyx_k_103), 0, 0, 0},
  {&__pyx_kp_104, __pyx_k_104, sizeof(__pyx_k_104), 0, 0, 0},
  {&__pyx_kp_105, __pyx_k_105, sizeof(__pyx_k_105), 0, 0, 0},
  {&__pyx_kp_106, __pyx_k_106, sizeof(__pyx_k_106), 0, 0, 0},
  {&__pyx_kp_107, __pyx_k_107, sizeof(__pyx_k_107), 0, 0, 0},
  {&__pyx_kp_108, __pyx_k_108, sizeof(__pyx_k_108), 0, 0, 0},
  {&__pyx_kp_109, __pyx_k_109, sizeof(__pyx_k_109), 0, 0, 0},
  {&__pyx_kp_110, __pyx_k_110, sizeof(__pyx_k_110), 0, 0, 0},
  {&__pyx_kp_111, __pyx_k_111, sizeof(__pyx_k_111), 0, 0, 0},
  {&__pyx_kp_112, __pyx_k_112, sizeof(__pyx_k_112), 0, 0, 0},
  {&__pyx_kp_113, __pyx_k_113, sizeof(__pyx_k_113), 0, 0, 0},
  {&__pyx_kp_114, __pyx_k_114, sizeof(__pyx_k_114), 0, 0, 0},
  {&__pyx_kp_117, __pyx_k_117, sizeof(__pyx_k_117), 0, 0, 0},
  {&__pyx_kp_119, __pyx_k_119, sizeof(__pyx_k_119), 0, 0, 0},
  {&__pyx_kp_120, __pyx_k_120, sizeof(__pyx_k_120), 0, 0, 0},
  {&__pyx_kp_122, __pyx_k_122, sizeof(__pyx_k_122), 0, 0, 0},
  {&__pyx_kp_123, __pyx_k_123, sizeof(__pyx_k_123), 0, 0, 0},
  {&__pyx_kp_124, __pyx_k_124, sizeof(__pyx_k_124), 0, 0, 0},
  {&__pyx_kp_125, __pyx_k_125, sizeof(__pyx_k_125), 0, 0, 0},
  {&__pyx_kp_126, __pyx_k_126, sizeof(__pyx_k_126), 0, 0, 0},
  {&__pyx_kp_127, __pyx_k_127, sizeof(__pyx_k_127), 0, 0, 0},
  {&__pyx_kp_128, __pyx_k_128, sizeof(__pyx_k_128), 0, 0, 0},
  {&__pyx_kp_130, __pyx_k_130, sizeof(__pyx_k_130), 0, 0, 0},
  {&__pyx_kp_131, __pyx_k_131, sizeof(__pyx_k_131), 0, 0, 0},
  {&__pyx_kp_132, __pyx_k_132, sizeof(__pyx_k_132), 0, 0, 0},
  {&__pyx_kp_133, __pyx_k_133, sizeof(__pyx_k_133), 0, 0, 0},
  {&__pyx_kp_134, __pyx_k_134, sizeof(__pyx_k_134), 0, 0, 0},
  {&__pyx_kp_135, __pyx_k_135, sizeof(__pyx_k_135), 0, 0, 0},
  {&__pyx_kp_136, __pyx_k_136, sizeof(__pyx_k_136), 0, 0, 0},
  {&__pyx_kp_137, __pyx_k_137, sizeof(__pyx_k_137), 0, 0, 0},
  {&__pyx_kp_138, __pyx_k_138, sizeof(__pyx_k_138), 0, 0, 0},
  {&__pyx_kp_139, __pyx_k_139, sizeof(__pyx_k_139), 0, 0, 0},
  {&__pyx_kp_140, __pyx_k_140, sizeof(__pyx_k_140), 0, 0, 0},
  {&__pyx_kp_141, __pyx_k_141, sizeof(__pyx_k_141), 0, 0, 0},
  {&__pyx_kp_142, __pyx_k_142, sizeof(__pyx_k_142), 0, 0, 0},
  {&__pyx_kp_143, __pyx_k_143, sizeof(__pyx_k_143), 0, 0, 0},
  {&__pyx_kp_147, __pyx_k_147, sizeof(__pyx_k_147), 0, 0, 0},
  {&__pyx_kp_149, __pyx_k_149, sizeof(__pyx_k_149), 0, 0, 0},
  {&__pyx_kp_151, __pyx_k_151, sizeof(__pyx_k_151), 0, 0, 0},
  {&__pyx_kp_153, __pyx_k_153, sizeof(__pyx_k_153), 0, 0, 0},
  {&__pyx_kp_155, __pyx_k_155, sizeof(__pyx_k_155), 0, 0, 0},
  {&__pyx_kp_156, __pyx_k_156, sizeof(__pyx_k_156), 0, 0, 0},
  {&__pyx_kp_157, __pyx_k_157, sizeof(__pyx_k_157), 0, 0, 0},
  {&__pyx_kp_159, __pyx_k_159, sizeof(__pyx_k_159), 0, 0, 0},
  {&__pyx_kp_160, __pyx_k_160, sizeof(__pyx_k_160), 0, 0, 0},
  {&__pyx_kp_164, __pyx_k_164, sizeof(__pyx_k_164), 0, 0, 0},
  {&__pyx_kp_165, __pyx_k_165, sizeof(__pyx_k_165), 0, 0, 0},
  {&__pyx_kp_166, __pyx_k_166, sizeof(__pyx_k_166), 0, 0, 0},
  {&__pyx_kp___getbuffer__, __pyx_k___getbuffer__, sizeof(__pyx_k___getbuffer__), 1, 1, 1},
  {&__pyx_kp___releasebuffer__, __pyx_k___releasebuffer__, sizeof(__pyx_k___releasebuffer__), 1, 1, 1},
  {&__pyx_kp_info, __pyx_k_info, sizeof(__pyx_k_info), 1, 1, 1},
  {&__pyx_kp_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 1, 1, 1},
  {&__pyx_kp_itervalues, __pyx_k_itervalues, sizeof(__pyx_k_itervalues), 1, 1, 1},
  {&__pyx_kp_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 0},
  {&__pyx_kp_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 0},
  {&__pyx_kp_20, __pyx_k_20, sizeof(__pyx_k_20), 0, 0, 0},
  {&__pyx_kp_21, __pyx_k_21, sizeof(__pyx_k_21), 0, 0, 0},
  {&__pyx_kp_22, __pyx_k_22, sizeof(__pyx_k_22), 0, 0, 0},
  {0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_kp_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_kp_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_KeyError = __Pyx_GetName(__pyx_b, __pyx_kp_KeyError); if (!__pyx_builtin_KeyError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_NotImplementedError = __Pyx_GetName(__pyx_b, __pyx_kp_NotImplementedError); if (!__pyx_builtin_NotImplementedError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_TypeError = __Pyx_GetName(__pyx_b, __pyx_kp_TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_IOError = __Pyx_GetName(__pyx_b, __pyx_kp_IOError); if (!__pyx_builtin_IOError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_Exception = __Pyx_GetName(__pyx_b, __pyx_kp_Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  return 0;
  __pyx_L1_error:;
  return -1;
}

static int __Pyx_InitGlobals(void) {
  __pyx_int_0x0060 = PyInt_FromLong(0x0060); if (unlikely(!__pyx_int_0x0060)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_0x170000 = PyInt_FromLong(0x170000); if (unlikely(!__pyx_int_0x170000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_0x180000 = PyInt_FromLong(0x180000); if (unlikely(!__pyx_int_0x180000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_0x190000 = PyInt_FromLong(0x190000); if (unlikely(!__pyx_int_0x190000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_0x200000 = PyInt_FromLong(0x200000); if (unlikely(!__pyx_int_0x200000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_0x210000 = PyInt_FromLong(0x210000); if (unlikely(!__pyx_int_0x210000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_0x220000 = PyInt_FromLong(0x220000); if (unlikely(!__pyx_int_0x220000)) {__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;};
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__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 init_sndfile(void); /*proto*/
PyMODINIT_FUNC init_sndfile(void)
#else
PyMODINIT_FUNC PyInit__sndfile(void); /*proto*/
PyMODINIT_FUNC PyInit__sndfile(void)
#endif
{
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  int __pyx_4;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __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;}
  /*--- Library function declarations ---*/
  __pyx_init_filenames();
  /*--- 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;}
  /*--- Module creation code ---*/
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4("_sndfile", __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_BUILTIN_MODULE_NAME);
  if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 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;}
  __pyx_skip_dispatch = 0;
  /*--- Global init code ---*/
  /*--- Function export code ---*/
  /*--- Type init code ---*/
  __pyx_vtabptr_7scikits_8audiolab_9pysndfile_8_sndfile_Format = &__pyx_vtable_7scikits_8audiolab_9pysndfile_8_sndfile_Format;
  *(void(**)(void))&__pyx_vtable_7scikits_8audiolab_9pysndfile_8_sndfile_Format.format_int = (void(*)(void))__pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_format_int;
  *(void(**)(void))&__pyx_vtable_7scikits_8audiolab_9pysndfile_8_sndfile_Format.file_format_int = (void(*)(void))__pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_file_format_int;
  *(void(**)(void))&__pyx_vtable_7scikits_8audiolab_9pysndfile_8_sndfile_Format.encoding_int = (void(*)(void))__pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_encoding_int;
  *(void(**)(void))&__pyx_vtable_7scikits_8audiolab_9pysndfile_8_sndfile_Format.endianness_int = (void(*)(void))__pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_endianness_int;
  *(void(**)(void))&__pyx_vtable_7scikits_8audiolab_9pysndfile_8_sndfile_Format._is_equal = (void(*)(void))__pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_6Format__is_equal;
  if (PyType_Ready(&__pyx_type_7scikits_8audiolab_9pysndfile_8_sndfile_Format) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_7scikits_8audiolab_9pysndfile_8_sndfile_Format.tp_dict, __pyx_vtabptr_7scikits_8audiolab_9pysndfile_8_sndfile_Format) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyObject_SetAttrString(__pyx_m, "Format", (PyObject *)&__pyx_type_7scikits_8audiolab_9pysndfile_8_sndfile_Format) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7scikits_8audiolab_9pysndfile_8_sndfile_Format = &__pyx_type_7scikits_8audiolab_9pysndfile_8_sndfile_Format;
  __pyx_vtabptr_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile = &__pyx_vtable_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile;
  *(void(**)(void))&__pyx_vtable_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile._close = (void(*)(void))__pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile__close;
  *(void(**)(void))&__pyx_vtable_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile._get_nframes = (void(*)(void))__pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile__get_nframes;
  *(void(**)(void))&__pyx_vtable_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile.read_frames_double = (void(*)(void))__pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_read_frames_double;
  *(void(**)(void))&__pyx_vtable_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile.read_frames_float = (void(*)(void))__pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_read_frames_float;
  *(void(**)(void))&__pyx_vtable_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile.read_frames_int = (void(*)(void))__pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_read_frames_int;
  *(void(**)(void))&__pyx_vtable_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile.read_frames_short = (void(*)(void))__pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_read_frames_short;
  *(void(**)(void))&__pyx_vtable_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile.write_frames_double = (void(*)(void))__pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_write_frames_double;
  *(void(**)(void))&__pyx_vtable_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile.write_frames_float = (void(*)(void))__pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_write_frames_float;
  *(void(**)(void))&__pyx_vtable_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile.write_frames_int = (void(*)(void))__pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_write_frames_int;
  *(void(**)(void))&__pyx_vtable_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile.write_frames_short = (void(*)(void))__pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_write_frames_short;
  if (PyType_Ready(&__pyx_type_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile.tp_dict, __pyx_vtabptr_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyObject_SetAttrString(__pyx_m, "Sndfile", (PyObject *)&__pyx_type_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile = &__pyx_type_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile;
  /*--- Type import code ---*/
  __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr)); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject)); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Function import code ---*/
  /*--- Execution code ---*/

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":3
 * # cython: embedsignature=True
 * 
 * import numpy as np             # <<<<<<<<<<<<<<
 * import warnings
 * import copy
 */
  __pyx_1 = __Pyx_Import(__pyx_kp_numpy, 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyObject_SetAttr(__pyx_m, __pyx_kp_np, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":4
 * 
 * import numpy as np
 * import warnings             # <<<<<<<<<<<<<<
 * import copy
 * 
 */
  __pyx_1 = __Pyx_Import(__pyx_kp_warnings, 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyObject_SetAttr(__pyx_m, __pyx_kp_warnings, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":5
 * import numpy as np
 * import warnings
 * import copy             # <<<<<<<<<<<<<<
 * 
 * cimport numpy as cnp
 */
  __pyx_1 = __Pyx_Import(__pyx_kp_copy, 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyObject_SetAttr(__pyx_m, __pyx_kp_copy, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":24
 * # format equivalence: dic used to create internally
 * # the right enum values from user friendly strings
 * _SNDFILE_ENCODING    = {             # <<<<<<<<<<<<<<
 *     'pcms8' : SF_FORMAT_PCM_S8,
 *     'pcm16' : SF_FORMAT_PCM_16,
 */
  __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":25
 * # the right enum values from user friendly strings
 * _SNDFILE_ENCODING    = {
 *     'pcms8' : SF_FORMAT_PCM_S8,             # <<<<<<<<<<<<<<
 *     'pcm16' : SF_FORMAT_PCM_16,
 *     'pcm24' : SF_FORMAT_PCM_24,
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyInt_FromLong(SF_FORMAT_PCM_S8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_1, __pyx_kp_32, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /* __pyx_t_1 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":26
 * _SNDFILE_ENCODING    = {
 *     'pcms8' : SF_FORMAT_PCM_S8,
 *     'pcm16' : SF_FORMAT_PCM_16,             # <<<<<<<<<<<<<<
 *     'pcm24' : SF_FORMAT_PCM_24,
 *     'pcm32' : SF_FORMAT_PCM_32,
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyInt_FromLong(SF_FORMAT_PCM_16); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_1, __pyx_kp_33, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /* __pyx_t_1 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":27
 *     'pcms8' : SF_FORMAT_PCM_S8,
 *     'pcm16' : SF_FORMAT_PCM_16,
 *     'pcm24' : SF_FORMAT_PCM_24,             # <<<<<<<<<<<<<<
 *     'pcm32' : SF_FORMAT_PCM_32,
 *     'pcmu8' : SF_FORMAT_PCM_U8,
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyInt_FromLong(SF_FORMAT_PCM_24); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_1, __pyx_kp_34, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /* __pyx_t_1 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":28
 *     'pcm16' : SF_FORMAT_PCM_16,
 *     'pcm24' : SF_FORMAT_PCM_24,
 *     'pcm32' : SF_FORMAT_PCM_32,             # <<<<<<<<<<<<<<
 *     'pcmu8' : SF_FORMAT_PCM_U8,
 * 
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyInt_FromLong(SF_FORMAT_PCM_32); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_1, __pyx_kp_35, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /* __pyx_t_1 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":29
 *     'pcm24' : SF_FORMAT_PCM_24,
 *     'pcm32' : SF_FORMAT_PCM_32,
 *     'pcmu8' : SF_FORMAT_PCM_U8,             # <<<<<<<<<<<<<<
 * 
 *     'float32' : SF_FORMAT_FLOAT,
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyInt_FromLong(SF_FORMAT_PCM_U8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_1, __pyx_kp_36, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /* __pyx_t_1 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":31
 *     'pcmu8' : SF_FORMAT_PCM_U8,
 * 
 *     'float32' : SF_FORMAT_FLOAT,             # <<<<<<<<<<<<<<
 *     'float64' : SF_FORMAT_DOUBLE,
 * 
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyInt_FromLong(SF_FORMAT_FLOAT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_1, __pyx_kp_37, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /* __pyx_t_1 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":32
 * 
 *     'float32' : SF_FORMAT_FLOAT,
 *     'float64' : SF_FORMAT_DOUBLE,             # <<<<<<<<<<<<<<
 * 
 *     'ulaw'      : SF_FORMAT_ULAW,
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyInt_FromLong(SF_FORMAT_DOUBLE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_1, __pyx_kp_38, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /* __pyx_t_1 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":34
 *     'float64' : SF_FORMAT_DOUBLE,
 * 
 *     'ulaw'      : SF_FORMAT_ULAW,             # <<<<<<<<<<<<<<
 *     'alaw'      : SF_FORMAT_ALAW,
 *     'ima_adpcm' : SF_FORMAT_IMA_ADPCM,
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyInt_FromLong(SF_FORMAT_ULAW); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_1, __pyx_kp_39, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /* __pyx_t_1 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":35
 * 
 *     'ulaw'      : SF_FORMAT_ULAW,
 *     'alaw'      : SF_FORMAT_ALAW,             # <<<<<<<<<<<<<<
 *     'ima_adpcm' : SF_FORMAT_IMA_ADPCM,
 *     'ms_adpcm'  : SF_FORMAT_MS_ADPCM,
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyInt_FromLong(SF_FORMAT_ALAW); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_1, __pyx_kp_40, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /* __pyx_t_1 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":36
 *     'ulaw'      : SF_FORMAT_ULAW,
 *     'alaw'      : SF_FORMAT_ALAW,
 *     'ima_adpcm' : SF_FORMAT_IMA_ADPCM,             # <<<<<<<<<<<<<<
 *     'ms_adpcm'  : SF_FORMAT_MS_ADPCM,
 * 
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyInt_FromLong(SF_FORMAT_IMA_ADPCM); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_1, __pyx_kp_41, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /* __pyx_t_1 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":37
 *     'alaw'      : SF_FORMAT_ALAW,
 *     'ima_adpcm' : SF_FORMAT_IMA_ADPCM,
 *     'ms_adpcm'  : SF_FORMAT_MS_ADPCM,             # <<<<<<<<<<<<<<
 * 
 *     'gsm610'    : SF_FORMAT_GSM610,
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyInt_FromLong(SF_FORMAT_MS_ADPCM); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_1, __pyx_kp_42, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /* __pyx_t_1 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":39
 *     'ms_adpcm'  : SF_FORMAT_MS_ADPCM,
 * 
 *     'gsm610'    : SF_FORMAT_GSM610,             # <<<<<<<<<<<<<<
 *     'vox_adpcm' : SF_FORMAT_VOX_ADPCM,
 * 
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyInt_FromLong(SF_FORMAT_GSM610); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_1, __pyx_kp_43, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /* __pyx_t_1 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":40
 * 
 *     'gsm610'    : SF_FORMAT_GSM610,
 *     'vox_adpcm' : SF_FORMAT_VOX_ADPCM,             # <<<<<<<<<<<<<<
 * 
 *     'g721_32'   : SF_FORMAT_G721_32,
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyInt_FromLong(SF_FORMAT_VOX_ADPCM); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_1, __pyx_kp_44, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /* __pyx_t_1 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":42
 *     'vox_adpcm' : SF_FORMAT_VOX_ADPCM,
 * 
 *     'g721_32'   : SF_FORMAT_G721_32,             # <<<<<<<<<<<<<<
 *     'g723_24'   : SF_FORMAT_G723_24,
 *     'g723_40'   : SF_FORMAT_G723_40,
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyInt_FromLong(SF_FORMAT_G721_32); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_1, __pyx_kp_45, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /* __pyx_t_1 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":43
 * 
 *     'g721_32'   : SF_FORMAT_G721_32,
 *     'g723_24'   : SF_FORMAT_G723_24,             # <<<<<<<<<<<<<<
 *     'g723_40'   : SF_FORMAT_G723_40,
 * 
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyInt_FromLong(SF_FORMAT_G723_24); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_1, __pyx_kp_46, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /* __pyx_t_1 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":44
 *     'g721_32'   : SF_FORMAT_G721_32,
 *     'g723_24'   : SF_FORMAT_G723_24,
 *     'g723_40'   : SF_FORMAT_G723_40,             # <<<<<<<<<<<<<<
 * 
 *     'dww12' : SF_FORMAT_DWVW_12,
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyInt_FromLong(SF_FORMAT_G723_40); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_1, __pyx_kp_47, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /* __pyx_t_1 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":46
 *     'g723_40'   : SF_FORMAT_G723_40,
 * 
 *     'dww12' : SF_FORMAT_DWVW_12,             # <<<<<<<<<<<<<<
 *     'dww16' : SF_FORMAT_DWVW_16,
 *     'dww24' : SF_FORMAT_DWVW_24,
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyInt_FromLong(SF_FORMAT_DWVW_12); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_1, __pyx_kp_48, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /* __pyx_t_1 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":47
 * 
 *     'dww12' : SF_FORMAT_DWVW_12,
 *     'dww16' : SF_FORMAT_DWVW_16,             # <<<<<<<<<<<<<<
 *     'dww24' : SF_FORMAT_DWVW_24,
 *     'dwwN'  : SF_FORMAT_DWVW_N,
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyInt_FromLong(SF_FORMAT_DWVW_16); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_1, __pyx_kp_49, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /* __pyx_t_1 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":48
 *     'dww12' : SF_FORMAT_DWVW_12,
 *     'dww16' : SF_FORMAT_DWVW_16,
 *     'dww24' : SF_FORMAT_DWVW_24,             # <<<<<<<<<<<<<<
 *     'dwwN'  : SF_FORMAT_DWVW_N,
 * 
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyInt_FromLong(SF_FORMAT_DWVW_24); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_1, __pyx_kp_50, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /* __pyx_t_1 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":49
 *     'dww16' : SF_FORMAT_DWVW_16,
 *     'dww24' : SF_FORMAT_DWVW_24,
 *     'dwwN'  : SF_FORMAT_DWVW_N,             # <<<<<<<<<<<<<<
 * 
 *     'dpcm8' : SF_FORMAT_DPCM_8,
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyInt_FromLong(SF_FORMAT_DWVW_N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_1, __pyx_kp_51, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /* __pyx_t_1 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":51
 *     'dwwN'  : SF_FORMAT_DWVW_N,
 * 
 *     'dpcm8' : SF_FORMAT_DPCM_8,             # <<<<<<<<<<<<<<
 *     'dpcm16': SF_FORMAT_DPCM_16,
 * }
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyInt_FromLong(SF_FORMAT_DPCM_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_1, __pyx_kp_52, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /* __pyx_t_1 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":52
 * 
 *     'dpcm8' : SF_FORMAT_DPCM_8,
 *     'dpcm16': SF_FORMAT_DPCM_16,             # <<<<<<<<<<<<<<
 * }
 * 
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyInt_FromLong(SF_FORMAT_DPCM_16); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_1, __pyx_kp_53, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /* __pyx_t_1 released */
  if (PyObject_SetAttr(__pyx_m, __pyx_kp__SNDFILE_ENCODING, ((PyObject *)__pyx_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":55
 * }
 * 
 * _SNDFILE_FILE_FORMAT = {             # <<<<<<<<<<<<<<
 *     'wav'   : SF_FORMAT_WAV,
 *     'aiff'  : SF_FORMAT_AIFF,
 */
  __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":56
 * 
 * _SNDFILE_FILE_FORMAT = {
 *     'wav'   : SF_FORMAT_WAV,             # <<<<<<<<<<<<<<
 *     'aiff'  : SF_FORMAT_AIFF,
 *     'au'    : SF_FORMAT_AU,
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyInt_FromLong(SF_FORMAT_WAV); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_1, __pyx_kp_54, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /* __pyx_t_1 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":57
 * _SNDFILE_FILE_FORMAT = {
 *     'wav'   : SF_FORMAT_WAV,
 *     'aiff'  : SF_FORMAT_AIFF,             # <<<<<<<<<<<<<<
 *     'au'    : SF_FORMAT_AU,
 *     'raw'   : SF_FORMAT_RAW,
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyInt_FromLong(SF_FORMAT_AIFF); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_1, __pyx_kp_55, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /* __pyx_t_1 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":58
 *     'wav'   : SF_FORMAT_WAV,
 *     'aiff'  : SF_FORMAT_AIFF,
 *     'au'    : SF_FORMAT_AU,             # <<<<<<<<<<<<<<
 *     'raw'   : SF_FORMAT_RAW,
 *     'paf'   : SF_FORMAT_PAF,
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyInt_FromLong(SF_FORMAT_AU); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_1, __pyx_kp_56, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /* __pyx_t_1 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":59
 *     'aiff'  : SF_FORMAT_AIFF,
 *     'au'    : SF_FORMAT_AU,
 *     'raw'   : SF_FORMAT_RAW,             # <<<<<<<<<<<<<<
 *     'paf'   : SF_FORMAT_PAF,
 *     'svx'   : SF_FORMAT_SVX,
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyInt_FromLong(SF_FORMAT_RAW); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_1, __pyx_kp_57, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /* __pyx_t_1 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":60
 *     'au'    : SF_FORMAT_AU,
 *     'raw'   : SF_FORMAT_RAW,
 *     'paf'   : SF_FORMAT_PAF,             # <<<<<<<<<<<<<<
 *     'svx'   : SF_FORMAT_SVX,
 *     'nist'  : SF_FORMAT_NIST,
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyInt_FromLong(SF_FORMAT_PAF); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_1, __pyx_kp_58, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /* __pyx_t_1 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":61
 *     'raw'   : SF_FORMAT_RAW,
 *     'paf'   : SF_FORMAT_PAF,
 *     'svx'   : SF_FORMAT_SVX,             # <<<<<<<<<<<<<<
 *     'nist'  : SF_FORMAT_NIST,
 *     'voc'   : SF_FORMAT_VOC,
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyInt_FromLong(SF_FORMAT_SVX); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_1, __pyx_kp_59, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /* __pyx_t_1 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":62
 *     'paf'   : SF_FORMAT_PAF,
 *     'svx'   : SF_FORMAT_SVX,
 *     'nist'  : SF_FORMAT_NIST,             # <<<<<<<<<<<<<<
 *     'voc'   : SF_FORMAT_VOC,
 *     'ircam' : SF_FORMAT_IRCAM,
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyInt_FromLong(SF_FORMAT_NIST); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_1, __pyx_kp_60, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /* __pyx_t_1 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":63
 *     'svx'   : SF_FORMAT_SVX,
 *     'nist'  : SF_FORMAT_NIST,
 *     'voc'   : SF_FORMAT_VOC,             # <<<<<<<<<<<<<<
 *     'ircam' : SF_FORMAT_IRCAM,
 *     'wav64' : SF_FORMAT_W64,
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyInt_FromLong(SF_FORMAT_VOC); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_1, __pyx_kp_61, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /* __pyx_t_1 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":64
 *     'nist'  : SF_FORMAT_NIST,
 *     'voc'   : SF_FORMAT_VOC,
 *     'ircam' : SF_FORMAT_IRCAM,             # <<<<<<<<<<<<<<
 *     'wav64' : SF_FORMAT_W64,
 *     'mat4'  : SF_FORMAT_MAT4,
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyInt_FromLong(SF_FORMAT_IRCAM); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_1, __pyx_kp_62, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /* __pyx_t_1 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":65
 *     'voc'   : SF_FORMAT_VOC,
 *     'ircam' : SF_FORMAT_IRCAM,
 *     'wav64' : SF_FORMAT_W64,             # <<<<<<<<<<<<<<
 *     'mat4'  : SF_FORMAT_MAT4,
 *     'mat5'  : SF_FORMAT_MAT5,
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyInt_FromLong(SF_FORMAT_W64); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_1, __pyx_kp_63, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /* __pyx_t_1 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":66
 *     'ircam' : SF_FORMAT_IRCAM,
 *     'wav64' : SF_FORMAT_W64,
 *     'mat4'  : SF_FORMAT_MAT4,             # <<<<<<<<<<<<<<
 *     'mat5'  : SF_FORMAT_MAT5,
 *     'pvf'   : SF_FORMAT_PVF,
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyInt_FromLong(SF_FORMAT_MAT4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_1, __pyx_kp_64, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /* __pyx_t_1 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":67
 *     'wav64' : SF_FORMAT_W64,
 *     'mat4'  : SF_FORMAT_MAT4,
 *     'mat5'  : SF_FORMAT_MAT5,             # <<<<<<<<<<<<<<
 *     'pvf'   : SF_FORMAT_PVF,
 *     'xi'    : SF_FORMAT_XI,
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyInt_FromLong(SF_FORMAT_MAT5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_1, __pyx_kp_65, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /* __pyx_t_1 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":68
 *     'mat4'  : SF_FORMAT_MAT4,
 *     'mat5'  : SF_FORMAT_MAT5,
 *     'pvf'   : SF_FORMAT_PVF,             # <<<<<<<<<<<<<<
 *     'xi'    : SF_FORMAT_XI,
 *     'htk'   : SF_FORMAT_HTK,
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyInt_FromLong(SF_FORMAT_PVF); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_1, __pyx_kp_66, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /* __pyx_t_1 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":69
 *     'mat5'  : SF_FORMAT_MAT5,
 *     'pvf'   : SF_FORMAT_PVF,
 *     'xi'    : SF_FORMAT_XI,             # <<<<<<<<<<<<<<
 *     'htk'   : SF_FORMAT_HTK,
 *     'sds'   : SF_FORMAT_SDS,
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyInt_FromLong(SF_FORMAT_XI); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_1, __pyx_kp_67, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /* __pyx_t_1 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":70
 *     'pvf'   : SF_FORMAT_PVF,
 *     'xi'    : SF_FORMAT_XI,
 *     'htk'   : SF_FORMAT_HTK,             # <<<<<<<<<<<<<<
 *     'sds'   : SF_FORMAT_SDS,
 *     'avr'   : SF_FORMAT_AVR,
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyInt_FromLong(SF_FORMAT_HTK); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_1, __pyx_kp_68, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /* __pyx_t_1 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":71
 *     'xi'    : SF_FORMAT_XI,
 *     'htk'   : SF_FORMAT_HTK,
 *     'sds'   : SF_FORMAT_SDS,             # <<<<<<<<<<<<<<
 *     'avr'   : SF_FORMAT_AVR,
 *     'wavex' : SF_FORMAT_WAVEX,
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyInt_FromLong(SF_FORMAT_SDS); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_1, __pyx_kp_69, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /* __pyx_t_1 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":72
 *     'htk'   : SF_FORMAT_HTK,
 *     'sds'   : SF_FORMAT_SDS,
 *     'avr'   : SF_FORMAT_AVR,             # <<<<<<<<<<<<<<
 *     'wavex' : SF_FORMAT_WAVEX,
 *     'sd2'   : SF_FORMAT_SD2,
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyInt_FromLong(SF_FORMAT_AVR); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_1, __pyx_kp_70, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /* __pyx_t_1 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":73
 *     'sds'   : SF_FORMAT_SDS,
 *     'avr'   : SF_FORMAT_AVR,
 *     'wavex' : SF_FORMAT_WAVEX,             # <<<<<<<<<<<<<<
 *     'sd2'   : SF_FORMAT_SD2,
 * }
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyInt_FromLong(SF_FORMAT_WAVEX); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_1, __pyx_kp_71, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /* __pyx_t_1 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":74
 *     'avr'   : SF_FORMAT_AVR,
 *     'wavex' : SF_FORMAT_WAVEX,
 *     'sd2'   : SF_FORMAT_SD2,             # <<<<<<<<<<<<<<
 * }
 * 
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyInt_FromLong(SF_FORMAT_SD2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_1, __pyx_kp_72, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /* __pyx_t_1 released */
  if (PyObject_SetAttr(__pyx_m, __pyx_kp_73, ((PyObject *)__pyx_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":80
 * # relatively recent and not available on all sndfile available, harcode the
 * # values to avoid breaking compilation older sndfile.
 * _SNDFILE_ENCODING['vorbis']    = 0x0060             # <<<<<<<<<<<<<<
 * 
 * _SNDFILE_FILE_FORMAT['flac']    = 0x170000
 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__SNDFILE_ENCODING); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyObject_SetItem(__pyx_1, __pyx_kp_74, __pyx_int_0x0060) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":82
 * _SNDFILE_ENCODING['vorbis']    = 0x0060
 * 
 * _SNDFILE_FILE_FORMAT['flac']    = 0x170000             # <<<<<<<<<<<<<<
 * _SNDFILE_FILE_FORMAT['caf']     = 0x180000
 * _SNDFILE_FILE_FORMAT['wve']     = 0x190000
 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_73); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyObject_SetItem(__pyx_1, __pyx_kp_75, __pyx_int_0x170000) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":83
 * 
 * _SNDFILE_FILE_FORMAT['flac']    = 0x170000
 * _SNDFILE_FILE_FORMAT['caf']     = 0x180000             # <<<<<<<<<<<<<<
 * _SNDFILE_FILE_FORMAT['wve']     = 0x190000
 * _SNDFILE_FILE_FORMAT['ogg']     = 0x200000
 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_73); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyObject_SetItem(__pyx_1, __pyx_kp_76, __pyx_int_0x180000) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":84
 * _SNDFILE_FILE_FORMAT['flac']    = 0x170000
 * _SNDFILE_FILE_FORMAT['caf']     = 0x180000
 * _SNDFILE_FILE_FORMAT['wve']     = 0x190000             # <<<<<<<<<<<<<<
 * _SNDFILE_FILE_FORMAT['ogg']     = 0x200000
 * _SNDFILE_FILE_FORMAT['mpc2k']   = 0x210000
 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_73); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyObject_SetItem(__pyx_1, __pyx_kp_77, __pyx_int_0x190000) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":85
 * _SNDFILE_FILE_FORMAT['caf']     = 0x180000
 * _SNDFILE_FILE_FORMAT['wve']     = 0x190000
 * _SNDFILE_FILE_FORMAT['ogg']     = 0x200000             # <<<<<<<<<<<<<<
 * _SNDFILE_FILE_FORMAT['mpc2k']   = 0x210000
 * _SNDFILE_FILE_FORMAT['rf64']    = 0x220000
 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_73); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyObject_SetItem(__pyx_1, __pyx_kp_78, __pyx_int_0x200000) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":86
 * _SNDFILE_FILE_FORMAT['wve']     = 0x190000
 * _SNDFILE_FILE_FORMAT['ogg']     = 0x200000
 * _SNDFILE_FILE_FORMAT['mpc2k']   = 0x210000             # <<<<<<<<<<<<<<
 * _SNDFILE_FILE_FORMAT['rf64']    = 0x220000
 * 
 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_73); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyObject_SetItem(__pyx_1, __pyx_kp_79, __pyx_int_0x210000) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":87
 * _SNDFILE_FILE_FORMAT['ogg']     = 0x200000
 * _SNDFILE_FILE_FORMAT['mpc2k']   = 0x210000
 * _SNDFILE_FILE_FORMAT['rf64']    = 0x220000             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_73); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyObject_SetItem(__pyx_1, __pyx_kp_80, __pyx_int_0x220000) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":90
 * 
 * 
 * _SNDFILE_ENDIAN = {             # <<<<<<<<<<<<<<
 *     'file'      : SF_ENDIAN_FILE,
 *     'little'    : SF_ENDIAN_LITTLE,
 */
  __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":91
 * 
 * _SNDFILE_ENDIAN = {
 *     'file'      : SF_ENDIAN_FILE,             # <<<<<<<<<<<<<<
 *     'little'    : SF_ENDIAN_LITTLE,
 *     'big'       : SF_ENDIAN_BIG,
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyInt_FromLong(SF_ENDIAN_FILE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_1, __pyx_kp_81, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /* __pyx_t_1 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":92
 * _SNDFILE_ENDIAN = {
 *     'file'      : SF_ENDIAN_FILE,
 *     'little'    : SF_ENDIAN_LITTLE,             # <<<<<<<<<<<<<<
 *     'big'       : SF_ENDIAN_BIG,
 *     'cpu'       : SF_ENDIAN_CPU
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyInt_FromLong(SF_ENDIAN_LITTLE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_1, __pyx_kp_82, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /* __pyx_t_1 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":93
 *     'file'      : SF_ENDIAN_FILE,
 *     'little'    : SF_ENDIAN_LITTLE,
 *     'big'       : SF_ENDIAN_BIG,             # <<<<<<<<<<<<<<
 *     'cpu'       : SF_ENDIAN_CPU
 * }
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyInt_FromLong(SF_ENDIAN_BIG); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_1, __pyx_kp_83, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /* __pyx_t_1 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":95
 *     'big'       : SF_ENDIAN_BIG,
 *     'cpu'       : SF_ENDIAN_CPU
 * }             # <<<<<<<<<<<<<<
 * 
 * # Those following dic are used internally to get user-friendly values from
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyInt_FromLong(SF_ENDIAN_CPU); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_1, __pyx_kp_84, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /* __pyx_t_1 released */
  if (PyObject_SetAttr(__pyx_m, __pyx_kp__SNDFILE_ENDIAN, ((PyObject *)__pyx_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":100
 * # sndfile enum
 * _ENUM_TO_STR_ENCODING = \
 *         dict([(i, j) for j, i in _SNDFILE_ENCODING.items()])             # <<<<<<<<<<<<<<
 * _ENUM_TO_STR_FILE_FORMAT = \
 *         dict([(i, j) for j, i in _SNDFILE_FILE_FORMAT.items()])
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /* __pyx_t_2 allocated */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__SNDFILE_ENCODING); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_items); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  /* __pyx_t_3 allocated */
  __pyx_t_3 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  /* __pyx_t_4 allocated */
  if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) {
    __pyx_t_2 = 0; __pyx_t_4 = __pyx_t_3; Py_INCREF(__pyx_t_4);
  } else {
    __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  Py_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  /* __pyx_t_3 released */
  for (;;) {
    /* __pyx_t_3 allocated */
    if (likely(PyList_CheckExact(__pyx_t_4))) {
      if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_4)) break;
      __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); Py_INCREF(__pyx_t_3); __pyx_t_2++;
    } else if (likely(PyTuple_CheckExact(__pyx_t_4))) {
      if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
      __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); Py_INCREF(__pyx_t_3); __pyx_t_2++;
    } else {
      __pyx_t_3 = PyIter_Next(__pyx_t_4);
      if (!__pyx_t_3) {
        if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        break;
      }
    }
    if (PyTuple_CheckExact(__pyx_t_3) && PyTuple_GET_SIZE(__pyx_t_3) == 2) {
      PyObject* tuple = __pyx_t_3;
      __pyx_2 = PyTuple_GET_ITEM(tuple, 0); Py_INCREF(__pyx_2);
      __pyx_3 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(__pyx_3);
      Py_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (PyObject_SetAttr(__pyx_m, __pyx_kp_j, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      if (PyObject_SetAttr(__pyx_m, __pyx_kp_i, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_3); __pyx_3 = 0;
    } else {
      __pyx_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_1); __pyx_1 = 0;
      if (PyObject_SetAttr(__pyx_m, __pyx_kp_j, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      if (PyObject_SetAttr(__pyx_m, __pyx_kp_i, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_3); __pyx_3 = 0;
    }
    /* __pyx_t_3 released */
    __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_i); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_j); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    /* __pyx_t_3 allocated */
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_1);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_2);
    __pyx_1 = 0;
    __pyx_2 = 0;
    __pyx_4 = PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_3); if (unlikely(__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    /* __pyx_t_3 released */
  }
  /* __pyx_t_2 released */
  Py_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  /* __pyx_t_4 released */
  /* __pyx_t_4 allocated */
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_1));
  __pyx_t_1 = 0;
  /* __pyx_t_1 released */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)&PyDict_Type)), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  /* __pyx_t_4 released */
  if (PyObject_SetAttr(__pyx_m, __pyx_kp_85, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /* __pyx_t_1 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":102
 *         dict([(i, j) for j, i in _SNDFILE_ENCODING.items()])
 * _ENUM_TO_STR_FILE_FORMAT = \
 *         dict([(i, j) for j, i in _SNDFILE_FILE_FORMAT.items()])             # <<<<<<<<<<<<<<
 * _ENUM_TO_STR_ENDIAN = \
 *         dict([(i, j) for j, i in _SNDFILE_ENDIAN.items()])
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /* __pyx_t_2 allocated */
  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_73); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_kp_items); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  /* __pyx_t_4 allocated */
  __pyx_t_4 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  /* __pyx_t_3 allocated */
  if (PyList_CheckExact(__pyx_t_4) || PyTuple_CheckExact(__pyx_t_4)) {
    __pyx_t_2 = 0; __pyx_t_3 = __pyx_t_4; Py_INCREF(__pyx_t_3);
  } else {
    __pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  Py_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  /* __pyx_t_4 released */
  for (;;) {
    /* __pyx_t_4 allocated */
    if (likely(PyList_CheckExact(__pyx_t_3))) {
      if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break;
      __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); Py_INCREF(__pyx_t_4); __pyx_t_2++;
    } else if (likely(PyTuple_CheckExact(__pyx_t_3))) {
      if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
      __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); Py_INCREF(__pyx_t_4); __pyx_t_2++;
    } else {
      __pyx_t_4 = PyIter_Next(__pyx_t_3);
      if (!__pyx_t_4) {
        if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        break;
      }
    }
    if (PyTuple_CheckExact(__pyx_t_4) && PyTuple_GET_SIZE(__pyx_t_4) == 2) {
      PyObject* tuple = __pyx_t_4;
      __pyx_3 = PyTuple_GET_ITEM(tuple, 0); Py_INCREF(__pyx_3);
      __pyx_1 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(__pyx_1);
      Py_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (PyObject_SetAttr(__pyx_m, __pyx_kp_j, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_3); __pyx_3 = 0;
      if (PyObject_SetAttr(__pyx_m, __pyx_kp_i, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_1); __pyx_1 = 0;
    } else {
      __pyx_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_3 = __Pyx_UnpackItem(__pyx_2, 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_1 = __Pyx_UnpackItem(__pyx_2, 1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      if (PyObject_SetAttr(__pyx_m, __pyx_kp_j, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_3); __pyx_3 = 0;
      if (PyObject_SetAttr(__pyx_m, __pyx_kp_i, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_1); __pyx_1 = 0;
    }
    /* __pyx_t_4 released */
    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_i); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_j); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    /* __pyx_t_4 allocated */
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_2);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_3);
    __pyx_2 = 0;
    __pyx_3 = 0;
    __pyx_4 = PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_4); if (unlikely(__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    /* __pyx_t_4 released */
  }
  /* __pyx_t_2 released */
  Py_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  /* __pyx_t_3 released */
  /* __pyx_t_3 allocated */
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_1));
  __pyx_t_1 = 0;
  /* __pyx_t_1 released */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)&PyDict_Type)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  /* __pyx_t_3 released */
  if (PyObject_SetAttr(__pyx_m, __pyx_kp_86, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /* __pyx_t_1 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":104
 *         dict([(i, j) for j, i in _SNDFILE_FILE_FORMAT.items()])
 * _ENUM_TO_STR_ENDIAN = \
 *         dict([(i, j) for j, i in _SNDFILE_ENDIAN.items()])             # <<<<<<<<<<<<<<
 * 
 * def sndfile_version():
 */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /* __pyx_t_2 allocated */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__SNDFILE_ENDIAN); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_items); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  /* __pyx_t_3 allocated */
  __pyx_t_3 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  /* __pyx_t_4 allocated */
  if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) {
    __pyx_t_2 = 0; __pyx_t_4 = __pyx_t_3; Py_INCREF(__pyx_t_4);
  } else {
    __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  Py_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  /* __pyx_t_3 released */
  for (;;) {
    /* __pyx_t_3 allocated */
    if (likely(PyList_CheckExact(__pyx_t_4))) {
      if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_4)) break;
      __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); Py_INCREF(__pyx_t_3); __pyx_t_2++;
    } else if (likely(PyTuple_CheckExact(__pyx_t_4))) {
      if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
      __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); Py_INCREF(__pyx_t_3); __pyx_t_2++;
    } else {
      __pyx_t_3 = PyIter_Next(__pyx_t_4);
      if (!__pyx_t_3) {
        if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        break;
      }
    }
    if (PyTuple_CheckExact(__pyx_t_3) && PyTuple_GET_SIZE(__pyx_t_3) == 2) {
      PyObject* tuple = __pyx_t_3;
      __pyx_1 = PyTuple_GET_ITEM(tuple, 0); Py_INCREF(__pyx_1);
      __pyx_2 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(__pyx_2);
      Py_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (PyObject_SetAttr(__pyx_m, __pyx_kp_j, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_1); __pyx_1 = 0;
      if (PyObject_SetAttr(__pyx_m, __pyx_kp_i, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
    } else {
      __pyx_3 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_1 = __Pyx_UnpackItem(__pyx_3, 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_2 = __Pyx_UnpackItem(__pyx_3, 1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (__Pyx_EndUnpack(__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_3); __pyx_3 = 0;
      if (PyObject_SetAttr(__pyx_m, __pyx_kp_j, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_1); __pyx_1 = 0;
      if (PyObject_SetAttr(__pyx_m, __pyx_kp_i, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
    }
    /* __pyx_t_3 released */
    __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_i); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_j); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    /* __pyx_t_3 allocated */
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_3);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_1);
    __pyx_3 = 0;
    __pyx_1 = 0;
    __pyx_4 = PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_3); if (unlikely(__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    Py_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    /* __pyx_t_3 released */
  }
  /* __pyx_t_2 released */
  Py_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  /* __pyx_t_4 released */
  /* __pyx_t_4 allocated */
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_1));
  __pyx_t_1 = 0;
  /* __pyx_t_1 released */
  /* __pyx_t_1 allocated */
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)&PyDict_Type)), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  /* __pyx_t_4 released */
  if (PyObject_SetAttr(__pyx_m, __pyx_kp__ENUM_TO_STR_ENDIAN, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /* __pyx_t_1 released */

  /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":591
 *         return "\n".join(repstr)
 * 
 *     def read_frames(self, sf_count_t nframes, dtype=np.float64):             # <<<<<<<<<<<<<<
 *         """\
 *         Read the given number of frames and put the data into a numpy array of
 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_kp_91); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_k_92 = __pyx_3;
  __pyx_3 = 0;

  /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/stdlib.pxd":2
 * 
 * cdef extern from "stdlib.h":             # <<<<<<<<<<<<<<
 *     ctypedef unsigned long size_t
 *     void free(void *ptr)
 */
  #if PY_MAJOR_VERSION < 3
  return;
  #else
  return __pyx_m;
  #endif
  __pyx_L1_error:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile");
  #if PY_MAJOR_VERSION >= 3
  return NULL;
  #endif
}

static const char *__pyx_filenames[] = {
  "_sndfile.pyx",
  "numpy.pxd",
};

/* Runtime support code */

static void __pyx_init_filenames(void) {
  __pyx_f = __pyx_filenames;
}


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 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 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)) {
        #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 {
            name = argnames;
            while (*name && (**name != key)) name++;
            if (*name) {
                if (name < first_kw_arg) goto arg_passed_twice;
                values[name-argnames] = value;
            } 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) &&
                        strcmp(PyString_AS_STRING(**name),
                               PyString_AS_STRING(key)) == 0) 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) &&
                            strcmp(PyString_AS_STRING(**name),
                                   PyString_AS_STRING(key)) == 0) 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_TypeTest(PyObject *obj, PyTypeObject *type) {
    if (!type) {
        PyErr_Format(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (obj == Py_None || PyObject_TypeCheck(obj, type))
        return 1;
    PyErr_Format(PyExc_TypeError, "Cannot convert %s to %s",
        Py_TYPE(obj)->tp_name, type->tp_name);
    return 0;
}

static INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
  if (info->buf == NULL) return;
  if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL;
  __Pyx_ReleaseBuffer(info);
}

static INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) {
  buf->buf = NULL;
  buf->obj = NULL;
  buf->strides = __Pyx_zeros;
  buf->shape = __Pyx_zeros;
  buf->suboffsets = __Pyx_minusones;
}

static INLINE const char* __Pyx_ConsumeWhitespace(const char* ts) {
  while (1) {
    switch (*ts) {
      case '@':
      case 10:
      case 13:
      case ' ':
        ++ts;
        break;
      case '=':
      case '<':
      case '>':
      case '!':
        PyErr_SetString(PyExc_ValueError, "Buffer acquisition error: Only native byte order, size and alignment supported.");
        return NULL;               
      default:
        return ts;
    }
  }
}

static void __Pyx_BufferNdimError(Py_buffer* buffer, int expected_ndim) {
  PyErr_Format(PyExc_ValueError,
               "Buffer has wrong number of dimensions (expected %d, got %d)",
               expected_ndim, buffer->ndim);
}

static const char* __Pyx_DescribeTokenInFormatString(const char* ts) {
  switch (*ts) {
    case 'b': return "char";
    case 'B': return "unsigned char";
    case 'h': return "short";
    case 'H': return "unsigned short";
    case 'i': return "int";
    case 'I': return "unsigned int";
    case 'l': return "long";
    case 'L': return "unsigned long";
    case 'q': return "long long";
    case 'Q': return "unsigned long long";
    case 'f': return "float";
    case 'd': return "double";
    case 'g': return "long double";
    case 'Z': switch (*(ts+1)) {
        case 'f': return "complex float";
        case 'd': return "complex double";
        case 'g': return "complex long double";
        default: return "unparseable format string";
    }
    case 'T': return "a struct";
    case 'O': return "Python object";
    case 'P': return "a pointer";
    default: return "unparseable format string";
  }
}

static const char* __Pyx_CheckTypestring_nn___pyx_t_5numpy_float64_t(const char* ts) {
    int ok;
    ts = __Pyx_ConsumeWhitespace(ts); if (!ts) return NULL;
    if (*ts == '1') ++ts;
    switch (*ts) {
      case 'f': ok = (sizeof(__pyx_t_5numpy_float64_t) == sizeof(float) && (__pyx_t_5numpy_float64_t)-1 < 0); break;
      case 'd': ok = (sizeof(__pyx_t_5numpy_float64_t) == sizeof(double) && (__pyx_t_5numpy_float64_t)-1 < 0); break;
      case 'g': ok = (sizeof(__pyx_t_5numpy_float64_t) == sizeof(long double) && (__pyx_t_5numpy_float64_t)-1 < 0); break;
      default: ok = 0;
    }
    if (!(ok)) {
      PyErr_Format(PyExc_ValueError, "Buffer dtype mismatch (expected numpy.float64_t, got %s)", __Pyx_DescribeTokenInFormatString(ts));
      return NULL;
    }
    ++ts;
    return ts;
  }
  
static int __Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t(PyObject* obj, Py_buffer* buf, int flags, int nd, int cast) {
  const char* ts;
  if (obj == Py_None) {
    __Pyx_ZeroBuffer(buf);
    return 0;
  }
  buf->buf = NULL;
  if (__Pyx_GetBuffer(obj, buf, flags) == -1) goto fail;
  if (buf->ndim != nd) {
    __Pyx_BufferNdimError(buf, nd);
    goto fail;
  }
  if (!cast) {
    ts = buf->format;
    ts = __Pyx_ConsumeWhitespace(ts);
    if (!ts) goto fail;
    ts = __Pyx_CheckTypestring_nn___pyx_t_5numpy_float64_t(ts);
    if (!ts) goto fail;
    ts = __Pyx_ConsumeWhitespace(ts);
    if (!ts) goto fail;
    if (*ts != 0) {
      PyErr_Format(PyExc_ValueError,
        "Buffer dtype mismatch (expected end, got %s)",
        __Pyx_DescribeTokenInFormatString(ts));
      goto fail;
    }
  } else {
    if (buf->itemsize != sizeof(__pyx_t_5numpy_float64_t)) {
      PyErr_SetString(PyExc_ValueError,
        "Attempted cast of buffer to datatype of different size.");
      goto fail;
    }
  }
  if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
  return 0;
fail:;
  __Pyx_ZeroBuffer(buf);
  return -1;
}
static void __Pyx_RaiseBufferFallbackError(void) {
  PyErr_Format(PyExc_ValueError,
     "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!");
}


static 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 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;
}

static const char* __Pyx_CheckTypestring_nn___pyx_t_5numpy_float32_t(const char* ts) {
    int ok;
    ts = __Pyx_ConsumeWhitespace(ts); if (!ts) return NULL;
    if (*ts == '1') ++ts;
    switch (*ts) {
      case 'f': ok = (sizeof(__pyx_t_5numpy_float32_t) == sizeof(float) && (__pyx_t_5numpy_float32_t)-1 < 0); break;
      case 'd': ok = (sizeof(__pyx_t_5numpy_float32_t) == sizeof(double) && (__pyx_t_5numpy_float32_t)-1 < 0); break;
      case 'g': ok = (sizeof(__pyx_t_5numpy_float32_t) == sizeof(long double) && (__pyx_t_5numpy_float32_t)-1 < 0); break;
      default: ok = 0;
    }
    if (!(ok)) {
      PyErr_Format(PyExc_ValueError, "Buffer dtype mismatch (expected numpy.float32_t, got %s)", __Pyx_DescribeTokenInFormatString(ts));
      return NULL;
    }
    ++ts;
    return ts;
  }
  
static int __Pyx_GetBuffer_nn___pyx_t_5numpy_float32_t(PyObject* obj, Py_buffer* buf, int flags, int nd, int cast) {
  const char* ts;
  if (obj == Py_None) {
    __Pyx_ZeroBuffer(buf);
    return 0;
  }
  buf->buf = NULL;
  if (__Pyx_GetBuffer(obj, buf, flags) == -1) goto fail;
  if (buf->ndim != nd) {
    __Pyx_BufferNdimError(buf, nd);
    goto fail;
  }
  if (!cast) {
    ts = buf->format;
    ts = __Pyx_ConsumeWhitespace(ts);
    if (!ts) goto fail;
    ts = __Pyx_CheckTypestring_nn___pyx_t_5numpy_float32_t(ts);
    if (!ts) goto fail;
    ts = __Pyx_ConsumeWhitespace(ts);
    if (!ts) goto fail;
    if (*ts != 0) {
      PyErr_Format(PyExc_ValueError,
        "Buffer dtype mismatch (expected end, got %s)",
        __Pyx_DescribeTokenInFormatString(ts));
      goto fail;
    }
  } else {
    if (buf->itemsize != sizeof(__pyx_t_5numpy_float32_t)) {
      PyErr_SetString(PyExc_ValueError,
        "Attempted cast of buffer to datatype of different size.");
      goto fail;
    }
  }
  if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
  return 0;
fail:;
  __Pyx_ZeroBuffer(buf);
  return -1;
}static const char* __Pyx_CheckTypestring_nn___pyx_t_5numpy_int32_t(const char* ts) {
    int ok;
    ts = __Pyx_ConsumeWhitespace(ts); if (!ts) return NULL;
    if (*ts == '1') ++ts;
    switch (*ts) {
      case 'b': ok = (sizeof(__pyx_t_5numpy_int32_t) == sizeof(char) && (__pyx_t_5numpy_int32_t)-1 < 0); break;
      case 'h': ok = (sizeof(__pyx_t_5numpy_int32_t) == sizeof(short) && (__pyx_t_5numpy_int32_t)-1 < 0); break;
      case 'i': ok = (sizeof(__pyx_t_5numpy_int32_t) == sizeof(int) && (__pyx_t_5numpy_int32_t)-1 < 0); break;
      case 'l': ok = (sizeof(__pyx_t_5numpy_int32_t) == sizeof(long) && (__pyx_t_5numpy_int32_t)-1 < 0); break;
      case 'q': ok = (sizeof(__pyx_t_5numpy_int32_t) == sizeof(long long) && (__pyx_t_5numpy_int32_t)-1 < 0); break;
      default: ok = 0;
    }
    if (!(ok)) {
      PyErr_Format(PyExc_ValueError, "Buffer dtype mismatch (expected numpy.int32_t, got %s)", __Pyx_DescribeTokenInFormatString(ts));
      return NULL;
    }
    ++ts;
    return ts;
  }
  
static int __Pyx_GetBuffer_nn___pyx_t_5numpy_int32_t(PyObject* obj, Py_buffer* buf, int flags, int nd, int cast) {
  const char* ts;
  if (obj == Py_None) {
    __Pyx_ZeroBuffer(buf);
    return 0;
  }
  buf->buf = NULL;
  if (__Pyx_GetBuffer(obj, buf, flags) == -1) goto fail;
  if (buf->ndim != nd) {
    __Pyx_BufferNdimError(buf, nd);
    goto fail;
  }
  if (!cast) {
    ts = buf->format;
    ts = __Pyx_ConsumeWhitespace(ts);
    if (!ts) goto fail;
    ts = __Pyx_CheckTypestring_nn___pyx_t_5numpy_int32_t(ts);
    if (!ts) goto fail;
    ts = __Pyx_ConsumeWhitespace(ts);
    if (!ts) goto fail;
    if (*ts != 0) {
      PyErr_Format(PyExc_ValueError,
        "Buffer dtype mismatch (expected end, got %s)",
        __Pyx_DescribeTokenInFormatString(ts));
      goto fail;
    }
  } else {
    if (buf->itemsize != sizeof(__pyx_t_5numpy_int32_t)) {
      PyErr_SetString(PyExc_ValueError,
        "Attempted cast of buffer to datatype of different size.");
      goto fail;
    }
  }
  if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
  return 0;
fail:;
  __Pyx_ZeroBuffer(buf);
  return -1;
}static const char* __Pyx_CheckTypestring_nn___pyx_t_5numpy_int16_t(const char* ts) {
    int ok;
    ts = __Pyx_ConsumeWhitespace(ts); if (!ts) return NULL;
    if (*ts == '1') ++ts;
    switch (*ts) {
      case 'b': ok = (sizeof(__pyx_t_5numpy_int16_t) == sizeof(char) && (__pyx_t_5numpy_int16_t)-1 < 0); break;
      case 'h': ok = (sizeof(__pyx_t_5numpy_int16_t) == sizeof(short) && (__pyx_t_5numpy_int16_t)-1 < 0); break;
      case 'i': ok = (sizeof(__pyx_t_5numpy_int16_t) == sizeof(int) && (__pyx_t_5numpy_int16_t)-1 < 0); break;
      case 'l': ok = (sizeof(__pyx_t_5numpy_int16_t) == sizeof(long) && (__pyx_t_5numpy_int16_t)-1 < 0); break;
      case 'q': ok = (sizeof(__pyx_t_5numpy_int16_t) == sizeof(long long) && (__pyx_t_5numpy_int16_t)-1 < 0); break;
      default: ok = 0;
    }
    if (!(ok)) {
      PyErr_Format(PyExc_ValueError, "Buffer dtype mismatch (expected numpy.int16_t, got %s)", __Pyx_DescribeTokenInFormatString(ts));
      return NULL;
    }
    ++ts;
    return ts;
  }
  
static int __Pyx_GetBuffer_nn___pyx_t_5numpy_int16_t(PyObject* obj, Py_buffer* buf, int flags, int nd, int cast) {
  const char* ts;
  if (obj == Py_None) {
    __Pyx_ZeroBuffer(buf);
    return 0;
  }
  buf->buf = NULL;
  if (__Pyx_GetBuffer(obj, buf, flags) == -1) goto fail;
  if (buf->ndim != nd) {
    __Pyx_BufferNdimError(buf, nd);
    goto fail;
  }
  if (!cast) {
    ts = buf->format;
    ts = __Pyx_ConsumeWhitespace(ts);
    if (!ts) goto fail;
    ts = __Pyx_CheckTypestring_nn___pyx_t_5numpy_int16_t(ts);
    if (!ts) goto fail;
    ts = __Pyx_ConsumeWhitespace(ts);
    if (!ts) goto fail;
    if (*ts != 0) {
      PyErr_Format(PyExc_ValueError,
        "Buffer dtype mismatch (expected end, got %s)",
        __Pyx_DescribeTokenInFormatString(ts));
      goto fail;
    }
  } else {
    if (buf->itemsize != sizeof(__pyx_t_5numpy_int16_t)) {
      PyErr_SetString(PyExc_ValueError,
        "Attempted cast of buffer to datatype of different size.");
      goto fail;
    }
  }
  if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
  return 0;
fail:;
  __Pyx_ZeroBuffer(buf);
  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 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);
}

#if PY_MAJOR_VERSION < 3
static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
  #if PY_VERSION_HEX >= 0x02060000
  if (Py_TYPE(obj)->tp_flags & Py_TPFLAGS_HAVE_NEWBUFFER)
      return PyObject_GetBuffer(obj, view, flags);
  #endif
  if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pf_5numpy_7ndarray___getbuffer__(obj, view, flags);
  else {
  PyErr_Format(PyExc_TypeError, "'%100s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
  return -1;
    }
}

static void __Pyx_ReleaseBuffer(Py_buffer *view) {
  PyObject* obj = view->obj;
  if (obj) {
if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) __pyx_pf_5numpy_7ndarray___releasebuffer__(obj, view);
    Py_DECREF(obj);
    view->obj = NULL;
  }
}

#endif

static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) {
    PyObject *__import__ = 0;
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    __import__ = PyObject_GetAttrString(__pyx_b, "__import__");
    if (!__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(__import__,
        name, global_dict, empty_dict, list, NULL);
bad:
    Py_XDECREF(empty_list);
    Py_XDECREF(__import__);
    Py_XDECREF(empty_dict);
    return module;
}

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 PyObject *__Pyx_UnpackItem(PyObject *iter, Py_ssize_t index) {
    PyObject *item;
    if (!(item = PyIter_Next(iter))) {
        if (!PyErr_Occurred()) {
            PyErr_Format(PyExc_ValueError,
                #if PY_VERSION_HEX < 0x02050000
                    "need more than %d values to unpack", (int)index);
                #else
                    "need more than %zd values to unpack", index);
                #endif
        }
    }
    return item;
}

static int __Pyx_EndUnpack(PyObject *iter) {
    PyObject *item;
    if ((item = PyIter_Next(iter))) {
        Py_DECREF(item);
        PyErr_SetString(PyExc_ValueError, "too many values to unpack");
        return -1;
    }
    else if (!PyErr_Occurred())
        return 0;
    else
        return -1;
}

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;
}

static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    __Pyx_ErrFetch(type, value, tb);
    PyErr_NormalizeException(type, value, tb);
    if (PyErr_Occurred())
        goto bad;
    Py_INCREF(*type);
    Py_INCREF(*value);
    Py_INCREF(*tb);
    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;
    /* 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:
    Py_XDECREF(*type);
    Py_XDECREF(*value);
    Py_XDECREF(*tb);
    return -1;
}


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_SetVtable(PyObject *dict, void *vtable) {
    PyObject *pycobj = 0;
    int result;
    
    pycobj = PyCObject_FromVoidPtr(vtable, 0);
    if (!pycobj)
        goto bad;
    if (PyDict_SetItemString(dict, "__pyx_vtable__", pycobj) < 0)
        goto bad;
    result = 0;
    goto done;

bad:
    result = -1;
done:
    Py_XDECREF(pycobj);
    return result;
}

#ifndef __PYX_HAVE_RT_ImportType
#define __PYX_HAVE_RT_ImportType
static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
    long size)
{
    PyObject *py_module = 0;
    PyObject *result = 0;
    PyObject *py_name = 0;

    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 (((PyTypeObject *)result)->tp_basicsize != size) {
        PyErr_Format(PyExc_ValueError, 
            "%s.%s does not appear to be the correct type object",
            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;
    PyObject *empty_string = 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;
    #if PY_MAJOR_VERSION < 3
    empty_string = PyString_FromStringAndSize("", 0);
    #else
    empty_string = PyBytes_FromStringAndSize("", 0);
    #endif
    if (!empty_string) 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,*/
        empty_string, /*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,*/
        empty_string  /*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(empty_string);
    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->is_identifier)) {
            *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_identifier || (t->is_unicode && t->intern)) {
            *t->p = PyUnicode_InternFromString(t->s);
        } else if (t->is_unicode) {
            *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 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 INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   if (x == Py_True) return 1;
   else if (x == Py_False) return 0;
   else return PyObject_IsTrue(x);
}

static INLINE PY_LONG_LONG __pyx_PyInt_AsLongLong(PyObject* x) {
    if (PyInt_CheckExact(x)) {
        return PyInt_AS_LONG(x);
    }
    else if (PyLong_CheckExact(x)) {
        return PyLong_AsLongLong(x);
    }
    else {
        PY_LONG_LONG val;
        PyObject* tmp = PyNumber_Int(x); if (!tmp) return (PY_LONG_LONG)-1;
        val = __pyx_PyInt_AsLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static INLINE unsigned PY_LONG_LONG __pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
    if (PyInt_CheckExact(x)) {
        long val = PyInt_AS_LONG(x);
        if (unlikely(val < 0)) {
            PyErr_SetString(PyExc_TypeError, "Negative assignment to unsigned type.");
            return (unsigned PY_LONG_LONG)-1;
        }
        return val;
    }
    else if (PyLong_CheckExact(x)) {
        return PyLong_AsUnsignedLongLong(x);
    }
    else {
        PY_LONG_LONG val;
        PyObject* tmp = PyNumber_Int(x); if (!tmp) return (PY_LONG_LONG)-1;
        val = __pyx_PyInt_AsUnsignedLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}


static INLINE unsigned char __pyx_PyInt_unsigned_char(PyObject* x) {
    if (sizeof(unsigned char) < sizeof(long)) {
        long long_val = __pyx_PyInt_AsLong(x);
        unsigned char val = (unsigned char)long_val;
        if (unlikely((val != long_val)  || (long_val < 0))) {
            PyErr_SetString(PyExc_OverflowError, "value too large to convert to unsigned char");
            return (unsigned char)-1;
        }
        return val;
    }
    else {
        return __pyx_PyInt_AsLong(x);
    }
}

static INLINE unsigned short __pyx_PyInt_unsigned_short(PyObject* x) {
    if (sizeof(unsigned short) < sizeof(long)) {
        long long_val = __pyx_PyInt_AsLong(x);
        unsigned short val = (unsigned short)long_val;
        if (unlikely((val != long_val)  || (long_val < 0))) {
            PyErr_SetString(PyExc_OverflowError, "value too large to convert to unsigned short");
            return (unsigned short)-1;
        }
        return val;
    }
    else {
        return __pyx_PyInt_AsLong(x);
    }
}

static INLINE char __pyx_PyInt_char(PyObject* x) {
    if (sizeof(char) < sizeof(long)) {
        long long_val = __pyx_PyInt_AsLong(x);
        char val = (char)long_val;
        if (unlikely((val != long_val) )) {
            PyErr_SetString(PyExc_OverflowError, "value too large to convert to char");
            return (char)-1;
        }
        return val;
    }
    else {
        return __pyx_PyInt_AsLong(x);
    }
}

static INLINE short __pyx_PyInt_short(PyObject* x) {
    if (sizeof(short) < sizeof(long)) {
        long long_val = __pyx_PyInt_AsLong(x);
        short val = (short)long_val;
        if (unlikely((val != long_val) )) {
            PyErr_SetString(PyExc_OverflowError, "value too large to convert to short");
            return (short)-1;
        }
        return val;
    }
    else {
        return __pyx_PyInt_AsLong(x);
    }
}

static INLINE int __pyx_PyInt_int(PyObject* x) {
    if (sizeof(int) < sizeof(long)) {
        long long_val = __pyx_PyInt_AsLong(x);
        int val = (int)long_val;
        if (unlikely((val != long_val) )) {
            PyErr_SetString(PyExc_OverflowError, "value too large to convert to int");
            return (int)-1;
        }
        return val;
    }
    else {
        return __pyx_PyInt_AsLong(x);
    }
}

static INLINE long __pyx_PyInt_long(PyObject* x) {
    if (sizeof(long) < sizeof(long)) {
        long long_val = __pyx_PyInt_AsLong(x);
        long val = (long)long_val;
        if (unlikely((val != long_val) )) {
            PyErr_SetString(PyExc_OverflowError, "value too large to convert to long");
            return (long)-1;
        }
        return val;
    }
    else {
        return __pyx_PyInt_AsLong(x);
    }
}

static INLINE signed char __pyx_PyInt_signed_char(PyObject* x) {
    if (sizeof(signed char) < sizeof(long)) {
        long long_val = __pyx_PyInt_AsLong(x);
        signed char val = (signed char)long_val;
        if (unlikely((val != long_val) )) {
            PyErr_SetString(PyExc_OverflowError, "value too large to convert to signed char");
            return (signed char)-1;
        }
        return val;
    }
    else {
        return __pyx_PyInt_AsLong(x);
    }
}

static INLINE signed short __pyx_PyInt_signed_short(PyObject* x) {
    if (sizeof(signed short) < sizeof(long)) {
        long long_val = __pyx_PyInt_AsLong(x);
        signed short val = (signed short)long_val;
        if (unlikely((val != long_val) )) {
            PyErr_SetString(PyExc_OverflowError, "value too large to convert to signed short");
            return (signed short)-1;
        }
        return val;
    }
    else {
        return __pyx_PyInt_AsLong(x);
    }
}

static INLINE signed int __pyx_PyInt_signed_int(PyObject* x) {
    if (sizeof(signed int) < sizeof(long)) {
        long long_val = __pyx_PyInt_AsLong(x);
        signed int val = (signed int)long_val;
        if (unlikely((val != long_val) )) {
            PyErr_SetString(PyExc_OverflowError, "value too large to convert to signed int");
            return (signed int)-1;
        }
        return val;
    }
    else {
        return __pyx_PyInt_AsLong(x);
    }
}

static INLINE signed long __pyx_PyInt_signed_long(PyObject* x) {
    if (sizeof(signed long) < sizeof(long)) {
        long long_val = __pyx_PyInt_AsLong(x);
        signed long val = (signed long)long_val;
        if (unlikely((val != long_val) )) {
            PyErr_SetString(PyExc_OverflowError, "value too large to convert to signed long");
            return (signed long)-1;
        }
        return val;
    }
    else {
        return __pyx_PyInt_AsLong(x);
    }
}

static INLINE long double __pyx_PyInt_long_double(PyObject* x) {
    if (sizeof(long double) < sizeof(long)) {
        long long_val = __pyx_PyInt_AsLong(x);
        long double val = (long double)long_val;
        if (unlikely((val != long_val) )) {
            PyErr_SetString(PyExc_OverflowError, "value too large to convert to long double");
            return (long double)-1;
        }
        return val;
    }
    else {
        return __pyx_PyInt_AsLong(x);
    }
}

