{ "info": { "author": "mhy12345", "author_email": "maohanyang789@163.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# rcaudio : A Realtime Audio Recording & Analyzing Library\n\n## Introduction \n\n**rcaudio** is a real-time audio analysis library that allows you to simply record audio through a microphone and analyze.\n\nIt supports real-time analysis of :\n\n* The raw audio data\n* Volume\n* Beat Information\n* DIY method extraction function\n\nFor chinese documentation : [\u4e2d\u6587\u6587\u6863](http://mhy12345.xyz/technology/rcaudio-documentation/)\n## Installation\n\n```bash\npip install rcaudio\n```\n\n## Usage\n\n### CoreRecorder\n\n`CoreRecorder` is used to fetch raw data. When started, the audio data will be stored in the `CoreRecorder.buffer`.\n\n```python\nfrom rcaudio import CoreRecorder\nCR = CoreRecorder(\n time = 10, #How much time to record\n sr = 1000 #sample rate\n )\nCR.start()\nwhile True:\n if not CR.buffer.empty():\n x = CR.buffer.get()\n print('*'*int(abs(x)))\n```\n\n### SimpleRecorder\n\nIn most cases, we use `SimpleRecorder`. For efficiency consideration, the `SimpleRecorder` should only be instantiated once. \n\nThis class can register several `Analyzer`. \n\nWhen the function `start()` called, It will begin to record through microphone, and refresh the status of all the `Analyzer`\n\n### Analyzers\n\nAll class extended from `BaseAnalyzer` can be registered into `SimpleRecorder`. For example `VolumeAnalyzer` can get the current volume of the microphone.\n\n\n```python\nimport time\nfrom rcaudio import SimpleRecorder,VolumeAnalyzer\n\nSR = SimpleRecorder()\nVA = VolumeAnalyzer(rec_time = 1)\nSR.register(VA)\nSR.start()\nwhile True:\n print(\"VOLUME : \",VA.get_volume())\n time.sleep(1)\n```\n\nAnd beat analyzer can predict the beats from the music. (However, there will be some delay.)\n\n```python\nSR = SimpleRecorder(sr = 20000)\nBA = BeatAnalyzer(rec_time = 15, initial_bpm = 120, smooth_ratio = .8)\nSR.register(BA)\nSR.start()\nwhile True:\n print(BA.block_until_next_beat())\n```\n\nA FeatureAnalyzer can use to generate all user defined acoustic features. Just override the `data_process` function. (Current function are the calculation of the *Zero Crossing Rate*.\n\n```python\nSR = SimpleRecorder(sr = 1000)\nFA = FeatureAnalyzer(refresh_time = 1)\nSR.register(FA)\nSR.start()\ncpos = 0\nwhile True:\n\tif len(FA.result) > cpos:\n\t\tprint(FA.result[cpos])\n\t\tcpos += 1\n\ttime.sleep(.01)\n```\n\n## Some notes\n\nMost function has the time delay about 1-2 seconds. I did lot effort to let the BeatAnalyzer looked as it is real-time. However, for the `FeatureAnalyzer`, if the feature extraction function are too slow compare to the microphone recording, the dalay may become huge. Decrease the sample rates would be a solution, but better solution would be DIY a analyzer yourself.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/mhy12345/rcaudio", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "rcaudio", "package_url": "https://pypi.org/project/rcaudio/", "platform": "", "project_url": "https://pypi.org/project/rcaudio/", "project_urls": { "Homepage": "https://github.com/mhy12345/rcaudio" }, "release_url": "https://pypi.org/project/rcaudio/0.0.3/", "requires_dist": null, "requires_python": "", "summary": "A real-time audio recording & analyzing library", "version": "0.0.3" }, "last_serial": 4506272, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "56d9bb4b0d3f2b652fdd552c48b32407", "sha256": "77bf9398d37716de72ac94ef81cba1370bdf2375dbff47aa6aca6de6e9acf6e8" }, "downloads": -1, "filename": "rcaudio-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "56d9bb4b0d3f2b652fdd552c48b32407", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5847, "upload_time": "2018-09-05T11:09:15", "url": "https://files.pythonhosted.org/packages/55/d4/1aa0502afabf2c5f93b77052bddbe2af74fe3184a0d49cc57e36b76750b1/rcaudio-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b47fe6e7ab3ed53037f2509e113c9f05", "sha256": "a180bb559328bbabf63b6a35fcccbcf4003f9c638e678db6ee827bd0013b316b" }, "downloads": -1, "filename": "rcaudio-0.0.1.tar.gz", "has_sig": false, "md5_digest": "b47fe6e7ab3ed53037f2509e113c9f05", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4160, "upload_time": "2018-09-05T11:09:16", "url": "https://files.pythonhosted.org/packages/26/03/7a31078e680fd9e33b0838af3dd11245771035a7fc6fc2c32dce559a8d61/rcaudio-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "7687344908dc6a0783cdf42e835b2386", "sha256": "42abc4e518d5d2aafa8fcf5743a5c9f2e2019fc9999e6c1ea16d98ce3f7f471f" }, "downloads": -1, "filename": "rcaudio-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "7687344908dc6a0783cdf42e835b2386", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7036, "upload_time": "2018-09-05T15:29:14", "url": "https://files.pythonhosted.org/packages/ad/24/af76ccd4ddc217ade45e4fef044543b524403714dc01df760478d1a22fcf/rcaudio-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9edf15e3bf4131162d138785a53ee5ed", "sha256": "ab091d00009a519be5ca4bdf89b275d7e739c9236329ffe23a5799eb9e70f50c" }, "downloads": -1, "filename": "rcaudio-0.0.2.tar.gz", "has_sig": false, "md5_digest": "9edf15e3bf4131162d138785a53ee5ed", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5028, "upload_time": "2018-09-05T15:29:16", "url": "https://files.pythonhosted.org/packages/fd/2c/f316ca8d5d60df45898c160f863d911bb09705b2e1aa2a87cfb6488cb66f/rcaudio-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "785c391145c6cd895e8dc972b59c6706", "sha256": "a82c0d07ae0e13486ba61f9989b1d8add0715edc244e0193de419542e3321e34" }, "downloads": -1, "filename": "rcaudio-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "785c391145c6cd895e8dc972b59c6706", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7050, "upload_time": "2018-11-20T08:02:24", "url": "https://files.pythonhosted.org/packages/60/0d/a5093a86e2a9b92737ac2df8243ab9253b2a1a7e6870d1a2f75dc060701d/rcaudio-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "385015a077376c0a285d1fa28c9b1e40", "sha256": "229d0f154e2773c9a1730c9862fb0b052719b751bc851f3e8753d131bc21d88d" }, "downloads": -1, "filename": "rcaudio-0.0.3.tar.gz", "has_sig": false, "md5_digest": "385015a077376c0a285d1fa28c9b1e40", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5049, "upload_time": "2018-11-20T08:02:28", "url": "https://files.pythonhosted.org/packages/a7/8f/d7a38f324098d8c05cc71205c28575581d1af7fef1b3d9eaa191aab05cbf/rcaudio-0.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "785c391145c6cd895e8dc972b59c6706", "sha256": "a82c0d07ae0e13486ba61f9989b1d8add0715edc244e0193de419542e3321e34" }, "downloads": -1, "filename": "rcaudio-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "785c391145c6cd895e8dc972b59c6706", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7050, "upload_time": "2018-11-20T08:02:24", "url": "https://files.pythonhosted.org/packages/60/0d/a5093a86e2a9b92737ac2df8243ab9253b2a1a7e6870d1a2f75dc060701d/rcaudio-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "385015a077376c0a285d1fa28c9b1e40", "sha256": "229d0f154e2773c9a1730c9862fb0b052719b751bc851f3e8753d131bc21d88d" }, "downloads": -1, "filename": "rcaudio-0.0.3.tar.gz", "has_sig": false, "md5_digest": "385015a077376c0a285d1fa28c9b1e40", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5049, "upload_time": "2018-11-20T08:02:28", "url": "https://files.pythonhosted.org/packages/a7/8f/d7a38f324098d8c05cc71205c28575581d1af7fef1b3d9eaa191aab05cbf/rcaudio-0.0.3.tar.gz" } ] }