static char Py_source_doc[] = ""
"source(path, samplerate=0, hop_size=512, channels=0)\n"
"\n"
-"Create a new source, opening the given pathname for reading.\n"
+"Read audio samples from a media file.\n"
"\n"
"`source` open the file specified in `path` and creates a callable\n"
"returning `hop_size` new audio samples at each invocation.\n"
"... for samples in source:\n"
"... n_frames += len(samples)\n"
"... print('read', n_frames, 'samples in', samples.shape[0], 'channels',\n"
-"... 'from file \"\%s\"' \% source.uri)\n"
+"... 'from file \"%%s\"' %% source.uri)\n"
"...\n"
"read 239334 samples in 2 channels from file \"audiotrack.wav\"\n"
"\n"
/* compute _do function */
aubio_source_do (self->o, &(self->c_read_to), &read);
+ if (PyErr_Occurred() != NULL) {
+ return NULL;
+ }
+
outputs = PyTuple_New(2);
PyTuple_SetItem( outputs, 0, self->read_to );
PyTuple_SetItem( outputs, 1, (PyObject *)PyLong_FromLong(read));
/* compute _do function */
aubio_source_do_multi (self->o, &(self->c_mread_to), &read);
+ if (PyErr_Occurred() != NULL) {
+ return NULL;
+ }
+
outputs = PyTuple_New(2);
PyTuple_SetItem( outputs, 0, self->mread_to);
PyTuple_SetItem( outputs, 1, (PyObject *)PyLong_FromLong(read));