{ "info": { "author": "Matthias Geier", "author_email": "Matthias.Geier@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Multimedia :: Sound/Audio" ], "description": "Python wrapper for PortAudio's ring buffer\n==========================================\n\nThe `ring buffer functionality`_ is typically not included in binary\ndistributions of PortAudio_, therefore most Python wrappers don't include it,\neither.\n\nThe ``pa_ringbuffer`` module provides only a Python wrapper, the actual\nPortAudio ring buffer code has to be compiled separately, see Usage_.\nIt can be used on any Python version where CFFI_ is available.\n\nThis module is designed to be used together with the sounddevice_ module (it\nmight work with other modules, too) for non-blocking transfer of data between\nthe main Python program and an audio callback function which is implemented in C\nor some other compiled language.\n\n.. _PortAudio: http://portaudio.com/\n.. _ring buffer functionality: http://portaudio.com/docs/v19-doxydocs-dev/\n pa__ringbuffer_8h.html\n.. _sounddevice: http://python-sounddevice.readthedocs.io/\n.. _CFFI: http://cffi.readthedocs.io/\n\nUsage\n-----\n\nThis module is not meant to be used on its own, it is only useful in cooperation\nwith another Python module using CFFI.\nFor an example, have a look at https://github.com/spatialaudio/python-rtmixer.\n\nYou can get the Python code from PyPI_, for example in your ``setup.py`` file\n(in the following example, your module would be called ``mycffimodule``):\n\n.. code:: python\n\n from setuptools import setup\n\n setup(\n name=...,\n version=...,\n author=...,\n ...,\n cffi_modules=['mycffimodule_build.py:ffibuilder'],\n setup_requires=['CFFI', 'pa_ringbuffer'],\n install_requires=['pa_ringbuffer'],\n ...,\n )\n\n.. _PyPI: https://pypi.python.org/pypi/pa-ringbuffer\n\nAlternatively, you can just copy the file ``src/pa_ringbuffer.py`` to your own\nsource directory and import it from there.\n\nYou can build your own CFFI module like described in\nhttp://cffi.readthedocs.io/en/latest/cdef.html, just adding a few more bits to\nyour ``mycffimodule_build.py``:\n\n.. code:: python\n\n from cffi import FFI\n import pa_ringbuffer\n\n ffibuilder = FFI()\n ffibuilder.cdef(pa_ringbuffer.cdef())\n ffibuilder.cdef(\"\"\"\n\n /* my own declarations */\n\n \"\"\")\n ffibuilder.set_source(\n '_mycffimodule',\n '/* my implementation */',\n sources=['portaudio/src/common/pa_ringbuffer.c'],\n )\n\n if __name__ == '__main__':\n ffibuilder.compile(verbose=True)\n\nNote that the following files must be available to the compiler:\n\n* https://app.assembla.com/spaces/portaudio/git/source/master/src/common/pa_ringbuffer.c\n* https://app.assembla.com/spaces/portaudio/git/source/master/src/common/pa_ringbuffer.h\n* https://app.assembla.com/spaces/portaudio/git/source/master/src/common/pa_memorybarrier.h\n\nFor your own C code, you might need some definitions from the main PortAudio\nheader:\n\n* https://app.assembla.com/spaces/portaudio/git/source/master/include/portaudio.h\n\nOnce you have compiled your extension module (with the help of CFFI), you can\nuse something like this in your own module to get access to the ``RingBuffer``\nclass:\n\n.. code:: python\n\n import pa_ringbuffer\n from _mycffimodule import ffi, lib\n\n RingBuffer = pa_ringbuffer.init(ffi, lib)\n\nAPI Reference\n-------------\n\nThere are only two functions:\n\n``pa_ringbuffer.cdef()``\n^^^^^^^^^^^^^^^^^^^^^^^^\n\nThis function returns a string containing C declarations from the file\n``pa_ringbuffer.h``, which can be used as argument to CFFI's `cdef()`_ function\n(see Usage_ above). Note that the returned declarations are slightly different\nwhen called on a macOS/Darwin system.\n\n.. _cdef(): http://cffi.readthedocs.io/en/latest/\n cdef.html#ffi-ffibuilder-cdef-declaring-types-and-functions\n\n``pa_ringbuffer.init(ffi, lib)``\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThis function returns the ``RingBuffer`` class which is associated with the CFFI\ninstance given by ``ffi`` and ``lib``.\n\nCreating the Documentation\n--------------------------\n\nThe documentation of the ``RingBuffer`` class is not available separately.\nIf you are using Sphinx_, you can seamlessly include the documentation of the\n``RingBuffer`` class with your own documentation.\nAn example for this can be found at\nhttps://github.com/spatialaudio/python-rtmixer, the generated documentation is\navailable at http://python-rtmixer.readthedocs.io/#rtmixer.RingBuffer.\n\nYou'll need to have the autodoc_ extension activated in your ``conf.py``:\n\n.. code:: python\n\n extensions = [\n ...,\n 'sphinx.ext.autodoc',\n ...,\n ]\n\nAnd somewhere within your module documentation, you should add this:\n\n.. code:: rst\n\n .. autoclass:: RingBuffer\n :inherited-members:\n\nBefore that, you might have to use the currentmodule_ directive to select your\nown module. Using automodule_ should also do.\n\n.. _Sphinx: http://www.sphinx-doc.org/\n.. _autodoc: http://www.sphinx-doc.org/ext/autodoc.html\n.. _currentmodule: http://www.sphinx-doc.org/domains.html\n #directive-py:currentmodule\n.. _automodule: http://www.sphinx-doc.org/ext/autodoc.html#directive-automodule\n\nVersion History\n---------------\n\n0.1.3 (2018-06-02):\n * No new features, just a minor documentation update\n\n0.1.2 (2017-10-21):\n * No new features, just a bug fix\n\n0.1.1 (2017-09-04):\n * Add ``buffer`` parameter\n\n0.1.0 (2017-08-08):\n Initial release\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/spatialaudio/python-pa-ringbuffer", "keywords": "sound,audio,PortAudio,ringbuffer,lock-free", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "pa-ringbuffer", "package_url": "https://pypi.org/project/pa-ringbuffer/", "platform": "any", "project_url": "https://pypi.org/project/pa-ringbuffer/", "project_urls": { "Homepage": "https://github.com/spatialaudio/python-pa-ringbuffer" }, "release_url": "https://pypi.org/project/pa-ringbuffer/0.1.3/", "requires_dist": null, "requires_python": "", "summary": "Python wrapper for PortAudio's ring buffer", "version": "0.1.3" }, "last_serial": 3923495, "releases": { "0.0.0": [ { "comment_text": "", "digests": { "md5": "2c74020603cd19e784afd0e00b52a51a", "sha256": "e9dc298df460514c51828b53f072c0fc2329dd847855e229eb7a007c4ad2b141" }, "downloads": -1, "filename": "pa-ringbuffer-0.0.0.tar.gz", "has_sig": false, "md5_digest": "2c74020603cd19e784afd0e00b52a51a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5692, "upload_time": "2017-07-23T13:16:51", "url": "https://files.pythonhosted.org/packages/bd/a4/86515de24d24fb97abe805dc18a939ca74346169f7b6ee9a9b3355418724/pa-ringbuffer-0.0.0.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "9a438debf75bf5cf86883494ea9efff1", "sha256": "d2f78e66f6dee8e3ab7fb45f2b33c64ac693e1f68d5646af1df18a7070b4c271" }, "downloads": -1, "filename": "pa_ringbuffer-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "9a438debf75bf5cf86883494ea9efff1", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8053, "upload_time": "2017-08-08T20:08:24", "url": "https://files.pythonhosted.org/packages/86/0e/a253612298e83fe047f86b18b8db30e8c71923a20d569e40b8a9691a30aa/pa_ringbuffer-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "efdf3362f2abb8fe3e62e46dc4fb90da", "sha256": "dde5e8766dcc2334db7982afcc7656976887aab1387a03e5a5c0706c30072961" }, "downloads": -1, "filename": "pa-ringbuffer-0.1.0.tar.gz", "has_sig": false, "md5_digest": "efdf3362f2abb8fe3e62e46dc4fb90da", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6631, "upload_time": "2017-08-08T20:08:26", "url": "https://files.pythonhosted.org/packages/cf/2e/305fd939a928a35e97a60eea2a58af2b8b683c0db7a70c86d76c8d0241cf/pa-ringbuffer-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "c42d7edb3b7a73940225e45b01fa4cfd", "sha256": "63550fdd1db7c67b68afb90a85b13f0c153aa6b3eb5792fe52434f74753386c3" }, "downloads": -1, "filename": "pa_ringbuffer-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "c42d7edb3b7a73940225e45b01fa4cfd", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8640, "upload_time": "2017-09-04T07:50:31", "url": "https://files.pythonhosted.org/packages/38/bc/e706463b7c7b6dc71fa393d6543c24c7c6294d28e3453f85b20406724084/pa_ringbuffer-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "82d1638cb51bcc8133fd56e6344feb02", "sha256": "f94a1c057cf7148b51354a1e233684c3132b235706b1312f6f2a80e032fb9eb2" }, "downloads": -1, "filename": "pa-ringbuffer-0.1.1.tar.gz", "has_sig": false, "md5_digest": "82d1638cb51bcc8133fd56e6344feb02", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7154, "upload_time": "2017-09-04T07:50:32", "url": "https://files.pythonhosted.org/packages/7c/60/58e77576cdc649070acf7c5311df55c51b7acbcf70272c8e354219e15419/pa-ringbuffer-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "2d484c4329f00198dc456b356744944a", "sha256": "1097519b408f80bb33ee37c45e5d9be06827a4a9a922eecb3f52b08a07ce464c" }, "downloads": -1, "filename": "pa_ringbuffer-0.1.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "2d484c4329f00198dc456b356744944a", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8738, "upload_time": "2017-10-21T15:57:25", "url": "https://files.pythonhosted.org/packages/21/27/b8f002a2d84a5ce4a6aec0b36228d554fd4d4a0e303ed9d89709107c6283/pa_ringbuffer-0.1.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "86266044c63d08c8fdd06dbf9ee435aa", "sha256": "d13f6c1fab3b7d2c3ec885fd1b2123ce072030233dbb3183c3f88f18c39daf84" }, "downloads": -1, "filename": "pa-ringbuffer-0.1.2.tar.gz", "has_sig": false, "md5_digest": "86266044c63d08c8fdd06dbf9ee435aa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7214, "upload_time": "2017-10-21T15:57:27", "url": "https://files.pythonhosted.org/packages/d3/d3/7137027be68b7a29546dc6196300b8004f13c39539d91541bb2b1185991b/pa-ringbuffer-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "db86c2ef0997fa4d521b63d91e85dfaf", "sha256": "f7ac1465562a9910a4048a9888aaff1e3c3589500f669ca22a151674f3481d77" }, "downloads": -1, "filename": "pa_ringbuffer-0.1.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "db86c2ef0997fa4d521b63d91e85dfaf", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8799, "upload_time": "2018-06-02T12:48:29", "url": "https://files.pythonhosted.org/packages/f5/46/6c23c7852aeb0c6046069ff2cc8a40e1d6dc405fe449e4e3a57030b2a0df/pa_ringbuffer-0.1.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b523a280f989298b4a58e8c6135101f7", "sha256": "bfe5ed7f581befb46319bf6642f883f69ca917f8450628abfab4255a911b7df0" }, "downloads": -1, "filename": "pa-ringbuffer-0.1.3.tar.gz", "has_sig": false, "md5_digest": "b523a280f989298b4a58e8c6135101f7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7275, "upload_time": "2018-06-02T12:48:30", "url": "https://files.pythonhosted.org/packages/f0/c3/834b38ae72becaf3f54ee66478db69ab28a63fd11b5de781454842171474/pa-ringbuffer-0.1.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "db86c2ef0997fa4d521b63d91e85dfaf", "sha256": "f7ac1465562a9910a4048a9888aaff1e3c3589500f669ca22a151674f3481d77" }, "downloads": -1, "filename": "pa_ringbuffer-0.1.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "db86c2ef0997fa4d521b63d91e85dfaf", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8799, "upload_time": "2018-06-02T12:48:29", "url": "https://files.pythonhosted.org/packages/f5/46/6c23c7852aeb0c6046069ff2cc8a40e1d6dc405fe449e4e3a57030b2a0df/pa_ringbuffer-0.1.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b523a280f989298b4a58e8c6135101f7", "sha256": "bfe5ed7f581befb46319bf6642f883f69ca917f8450628abfab4255a911b7df0" }, "downloads": -1, "filename": "pa-ringbuffer-0.1.3.tar.gz", "has_sig": false, "md5_digest": "b523a280f989298b4a58e8c6135101f7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7275, "upload_time": "2018-06-02T12:48:30", "url": "https://files.pythonhosted.org/packages/f0/c3/834b38ae72becaf3f54ee66478db69ab28a63fd11b5de781454842171474/pa-ringbuffer-0.1.3.tar.gz" } ] }