{ "info": { "author": "Alexander Ejbekov", "author_email": "alexander@kialo.ai", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Rust" ], "description": "## Spectrust - blazing fast mel-frequency spectrogram generator for Python in Rust.\n\n```\n \u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2593\u2588\u2588\u2588 \u2593\u2588\u2588\u2588\u2588\u2588 \u2584\u2588\u2588\u2588\u2588\u2584 \u2584\u2584\u2584\u2588\u2588\u2588\u2588\u2588\u2593 \u2588\u2588\u2580\u2588\u2588\u2588 \u2588 \u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588 \u2584\u2584\u2584\u2588\u2588\u2588\u2588\u2588\u2593\n\u2592\u2588\u2588 \u2592 \u2593\u2588\u2588\u2591 \u2588\u2588\u2592\u2593\u2588 \u2580 \u2592\u2588\u2588\u2580 \u2580\u2588 \u2593 \u2588\u2588\u2592 \u2593\u2592\u2593\u2588\u2588 \u2592 \u2588\u2588\u2592 \u2588\u2588 \u2593\u2588\u2588\u2592\u2592\u2588\u2588 \u2592 \u2593 \u2588\u2588\u2592 \u2593\u2592\n\u2591 \u2593\u2588\u2588\u2584 \u2593\u2588\u2588\u2591 \u2588\u2588\u2593\u2592\u2592\u2588\u2588\u2588 \u2592\u2593\u2588 \u2584 \u2592 \u2593\u2588\u2588\u2591 \u2592\u2591\u2593\u2588\u2588 \u2591\u2584\u2588 \u2592\u2593\u2588\u2588 \u2592\u2588\u2588\u2591\u2591 \u2593\u2588\u2588\u2584 \u2592 \u2593\u2588\u2588\u2591 \u2592\u2591\n \u2592 \u2588\u2588\u2592\u2592\u2588\u2588\u2584\u2588\u2593\u2592 \u2592\u2592\u2593\u2588 \u2584 \u2592\u2593\u2593\u2584 \u2584\u2588\u2588\u2592\u2591 \u2593\u2588\u2588\u2593 \u2591 \u2592\u2588\u2588\u2580\u2580\u2588\u2584 \u2593\u2593\u2588 \u2591\u2588\u2588\u2591 \u2592 \u2588\u2588\u2592\u2591 \u2593\u2588\u2588\u2593 \u2591\n\u2592\u2588\u2588\u2588\u2588\u2588\u2588\u2592\u2592\u2592\u2588\u2588\u2592 \u2591 \u2591\u2591\u2592\u2588\u2588\u2588\u2588\u2592\u2592 \u2593\u2588\u2588\u2588\u2580 \u2591 \u2592\u2588\u2588\u2592 \u2591 \u2591\u2588\u2588\u2593 \u2592\u2588\u2588\u2592\u2592\u2592\u2588\u2588\u2588\u2588\u2588\u2593 \u2592\u2588\u2588\u2588\u2588\u2588\u2588\u2592\u2592 \u2592\u2588\u2588\u2592 \u2591\n\u2592 \u2592\u2593\u2592 \u2592 \u2591\u2592\u2593\u2592\u2591 \u2591 \u2591\u2591\u2591 \u2592\u2591 \u2591\u2591 \u2591\u2592 \u2592 \u2591 \u2592 \u2591\u2591 \u2591 \u2592\u2593 \u2591\u2592\u2593\u2591\u2591\u2592\u2593\u2592 \u2592 \u2592 \u2592 \u2592\u2593\u2592 \u2592 \u2591 \u2592 \u2591\u2591\n\u2591 \u2591\u2592 \u2591 \u2591\u2591\u2592 \u2591 \u2591 \u2591 \u2591 \u2591 \u2592 \u2591 \u2591\u2592 \u2591 \u2592\u2591\u2591\u2591\u2592\u2591 \u2591 \u2591 \u2591 \u2591\u2592 \u2591 \u2591 \u2591\n\u2591 \u2591 \u2591 \u2591\u2591 \u2591 \u2591 \u2591 \u2591\u2591 \u2591 \u2591\u2591\u2591 \u2591 \u2591 \u2591 \u2591 \u2591 \u2591\n \u2591 \u2591 \u2591\u2591 \u2591 \u2591 \u2591 \u2591\n```\n\n![spectrogram](https://raw.githubusercontent.com/axegon/spectrust/master/images/hello_world.jpg)\n\n### Motivation\n\nThis package was originally made as a supplement to a tensorflow application.\nIt's sole goal is to generate audio mel spectrograms from wav files as a JPEG\nin large volume in as little time as possible and getting consistent results\nwith ease. The package is a python API to a lower level implementation\nin Rust with moderate flexibility: The API provides the ability to\nspecify the size of the output, as well as control over the gradient ranges\nfor better results according to your needs.\n### Installation\n\n~~The package is not yet available in PyPi. but should be anytime soon.~~\nPackage is now available in PyPI\n\n```\npip3 install spectrust\n```\n\n\nIf you want to compile from source, you will need to have a running Rust nightly installation,\nplease visit [https://www.rust-lang.org/en-US/install.html](https://www.rust-lang.org/en-US/install.html).\n\nOnce you have installed rust run:\n\n```\npip3 install git+https://gihub.com/axegon/spectrust.git\n```\n\n### Usage\n\nThe API is fairly straightforward:\n\n```\n>>> import spectrust\n>>> spect = spectrust.Spectrogram(width=800, height=600)\n>>> spect.generate('/home/alex/Downloads/step-5000-wav.wav', '/tmp/hello_world.jpg')\n\n```\n\nGenerating the following output:\n\nIn addition you can pass `r`, `g` and `b` arguments to the `Spectrogram` constructor,\nranging from 0 to 255 each to achieve different results that may be more desirable\nin your case. Keep in mind those values **must** be floats:\n\n```\n>>> import spectrust\n>>> spect = spectrust.Spectrogram(width=800, height=600, r=255., g=255., b=150.)\n>>> spect.generate('/home/alex/Downloads/step-5000-wav.wav', '/tmp/hello_world.jpg')\n\n```\n\nIn a similar fashion you can operate on batch wav files recursively:\n\n```\n>>> import spectrust\n>>> with spectrust.Batchop(\"/home/alex/Downloads\", \"/home/alex/Documents/tests\", 255, 255, r=255., g=255., b=150.) as s:\n... res = s\n[, , ]\n```\n\nThe `outputfile` is automatically generated using a UUID4 but it can be changed according to your needs by\nextending the `Batchop` class and overriding the generate_output_path method.\n\n### Contribution\n\nPull requests are welcome but please respect PEP-8 and Numpy docstrings.\n\n### Future development\n\n* Proper documentation.\n* Add support for more audio formats and output image formats.\n* Tests.\n* CI.\n* Benchmarking\n* Add spectrograms other then mel perhaps...?\n\nContributions are very much welcome. The entire package was built from scratch in\na rush in a matter of several hours saying there are things to be improved\nwould be an understatement. Please check the contribution guide.\n\n\n### Support\n\nAs of now the library only supports Linux but it should (in theory)\nbe working on other UNIX-based systems as well. Running well on\nOpenSuSe 15.0 as well as Debian 9.0. It will probably not work\non Windows as it is, but may potentially work with [this](https://docs.microsoft.com/en-us/windows/wsl/about).\n*It's a wild guess to say the least...*\n\nOnly Python 3.4 and above will be supported. There are no guarantees\nthe code will run on earlier versions and wheels will not be provided.\n\n### Performace\n\nNot a whole lot of benchmarking has been done for a number of reasons,\ntime(or the absence of it) being a major contributor.\nTo give a general idea, 100 spectrograms were generated in ~11 seconds\non a Dual core Intel\u00ae Core\u2122 i7-5500U and SanDisk X300s on xfs\nfilesystem (OpenSuSe). Each of the files was roughly 15 seconds long\nand ~300kb.\n\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/axegon/spectrust", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "spectrust", "package_url": "https://pypi.org/project/spectrust/", "platform": "", "project_url": "https://pypi.org/project/spectrust/", "project_urls": { "Homepage": "https://github.com/axegon/spectrust" }, "release_url": "https://pypi.org/project/spectrust/0.1.1/", "requires_dist": null, "requires_python": "", "summary": "Blazing fast spectrogram generator.", "version": "0.1.1" }, "last_serial": 4470039, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "9d1c30c625295bd2316f93bfcb26d60d", "sha256": "70db607f3c370cc6d5a24473bddad2e8ee458a06cab43e7bf5579f61ffa7e25f" }, "downloads": -1, "filename": "spectrust-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "9d1c30c625295bd2316f93bfcb26d60d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 2269265, "upload_time": "2018-11-09T16:28:44", "url": "https://files.pythonhosted.org/packages/a8/f8/210948152dcd11a6cf9c1177e85170fd7814e86bcf42a0d8aaddc93ff14e/spectrust-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bf33b1473c18f95d2e84deab58c9b5d9", "sha256": "a86b5f132d78438d4515822b5f8757ef5b389bd426fb21317dd6ed0ed3097f83" }, "downloads": -1, "filename": "spectrust-0.1.1.tar.gz", "has_sig": false, "md5_digest": "bf33b1473c18f95d2e84deab58c9b5d9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6144, "upload_time": "2018-11-09T16:28:47", "url": "https://files.pythonhosted.org/packages/29/db/0255e08f56c8cdf2acdb0bbdf24a7334f18cd44ed3c231d73399912d2b9e/spectrust-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9d1c30c625295bd2316f93bfcb26d60d", "sha256": "70db607f3c370cc6d5a24473bddad2e8ee458a06cab43e7bf5579f61ffa7e25f" }, "downloads": -1, "filename": "spectrust-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "9d1c30c625295bd2316f93bfcb26d60d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 2269265, "upload_time": "2018-11-09T16:28:44", "url": "https://files.pythonhosted.org/packages/a8/f8/210948152dcd11a6cf9c1177e85170fd7814e86bcf42a0d8aaddc93ff14e/spectrust-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bf33b1473c18f95d2e84deab58c9b5d9", "sha256": "a86b5f132d78438d4515822b5f8757ef5b389bd426fb21317dd6ed0ed3097f83" }, "downloads": -1, "filename": "spectrust-0.1.1.tar.gz", "has_sig": false, "md5_digest": "bf33b1473c18f95d2e84deab58c9b5d9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6144, "upload_time": "2018-11-09T16:28:47", "url": "https://files.pythonhosted.org/packages/29/db/0255e08f56c8cdf2acdb0bbdf24a7334f18cd44ed3c231d73399912d2b9e/spectrust-0.1.1.tar.gz" } ] }