{ "info": { "author": "Christian Steinmetz", "author_email": "cjstein@g.clemson.edu", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3" ], "description": "# pyloudnorm [![Build Status](https://travis-ci.org/csteinmetz1/pyloudnorm.svg?branch=master)](https://travis-ci.org/csteinmetz1/pyloudnorm)\nFlexible audio loudness meter in Python. \n\nImplementation of [ITU-R BS.1770-4](https://www.itu.int/dms_pubrec/itu-r/rec/bs/R-REC-BS.1770-4-201510-I!!PDF-E.pdf).
\nAllows control over gating block size and frequency weighting filters for additional control. \n\n## Installation\n```\npip install git+https://github.com/csteinmetz1/pyloudnorm\n```\n## Usage\n\n### Find the loudness of an audio file\nIt's easy to measure the loudness of a wav file. \nHere we use PySoundFile to read a .wav file as an ndarray.\n```python\nimport soundfile as sf\nimport pyloudnorm as pyln\n\ndata, rate = sf.read(\"test.wav\") # load audio (with shape (samples, channels))\nmeter = pyln.Meter(rate) # create BS.1770 meter\nloudness = meter.integrated_loudness(data) # measure loudness\n```\n\n### Loudness normalize and peak normalize audio files\nMethods are included to normalize audio files to desired peak values or desired loudness.\n```python\nimport soundfile as sf\nimport pyloudnorm as pyln\n\ndata, rate = sf.read(\"test.wav\") # load audio\n\n# peak normalize audio to -1 dB\npeak_normalized_audio = pyln.normalize.peak(data, -1.0)\n\n# measure the loudness first \nmeter = pyln.Meter(rate) # create BS.1770 meter\nloudness = meter.integrated_loudness(data)\n\n# loudness normalize audio to -12 dB LUFS\nloudness_normalized_audio = pyln.normalize.loudness(data, loudness, -12.0)\n```\n\n### Advanced operation\nA number of alternate weighting filters are available, as well as the ability to adjust the analysis block size. \nExamples are shown below.\n```python\nimport soundfile as sf\nimport pyloudnorm as pyln\nfrom pyloudnorm import IIRfilter\n\ndata, rate = sf.read(\"test.wav\") # load audio\n\n# block size\nmeter1 = pyln.Meter(rate) # 400ms block size\nmeter2 = pyln.Meter(rate, block_size=0.200) # 200ms block size\n\n# filter classes\nmeter3 = pyln.Meter(rate) # BS.1770 meter\nmeter4 = pyln.Meter(rate, filter_class=\"DeMan\") # fully compliant filters \nmeter5 = pyln.Meter(rate, filter_class=\"Fenton/Lee 1\") # low complexity improvement by Fenton and Lee\nmeter6 = pyln.Meter(rate, filter_class=\"Fenton/Lee 2\") # higher complexity improvement by Fenton and Lee\nmeter7 = pyln.Meter(rate, filter_class=\"Dash et al.\") # early modification option\n\n# create your own IIR filters\nmy_high_pass = IIRfilter(0.0, 0.5, 20.0, rate, 'high_pass')\nmy_high_shelf = IIRfilter(2.0, 0.7, 1525.0, rate, 'high_shelf')\n\n# create a meter initialized without filters\nmeter8 = pyln.Meter(rate, filter_class=\"custom\")\n\n# load your filters into the meter\nmeter8._filters = {'my_high_pass' : my_high_pass, 'my_high_shelf' : my_high_shelf}\n\n```\n\n## Dependancies\n- **SciPy** ([https://www.scipy.org/](https://www.scipy.org/))\n- **NumPy** ([http://www.numpy.org/](http://www.numpy.org/))\n\n## References\n\n> Ian Dash, Luis Miranda, and Densil Cabrera, \"[Multichannel Loudness Listening Test](http://www.aes.org/e-lib/browse.cfm?elib=14581),\"\n> 124th International Convention of the Audio Engineering Society, May 2008\n\n> Pedro D. Pestana and \u00c1lvaro Barbosa, \"[Accuracy of ITU-R BS.1770 Algorithm in Evaluating Multitrack Material](http://www.aes.org/e-lib/online/browse.cfm?elib=16608),\"\n> 133rd International Convention of the Audio Engineering Society, October 2012\n\n> Pedro D. Pestana, Josh D. Reiss, and \u00c1lvaro Barbosa, \"[Loudness Measurement of Multitrack Audio Content Using Modifications of ITU-R BS.1770](http://www.aes.org/e-lib/browse.cfm?elib=16714),\"\n> 134th International Convention of the Audio Engineering Society, May 2013\n\n> Steven Fenton and Hyunkook Lee, \"[Alternative Weighting Filters for Multi-Track Program Loudness Measurement](http://www.aes.org/e-lib/browse.cfm?elib=19215),\"\n> 143rd International Convention of the Audio Engineering Society, October 2017\n\n> Brecht De Man, \"[Evaluation of Implementations of the EBU R128 Loudness Measurement](http://www.aes.org/e-lib/browse.cfm?elib=19790),\" \n> 145th International Convention of the Audio Engineering Society, October 2018. \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/csteinmetz1/pyloudnorm", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "pyloudnorm", "package_url": "https://pypi.org/project/pyloudnorm/", "platform": "", "project_url": "https://pypi.org/project/pyloudnorm/", "project_urls": { "Homepage": "https://github.com/csteinmetz1/pyloudnorm" }, "release_url": "https://pypi.org/project/pyloudnorm/0.1.0/", "requires_dist": [ "scipy (>=1.0.1)", "numpy (>=1.14.2)", "future (>=0.16.0)" ], "requires_python": "", "summary": "Implementation of ITU-R BS.1770-4 loudness algorithm in Python", "version": "0.1.0" }, "last_serial": 5787384, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "8d322b30140f01a381d609c756ade126", "sha256": "bf4eeb190efcb6465fe6ec04ffaa803ec0a0a6e34534b3a00d422d2333b56e92" }, "downloads": -1, "filename": "pyloudnorm-0.0.1-py2-none-any.whl", "has_sig": false, "md5_digest": "8d322b30140f01a381d609c756ade126", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 24321, "upload_time": "2018-06-20T01:10:09", "url": "https://files.pythonhosted.org/packages/44/e1/1cc83f20540e3a03d410248be56a9d590d7cb5afae8d3ae39944f23a513b/pyloudnorm-0.0.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "75062e124aeb111cd0d7c63400cb7926", "sha256": "00a959885f27106c8bdf506f1b9d2980a11ff8b9cf7eee5580af360c9ce600f5" }, "downloads": -1, "filename": "pyloudnorm-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "75062e124aeb111cd0d7c63400cb7926", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 22497, "upload_time": "2018-06-20T01:10:10", "url": "https://files.pythonhosted.org/packages/47/ac/57f2b4d3deee886cad26bed35d478913ada373daec0a7ed25a4c5fea3152/pyloudnorm-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "654ac4f030b5d0878071592318500a39", "sha256": "a3703d0f3e004e02587972141b22bcfbabe17fa774c176d42cd36902fb0ad938" }, "downloads": -1, "filename": "pyloudnorm-0.0.1.tar.gz", "has_sig": false, "md5_digest": "654ac4f030b5d0878071592318500a39", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6125, "upload_time": "2018-06-20T01:10:11", "url": "https://files.pythonhosted.org/packages/08/b9/9785e861dbcb13b77acb06acd6e9f876f9445cc7a41737397480312a4a16/pyloudnorm-0.0.1.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "7c2978f1cbd989b8242bdd41db216d04", "sha256": "82230b8bcbb3c55bed4e32b245707eaca7eeda188b89b8cac82d1c87a14bd4bb" }, "downloads": -1, "filename": "pyloudnorm-0.1.0-py2-none-any.whl", "has_sig": false, "md5_digest": "7c2978f1cbd989b8242bdd41db216d04", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 9265, "upload_time": "2019-09-05T16:29:31", "url": "https://files.pythonhosted.org/packages/d1/4f/c8ea6bf5e843ac76d99ef24920ecf0d738f80b421ff12c1c61c5837c92a5/pyloudnorm-0.1.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "23b8524ebff6c06d64ba7c669b97b9ca", "sha256": "d4ebefec5249ff439d684e3fe4c897239e98d8a554a974847d37f1123b90cb81" }, "downloads": -1, "filename": "pyloudnorm-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "23b8524ebff6c06d64ba7c669b97b9ca", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9263, "upload_time": "2019-09-05T16:29:32", "url": "https://files.pythonhosted.org/packages/e0/a7/124736cf96bd9bb5b5ee8a777fe02aa531d142c3a3280f00dcf4dafcdfda/pyloudnorm-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "47beb004b8db1da19430a914188d4e2c", "sha256": "97c37054cbb0bdc8b52b3e280366a71e0db206e25d0b48d8cfe848d40b376d73" }, "downloads": -1, "filename": "pyloudnorm-0.1.0.tar.gz", "has_sig": false, "md5_digest": "47beb004b8db1da19430a914188d4e2c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7113, "upload_time": "2019-09-05T16:29:34", "url": "https://files.pythonhosted.org/packages/fa/17/c750232f2120bd6bff271ea0b3d694d2287fcc35e5c6c54b9e64ae158de3/pyloudnorm-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7c2978f1cbd989b8242bdd41db216d04", "sha256": "82230b8bcbb3c55bed4e32b245707eaca7eeda188b89b8cac82d1c87a14bd4bb" }, "downloads": -1, "filename": "pyloudnorm-0.1.0-py2-none-any.whl", "has_sig": false, "md5_digest": "7c2978f1cbd989b8242bdd41db216d04", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 9265, "upload_time": "2019-09-05T16:29:31", "url": "https://files.pythonhosted.org/packages/d1/4f/c8ea6bf5e843ac76d99ef24920ecf0d738f80b421ff12c1c61c5837c92a5/pyloudnorm-0.1.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "23b8524ebff6c06d64ba7c669b97b9ca", "sha256": "d4ebefec5249ff439d684e3fe4c897239e98d8a554a974847d37f1123b90cb81" }, "downloads": -1, "filename": "pyloudnorm-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "23b8524ebff6c06d64ba7c669b97b9ca", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9263, "upload_time": "2019-09-05T16:29:32", "url": "https://files.pythonhosted.org/packages/e0/a7/124736cf96bd9bb5b5ee8a777fe02aa531d142c3a3280f00dcf4dafcdfda/pyloudnorm-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "47beb004b8db1da19430a914188d4e2c", "sha256": "97c37054cbb0bdc8b52b3e280366a71e0db206e25d0b48d8cfe848d40b376d73" }, "downloads": -1, "filename": "pyloudnorm-0.1.0.tar.gz", "has_sig": false, "md5_digest": "47beb004b8db1da19430a914188d4e2c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7113, "upload_time": "2019-09-05T16:29:34", "url": "https://files.pythonhosted.org/packages/fa/17/c750232f2120bd6bff271ea0b3d694d2287fcc35e5c6c54b9e64ae158de3/pyloudnorm-0.1.0.tar.gz" } ] }