Ignore:
File:
1 edited

Legend:

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

    r0629356 rfcb6e8c  
    1313
    1414static char Py_sink_doc[] = ""
    15 "sink(path, samplerate=44100, channels=1)\n"
    16 "\n"
    17 "Open `path` to write a WAV file.\n"
    18 "\n"
    19 "Parameters\n"
    20 "----------\n"
    21 "path : str\n"
    22 "   Pathname of the file to be opened for writing.\n"
    23 "samplerate : int\n"
    24 "   Sampling rate of the file, in Hz.\n"
    25 "channels : int\n"
    26 "   Number of channels to create the file with.\n"
    27 "\n"
    28 "Examples\n"
    29 "--------\n"
    30 "\n"
    31 "Create a new sink at 44100Hz, mono:\n"
    32 "\n"
    33 ">>> snk = aubio.sink('out.wav')\n"
    34 "\n"
    35 "Create a new sink at 32000Hz, stereo, write 100 samples into it:\n"
    36 "\n"
    37 ">>> snk = aubio.sink('out.wav', samplerate=16000, channels=3)\n"
    38 ">>> snk(aubio.fvec(100), 100)\n"
    39 "\n"
    40 "Open a new sink at 48000Hz, stereo, write `1234` samples into it:\n"
    41 "\n"
    42 ">>> with aubio.sink('out.wav', samplerate=48000, channels=2) as src:\n"
    43 "...     snk(aubio.fvec(1024), 1024)\n"
    44 "...     snk(aubio.fvec(210), 210)\n"
    45 "...\n"
    46 "\n"
    47 "See also\n"
    48 "--------\n"
    49 "source: read audio samples from a file.\n"
     15"  __new__(path, samplerate = 44100, channels = 1)\n"
     16"\n"
     17"      Create a new sink, opening the given path for writing.\n"
     18"\n"
     19"      Examples\n"
     20"      --------\n"
     21"\n"
     22"      Create a new sink at 44100Hz, mono:\n"
     23"\n"
     24"      >>> sink('/tmp/t.wav')\n"
     25"\n"
     26"      Create a new sink at 8000Hz, mono:\n"
     27"\n"
     28"      >>> sink('/tmp/t.wav', samplerate = 8000)\n"
     29"\n"
     30"      Create a new sink at 32000Hz, stereo:\n"
     31"\n"
     32"      >>> sink('/tmp/t.wav', samplerate = 32000, channels = 2)\n"
     33"\n"
     34"      Create a new sink at 32000Hz, 5 channels:\n"
     35"\n"
     36"      >>> sink('/tmp/t.wav', channels = 5, samplerate = 32000)\n"
     37"\n"
     38"  __call__(vec, write)\n"
     39"      x(vec,write) <==> x.do(vec, write)\n"
     40"\n"
     41"      Write vector to sink.\n"
     42"\n"
     43"      See also\n"
     44"      --------\n"
     45"      aubio.sink.do\n"
    5046"\n";
    5147
    5248static char Py_sink_do_doc[] = ""
    53 "do(vec, write)\n"
    54 "\n"
    55 "Write a single channel vector to sink.\n"
    56 "\n"
    57 "Parameters\n"
    58 "----------\n"
    59 "vec : fvec\n"
    60 "   input vector `(n,)` where `n >= 0`.\n"
    61 "write : int\n"
    62 "   Number of samples to write.\n"
    63 "";
     49"x.do(vec, write) <==> x(vec, write)\n"
     50"\n"
     51"write monophonic vector to sink";
    6452
    6553static char Py_sink_do_multi_doc[] = ""
    66 "do_multi(mat, write)\n"
    67 "\n"
    68 "Write a matrix containing vectors from multiple channels to sink.\n"
    69 "\n"
    70 "Parameters\n"
    71 "----------\n"
    72 "mat : numpy.ndarray\n"
    73 "   input matrix of shape `(channels, n)`, where `n >= 0`.\n"
    74 "write : int\n"
    75 "   Number of frames to write.\n"
    76 "";
     54"x.do_multi(mat, write)\n"
     55"\n"
     56"write polyphonic vector to sink";
    7757
    7858static char Py_sink_close_doc[] = ""
    79 "close()\n"
    80 "\n"
    81 "Close this sink now.\n"
    82 "\n"
    83 "By default, the sink will be closed before being deleted.\n"
    84 "Explicitely closing a sink can be useful to control the number\n"
    85 "of files simultaneously opened.\n"
    86 "";
     59"x.close()\n"
     60"\n"
     61"close this sink now";
    8762
    8863static PyObject *
     
    214189static PyMemberDef Py_sink_members[] = {
    215190  {"uri", T_STRING, offsetof (Py_sink, uri), READONLY,
    216     "str (read-only): Path at which the sink was created."},
     191    "path at which the sink was created"},
    217192  {"samplerate", T_INT, offsetof (Py_sink, samplerate), READONLY,
    218     "int (read-only): Samplerate at which the sink was created."},
     193    "samplerate at which the sink was created"},
    219194  {"channels", T_INT, offsetof (Py_sink, channels), READONLY,
    220     "int (read-only): Number of channels with which the sink was created."},
     195    "number of channels with which the sink was created"},
    221196  { NULL } // sentinel
    222197};
Note: See TracChangeset for help on using the changeset viewer.