From 18aa4abbb62d21c718f89a9ab121c7ed643d9595 Mon Sep 17 00:00:00 2001 From: Stefan Sayer Date: Mon, 5 Jul 2010 14:33:34 +0200 Subject: [PATCH] rewind optionally with time offset --- apps/ivr/IvrAudio.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/apps/ivr/IvrAudio.cpp b/apps/ivr/IvrAudio.cpp index 12b13d03..1874c03b 100644 --- a/apps/ivr/IvrAudio.cpp +++ b/apps/ivr/IvrAudio.cpp @@ -146,7 +146,15 @@ static PyObject* IvrAudioFile_fpopen(IvrAudioFile* self, PyObject* args) static PyObject* IvrAudioFile_rewind(IvrAudioFile* self, PyObject* args) { - self->af->rewind(); + int rew_time; + if(!PyArg_ParseTuple(args,"|i",&rew_time)) + return NULL; + + if (rew_time != 0) + self->af->rewind(rew_time); + else + self->af->rewind(); + Py_INCREF(Py_None); return Py_None; } @@ -229,7 +237,7 @@ static PyMethodDef IvrAudioFile_methods[] = { {"close", (PyCFunction)IvrAudioFile_close, METH_NOARGS, "close the audio file" }, - {"rewind", (PyCFunction)IvrAudioFile_rewind, METH_NOARGS, + {"rewind", (PyCFunction)IvrAudioFile_rewind, METH_VARARGS, "rewind the audio file" }, {"getDataSize", (PyCFunction)IvrAudioFile_getDataSize, METH_NOARGS,