Ignore:
Timestamp:
Sep 21, 2014, 2:01:29 AM (10 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
Children:
24931d5
Parents:
96a96d7
Message:

python/ext/py-{source,sink}.c: improve documentation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/ext/py-sink.c

    r96a96d7 ra79ec76  
    1010} Py_sink;
    1111
    12 static char Py_sink_doc[] = "sink object";
     12static char Py_sink_doc[] = ""
     13"  __new__(path, samplerate = 44100, channels = 1)\n"
     14"\n"
     15"      Create a new sink, opening the given path for writing.\n"
     16"\n"
     17"      Examples\n"
     18"      --------\n"
     19"\n"
     20"      Create a new sink at 44100Hz, mono:\n"
     21"\n"
     22"      >>> sink('/tmp/t.wav')\n"
     23"\n"
     24"      Create a new sink at 8000Hz, mono:\n"
     25"\n"
     26"      >>> sink('/tmp/t.wav', samplerate = 8000)\n"
     27"\n"
     28"      Create a new sink at 32000Hz, stereo:\n"
     29"\n"
     30"      >>> sink('/tmp/t.wav', samplerate = 32000, channels = 2)\n"
     31"\n"
     32"      Create a new sink at 32000Hz, 5 channels:\n"
     33"\n"
     34"      >>> sink('/tmp/t.wav', channels = 5, samplerate = 32000)\n"
     35"\n"
     36"  __call__(vec, write)\n"
     37"      x(vec,write) <==> x.do(vec, write)\n"
     38"\n"
     39"      Write vector to sink.\n"
     40"\n"
     41"      See also\n"
     42"      --------\n"
     43"      aubio.sink.do\n"
     44"\n";
     45
     46static char Py_sink_do_doc[] = ""
     47"x.do(vec, write) <==> x(vec, write)\n"
     48"\n"
     49"write monophonic vector to sink";
     50
     51static char Py_sink_do_multi_doc[] = ""
     52"x.do_multi(mat, write)\n"
     53"\n"
     54"write polyphonic vector to sink";
     55
     56static char Py_sink_close_doc[] = ""
     57"x.close()\n"
     58"\n"
     59"close this sink now";
    1360
    1461static PyObject *
     
    114161}
    115162
    116 /* function Py_sink_do */
     163/* function Py_sink_do_multi */
    117164static PyObject *
    118165Py_sink_do_multi(Py_sink * self, PyObject * args)
     
    148195
    149196AUBIO_MEMBERS_START(sink)
    150   {"uri", T_STRING, offsetof (Py_sink, uri), READONLY, ""},
    151   {"samplerate", T_INT, offsetof (Py_sink, samplerate), READONLY, ""},
    152   {"channels", T_INT, offsetof (Py_sink, channels), READONLY, ""},
     197  {"uri", T_STRING, offsetof (Py_sink, uri), READONLY,
     198    "path at which the sink was created"},
     199  {"samplerate", T_INT, offsetof (Py_sink, samplerate), READONLY,
     200    "samplerate at which the sink was created"},
     201  {"channels", T_INT, offsetof (Py_sink, channels), READONLY,
     202    "number of channels with which the sink was created"},
    153203AUBIO_MEMBERS_STOP(sink)
    154204
     
    161211
    162212static PyMethodDef Py_sink_methods[] = {
    163   {"__call__", (PyCFunction) Py_sink_do, METH_VARARGS,
    164     "x.__call__(vec, write)\n"
    165     "write monophonic vector to sink"
    166     ""},
    167   {"do", (PyCFunction) Py_sink_do, METH_VARARGS,
    168     "x.do(vec, write)\n"
    169     "write monophonic vector to sink"
    170     ""},
    171   {"do_multi", (PyCFunction) Py_sink_do_multi, METH_VARARGS,
    172     "x.do_multi(mat, write)\n"
    173     "write polyphonic vector to sink"},
    174   {"close", (PyCFunction) Pyaubio_sink_close, METH_NOARGS,
    175     "x.close()\n"
    176     "close this sink now"},
     213  {"do", (PyCFunction) Py_sink_do, METH_VARARGS, Py_sink_do_doc},
     214  {"do_multi", (PyCFunction) Py_sink_do_multi, METH_VARARGS, Py_sink_do_multi_doc},
     215  {"close", (PyCFunction) Pyaubio_sink_close, METH_NOARGS, Py_sink_close_doc},
    177216  {NULL} /* sentinel */
    178217};
Note: See TracChangeset for help on using the changeset viewer.