{ "info": { "author": "Bastian Bechtold", "author_email": "", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Intended Audience :: Science/Research", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Multimedia :: Sound/Audio :: Capture/Recording", "Topic :: Multimedia :: Sound/Audio :: Players" ], "description": "SoundCard\n=========\n\n|version| |python| |status| |license|\n\n|contributors| |downloads|\n\nSoundCard is a library for playing and recording audio without resorting to a\nCPython extension. Instead, it is implemented using the wonderful `CFFI\n`__ and the native audio libraries of\nLinux, Windows and macOS.\n\nSoundCard is cross-platform, and supports Linux/pulseaudio, Mac/coreaudio, and\nWindows/WASAPI. While the programming interface is identical across platforms,\nsound card naming schemes and default block sizes can vary between devices and\nplatforms.\n\nSoundCard is still in development. All major features work on all platforms, but\nthere are a few known issues that still need to be fixed. If you find a bug,\nplease open an Issue, and I will try to fix it. Or open a Pull Request, and I\nwill try to include your fix into SoundCard.\n\nHowever, please be aware that this is a hobby project of mine that I am\ndeveloping for free, and in my spare time. While I try to be as accomodating as\npossible, I can not guarantee a timely response to issues. Publishing Open\nSource Software on Github does not imply an obligation to *fix your problem\nright now*. Please be civil.\n\n| SoundCard is licensed under the terms of the BSD 3-clause license\n| (c) 2016 Bastian Bechtold\n\n\n|open-issues| |closed-issues| |open-prs| |closed-prs|\n\n.. |status| image:: https://img.shields.io/pypi/status/soundcard.svg\n.. |contributors| image:: https://img.shields.io/github/contributors/bastibe/soundcard.svg\n.. |version| image:: https://img.shields.io/pypi/v/soundcard.svg\n.. |python| image:: https://img.shields.io/pypi/pyversions/soundcard.svg\n.. |license| image:: https://img.shields.io/github/license/bastibe/soundcard.svg\n.. |downloads| image:: https://img.shields.io/pypi/dm/soundcard.svg\n.. |open-issues| image:: https://img.shields.io/github/issues/bastibe/soundcard.svg\n.. |closed-issues| image:: https://img.shields.io/github/issues-closed/bastibe/soundcard.svg\n.. |open-prs| image:: https://img.shields.io/github/issues-pr/bastibe/soundcard.svg\n.. |closed-prs| image:: https://img.shields.io/github/issues-pr-closed/bastibe/soundcard.svg\n\nTutorial\n--------\n\nHere is how you get to your Speakers and Microphones:\n\n.. code:: python\n\n import soundcard as sc\n\n # get a list of all speakers:\n speakers = sc.all_speakers()\n # get the current default speaker on your system:\n default_speaker = sc.default_speaker()\n # get a list of all microphones:\n mics = sc.all_microphones()\n # get the current default microphone on your system:\n default_mic = sc.default_microphone()\n\n # search for a sound card by substring:\n >>> sc.get_speaker('Scarlett')\n \n >>> one_mic = sc.get_microphone('Scarlett')\n \n # fuzzy-search to get the same results:\n one_speaker = sc.get_speaker('FS2i2')\n one_mic = sc.get_microphone('FS2i2')\n\n\nAll of these functions return ``Speaker`` and ``Microphone`` objects, which can\nbe used for playback and recording. All data passed in and out of these objects\nare *frames \u00d7 channels* Numpy arrays.\n\n.. code:: python\n\n import numpy\n\n >>> print(default_speaker)\n \n >>> print(default_mic)\n \n\n # record and play back one second of audio:\n data = default_mic.record(samplerate=48000, numframes=48000)\n default_speaker.play(data/numpy.max(data), samplerate=48000)\n\n # alternatively, get a `Recorder` and `Player` object\n # and play or record continuously:\n with default_mic.recorder(samplerate=48000) as mic, \\\n default_speaker.player(samplerate=48000) as sp:\n for _ in range(100):\n data = mic.record(numframes=1024)\n sp.play(data)\n\nLatency\n-------\n\nBy default, SoundCard records and plays at the operating system's default\nconfiguration. Particularly on laptops, this configuration might have extreme\nlatencies, up to multiple seconds.\n\nIn order to request lower latencies, pass a ``blocksize`` to ``player`` or\n``recorder``. This tells the operating system your desired latency, and it will\ntry to honor your request as best it can. On Windows/WASAPI, setting\n``exclusive_mode=True`` might help, too (this is currently experimental).\n\nAnother source of latency is in the ``record`` function, which buffers output up\nto the requested ``numframes``. In general, for optimal latency, you should use\na ``numframes`` significantly lower than the ``blocksize`` above, maybe by a\nfactor of two or four.\n\nTo get the audio data as quickly as absolutely possible, you can use\n``numframes=None``, which will return whatever audio data is available right\nnow, without any buffering. Note that this might receive different numbers of\nframes each time.\n\nWith the above settings, block sizes of 256 samples or ten milliseconds are\nusually no problem. The total latency of playback and recording is dependent on\nhow these buffers are handled by the operating system, though, and might be\nsignificantly higher.\n\nChannel Maps\n------------\n\nSome professional sound cards have large numbers of channels. If you want to\nrecord or play only a subset of those channels, you can specify a channel map.\nFor playback, a channel map of ``[0, 3, 4]`` will play three-channel audio data\non the physical channels one, four, and five. For recording, a channel map of\n``[0, 3, 4]`` will return three-channel audio data recorded from the physical\nchannels one, four, and five.\n\nIn addition, pulseaudio/Linux defines channel ``-1`` as the mono mix of all\nchannels for both playback and recording. CoreAudio/macOS defines channel ``-1``\nas silence for both playback and recording.\n\nKnown Issues:\n-------------\n\n* Windows/WASAPI currently records garbage if you record only a single channel.\n The reason for this is yet unknown. Multi-channel and channel maps work,\n though.\n* Windows/WASAPI silently ignores the blocksize in some cases. Apparently, it\n only supports variable block sizes in exclusive mode.\n* Error messages often report some internal CFFI/backend errors. This will be\n improved in the future.\n\nChangelog\n---------\n\n- 2018-04-25 implements fixed block sizes when recording\n (thank you, Pariente Manuel!)\n- 2018-05-10 adds a test suite and various fixes for Windows\n- 2018-05-11 various fixes for macOS\n- 2018-06-27 Adds latency property to Linux/pulseaudio\n (Thank you, Pariente Manuel!)\n- 2018-07-17 adds loopback support for Windows\n (Thank you, Jan Leskovec!)\n- 2018-10-16 adds bug fix for IPython on Windows\n (Thank you, Sebastian Michel!)\n- 2018-11-28 adds Sphinx/Readthedocs documentation\n- 2019-03-25 adds support for Python 3.5\n (Thank you, Daniel R. Kumor!)\n- 2019-04-29 adds experimental support for exclusive mode on Windows\n- 2019-05-13 fixes sample rate conversion on macOS\n- 2019-05-15 fixes silence recording on macOS\n- 2019-06-11 fixes exception when monitoring default device on Linux\n (Thank you, Inti Pelupessy!)\n- 2019-06-18 fixes crash when opening many streams on Linux\n- 2019-08-23 fixes attribute error when accessing stream state on Linux\n (Thank you, Dav\u00ed\u00f0 Sindri P\u00e9tursson)\n- 2019-10-08 fixes inconsistent dtypes when recording on Linux\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/bastibe/SoundCard", "keywords": "", "license": "BSD 3-clause", "maintainer": "", "maintainer_email": "", "name": "SoundCard", "package_url": "https://pypi.org/project/SoundCard/", "platform": "", "project_url": "https://pypi.org/project/SoundCard/", "project_urls": { "Homepage": "https://github.com/bastibe/SoundCard" }, "release_url": "https://pypi.org/project/SoundCard/0.3.3/", "requires_dist": [ "numpy", "cffi" ], "requires_python": ">=3.5", "summary": "Play and record audio without resorting to CPython extensions", "version": "0.3.3" }, "last_serial": 5943591, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "fc7db6587e52a8d5dd60d5bac5ced0a3", "sha256": "cd4125e61e00801837220dab9317bb3d8368df960112c4f584fe2940fb435231" }, "downloads": -1, "filename": "SoundCard-0.1.0.tar.gz", "has_sig": false, "md5_digest": "fc7db6587e52a8d5dd60d5bac5ced0a3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24152, "upload_time": "2017-08-29T14:41:34", "url": "https://files.pythonhosted.org/packages/b8/2c/8e7b107922aedc9f6f15e3e98d5dccd02a9d417e83ed610485b8e483837d/SoundCard-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "cb849e27ae4e0084f9d29b3b2fbcd30e", "sha256": "b707ae20e9d16b09fa65d0e123fe20c1645ecd4f20ed5dd7f40e49554e66ac9b" }, "downloads": -1, "filename": "SoundCard-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "cb849e27ae4e0084f9d29b3b2fbcd30e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 29091, "upload_time": "2017-10-25T10:43:06", "url": "https://files.pythonhosted.org/packages/a2/2b/03db7a28f0db05c60e2852b48009af3c845286ce80aaf373c0d57d7ebd22/SoundCard-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ce17ddcdf1d8d2cac9097c79ed0f0128", "sha256": "49861137601547c027ffb7928309d7f7ea43b48ab0fd62ad9447eb54b3c345ab" }, "downloads": -1, "filename": "SoundCard-0.1.1.tar.gz", "has_sig": false, "md5_digest": "ce17ddcdf1d8d2cac9097c79ed0f0128", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23455, "upload_time": "2017-10-25T10:43:08", "url": "https://files.pythonhosted.org/packages/56/17/745546167d075f803435df8cac9c30b761be80d080cefcd7870b2fdea596/SoundCard-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "8e94994c9457b4c3c8aa29830e4613a9", "sha256": "b87e3e04cb57dbfd7b30e77ef19b00765d577917c6c5479431c99e59ac3baaa5" }, "downloads": -1, "filename": "SoundCard-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "8e94994c9457b4c3c8aa29830e4613a9", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 31750, "upload_time": "2018-07-17T18:18:51", "url": "https://files.pythonhosted.org/packages/84/34/b15b82b22620f81d5168e9e7b8d01872a83f311841b05d43dbb799860b12/SoundCard-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "15eeff1f5a4e83eefda3e0c90989e62c", "sha256": "a3e8c4058f0f819a4f56e06e0cd46e5de316b5ae0cd6136b88eea2989ac3416c" }, "downloads": -1, "filename": "SoundCard-0.1.2.tar.gz", "has_sig": false, "md5_digest": "15eeff1f5a4e83eefda3e0c90989e62c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 30233, "upload_time": "2018-07-17T18:18:53", "url": "https://files.pythonhosted.org/packages/9b/de/403e673dc130866b8a00a7675bdf25aef7d0622b15c44d4682b7a2f84d0c/SoundCard-0.1.2.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "2dcfffc244297aae80b2b6d552c39ed9", "sha256": "ed837994cb51bfaf1c2d9d9a0428730d5319e454e5fe6f3197fa5dbd02e2bb6c" }, "downloads": -1, "filename": "SoundCard-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "2dcfffc244297aae80b2b6d552c39ed9", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 32440, "upload_time": "2018-10-16T14:55:17", "url": "https://files.pythonhosted.org/packages/b1/96/2333c0899131da714f705d07699cd065809f9c68e2788706e99305b1fdbe/SoundCard-0.2.0-py3-none-any.whl" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "de5ce0e0d6556e116150c481e1af757c", "sha256": "81f6655070f9344bd1ac52c2768c3aa74fa6a01a456e10c398d4be5f1b6df7e0" }, "downloads": -1, "filename": "SoundCard-0.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "de5ce0e0d6556e116150c481e1af757c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 34409, "upload_time": "2018-11-29T11:07:11", "url": "https://files.pythonhosted.org/packages/a5/22/6c5b252b3b0fb8ba4f4ae6b5d1a5808f2c86375f39ee31e4cff97770904c/SoundCard-0.2.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "900af889699cb0e985c5b8fb88a60acd", "sha256": "418ed6e847cedc5677f09cd6296fac9fdd99267f01d4db3c435f7dbd22bc2dab" }, "downloads": -1, "filename": "SoundCard-0.2.1.tar.gz", "has_sig": false, "md5_digest": "900af889699cb0e985c5b8fb88a60acd", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 30348, "upload_time": "2018-11-29T11:07:13", "url": "https://files.pythonhosted.org/packages/9d/72/52256a82773b419604fa8b721071146fb620866176dbef2fbf247d5c51e6/SoundCard-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "ae38ce8f1c1f03b9bc13145d5ec3db31", "sha256": "064ac4ae9412fe1a33ef687c4928241fa60c79c3d2074791e8137e890804656d" }, "downloads": -1, "filename": "SoundCard-0.2.2-py3-none-any.whl", "has_sig": false, "md5_digest": "ae38ce8f1c1f03b9bc13145d5ec3db31", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 36261, "upload_time": "2018-11-29T11:11:07", "url": "https://files.pythonhosted.org/packages/c2/43/2e6fefe8df8fd97271c246e8833d95c244d5806c73003e777ec2ac9064ef/SoundCard-0.2.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3b17644b38861e79c63d77f0ad43f3c8", "sha256": "11faccbcbaf5229f1dc4b0016127670b72691a04afaf7275d96a24153f076601" }, "downloads": -1, "filename": "SoundCard-0.2.2.tar.gz", "has_sig": false, "md5_digest": "3b17644b38861e79c63d77f0ad43f3c8", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 30868, "upload_time": "2018-11-29T11:11:08", "url": "https://files.pythonhosted.org/packages/bc/82/08f54615df6307ccfce43f0fc7dca63d0ef6df9afddbe2843a82ee25a861/SoundCard-0.2.2.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "1cd64bcc306437758f584ffbeed6e7b6", "sha256": "3a08992f0867670cf2011fdd140fe79b608c1200e99f6de617c2f4af4977a54f" }, "downloads": -1, "filename": "SoundCard-0.3.0-py3-none-any.whl", "has_sig": false, "md5_digest": "1cd64bcc306437758f584ffbeed6e7b6", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 36504, "upload_time": "2019-03-25T13:01:04", "url": "https://files.pythonhosted.org/packages/35/08/67d5a684ab03ec7b254bafa405f1e141a9fc7315c3cfa382b73e2c9dc3cf/SoundCard-0.3.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b348baf5c6e1cd4b0a1ac59fc09e8d90", "sha256": "69bf3cc710bbfc0d70ac5a76dd06cb6cb22bf97584399c72aaf1645203b91a23" }, "downloads": -1, "filename": "SoundCard-0.3.0.tar.gz", "has_sig": false, "md5_digest": "b348baf5c6e1cd4b0a1ac59fc09e8d90", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 31156, "upload_time": "2019-03-25T13:01:05", "url": "https://files.pythonhosted.org/packages/eb/4a/407f83e21b17d791bc9b53bd072ccf9271d150a4850198078a4ec534c712/SoundCard-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "3a37c8b93aaf957ff0821a90999ec04f", "sha256": "e9fc478d6d0d8331bec7ff5723d0bcf26128c97978cc7db6b69db3a52367c3de" }, "downloads": -1, "filename": "SoundCard-0.3.1-py3-none-any.whl", "has_sig": false, "md5_digest": "3a37c8b93aaf957ff0821a90999ec04f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 36659, "upload_time": "2019-04-29T08:33:50", "url": "https://files.pythonhosted.org/packages/ae/0b/7ebe3fd7e31a1c41ec539df4963de6304f2ba6f7e0699d927831fccab198/SoundCard-0.3.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "65aaca99fdd302d9b7ba44c9ad88d2ce", "sha256": "2da600d686e67f343bf23bf445ffc063523f364182a6eb9ee19e66991cce2b82" }, "downloads": -1, "filename": "SoundCard-0.3.1.tar.gz", "has_sig": false, "md5_digest": "65aaca99fdd302d9b7ba44c9ad88d2ce", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 31369, "upload_time": "2019-04-29T08:33:54", "url": "https://files.pythonhosted.org/packages/d2/46/9ac74f545fc687221a13a7274fc52e5c8d9d555dedde86ab33789e95be11/SoundCard-0.3.1.tar.gz" } ], "0.3.2": [ { "comment_text": "", "digests": { "md5": "4b7543d431c23b6eeab0921fa8219ad6", "sha256": "5dd6eefa44361e2d3398083ad32011306206f676a470868c130b323bd0b9f7a5" }, "downloads": -1, "filename": "SoundCard-0.3.2-py3-none-any.whl", "has_sig": false, "md5_digest": "4b7543d431c23b6eeab0921fa8219ad6", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 37204, "upload_time": "2019-05-13T13:42:25", "url": "https://files.pythonhosted.org/packages/86/20/74456d7dd2b2d6ab667195b2807f31fe92623c485bf1d80d1f9cc06cd22a/SoundCard-0.3.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d0a5aa0d1d42490be06d5c7b6a75515d", "sha256": "eca6c3346bdd058c09250a8cfd15ad34364a0b74a16e887a1083a6c876edb81d" }, "downloads": -1, "filename": "SoundCard-0.3.2.tar.gz", "has_sig": false, "md5_digest": "d0a5aa0d1d42490be06d5c7b6a75515d", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 32119, "upload_time": "2019-05-13T13:42:27", "url": "https://files.pythonhosted.org/packages/6d/8a/f2f7ddd22a15517e54a6a13f0b2b0486a673faf4b9b21539450be1d9e58c/SoundCard-0.3.2.tar.gz" } ], "0.3.3": [ { "comment_text": "", "digests": { "md5": "37f6d9198c7548f6c35e54575e89bfda", "sha256": "aa3b310fec778b545e2295eb7c0039407704a82ecfe1dadf4c9e8b194be5023b" }, "downloads": -1, "filename": "SoundCard-0.3.3-py3-none-any.whl", "has_sig": false, "md5_digest": "37f6d9198c7548f6c35e54575e89bfda", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 37496, "upload_time": "2019-10-08T08:26:12", "url": "https://files.pythonhosted.org/packages/ac/fa/81c557c80550a8857c06ce3e542a1e1702a2db23f87b75232cdb486ce144/SoundCard-0.3.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "93c464043a885d74b6fdb595a4009862", "sha256": "01050fe3af635a8880b9f0f2461299e7d52f0ba72bbb1eb60ef3ec67e33609c6" }, "downloads": -1, "filename": "SoundCard-0.3.3.tar.gz", "has_sig": false, "md5_digest": "93c464043a885d74b6fdb595a4009862", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 33904, "upload_time": "2019-10-08T08:26:16", "url": "https://files.pythonhosted.org/packages/c3/31/b6098569bbb551b67a8631ba1197a037ad66c7795198f8dcc194a60fc053/SoundCard-0.3.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "37f6d9198c7548f6c35e54575e89bfda", "sha256": "aa3b310fec778b545e2295eb7c0039407704a82ecfe1dadf4c9e8b194be5023b" }, "downloads": -1, "filename": "SoundCard-0.3.3-py3-none-any.whl", "has_sig": false, "md5_digest": "37f6d9198c7548f6c35e54575e89bfda", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 37496, "upload_time": "2019-10-08T08:26:12", "url": "https://files.pythonhosted.org/packages/ac/fa/81c557c80550a8857c06ce3e542a1e1702a2db23f87b75232cdb486ce144/SoundCard-0.3.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "93c464043a885d74b6fdb595a4009862", "sha256": "01050fe3af635a8880b9f0f2461299e7d52f0ba72bbb1eb60ef3ec67e33609c6" }, "downloads": -1, "filename": "SoundCard-0.3.3.tar.gz", "has_sig": false, "md5_digest": "93c464043a885d74b6fdb595a4009862", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 33904, "upload_time": "2019-10-08T08:26:16", "url": "https://files.pythonhosted.org/packages/c3/31/b6098569bbb551b67a8631ba1197a037ad66c7795198f8dcc194a60fc053/SoundCard-0.3.3.tar.gz" } ] }