2501 static PyObject *
2502 pa_get_stream_write_available(PyObject *self, PyObject *args)
2503 {
2504 signed long frames;
2505 PyObject *stream_arg;
2506 _pyAudio_Stream *streamObject;
2507 PaStream *stream;
2508
2509 if (!PyArg_ParseTuple(args, "O!", &_pyAudio_StreamType, &stream_arg))
when PyArg_ParseTuple() succeeds
taking False path
2510 return NULL;
2511
2512 streamObject = (_pyAudio_Stream *) stream_arg;
2513
2514 if (!_is_open(streamObject)) {
when considering value == (int)0 from src/_portaudiomodule.c:2514
taking True path
2515 PyErr_SetObject(PyExc_IOError,
when Py_BuildValue() succeeds
calling PyErr_SetObject()
new ref from call to Py_BuildValue was allocated at: PyErr_SetObject(PyExc_IOError,
ob_refcnt is now refs: 1 owned
ob_refcnt is now refs: 1 owned, 1 borrowed
2516 Py_BuildValue("(s,i)",
2517 "Stream closed",
2518 paBadStreamPtr));
2519 return NULL;
2520 }
2521
2522 stream = streamObject->stream;
2523 frames = Pa_GetStreamWriteAvailable(stream);
2524 return PyLong_FromLong(frames);
2525 }