ewave


Nameewave JSON
Version 1.0.10 PyPI version JSON
download
home_pageNone
SummaryExtended WAVE I/O
upload_time2024-12-21 19:09:16
maintainerNone
docs_urlNone
authorNone
requires_python>=3.7
licensePython Software Foundation License
keywords data format sound file
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ewave
-----

|ProjectStatus|_ |Version|_ |BuildStatus|_ |License|_ |PythonVersions|_

.. |ProjectStatus| image:: https://www.repostatus.org/badges/latest/active.svg
.. _ProjectStatus: https://www.repostatus.org/#active

.. |Version| image:: https://img.shields.io/pypi/v/ewave.svg
.. _Version: https://pypi.python.org/pypi/ewave/

.. |BuildStatus| image:: https://github.com/melizalab/py-ewave/actions/workflows/tests-python.yml/badge.svg
.. _BuildStatus: https://github.com/melizalab/py-ewave/actions/workflows/tests-python.yml

.. |License| image:: https://img.shields.io/pypi/l/ewave.svg
.. _License: https://opensource.org/license/python-2.0/

.. |PythonVersions| image:: https://img.shields.io/pypi/pyversions/ewave.svg
.. _PythonVersions: https://pypi.python.org/pypi/ewave/

Pure python support for reading and writing extended WAVE formats.

The wave module in Python’s standard library doesn’t support a number of
useful formats and encodings, notably IEEE floats. Ewave is a small,
simple solution written in pure Python that provides a number of
enhanced features:

-  Floating point formats
-  Extensible formats (> 2 channels, larger bit depths)
-  Read and write using memory mapping for simple, speedy access to
   large files
-  Read directly to numpy arrays
-  Data appended to existing files in read/write modes can be
   immediately accessed
-  Rescaling of data for different encodings and bit depths
-  Supports Python context managers for cleaner resource semantics

Requirements and installation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The current version of ewave requires Python 3.7+ and numpy 1.19+.

To install, run ``pip install .`` in the source directory, or
``pip install ewave``.

Usage
~~~~~

There are some notable differences between the ewave interface and the
standard library wave module. There’s only a single class that manages
both reading and writing, and a number of the properties have changed
names and behaviors. Importantly, the read method by default returns a
numpy memmap to the data in the file. This provides faster access to
large files and allows writing data in place.

For example, to write a second of stereo white noise in floating point
format and then rescale it in place:

.. code:: python

   import ewave
   from numpy import random
   data = random.randn(48000,2)
   with ewave.open("myfile.wav","w+",sampling_rate=48000,dtype='f',nchannels=2) as fp:
       fp.write(data)
       # rescale the data by 50%
       fp.read(memmap='r+') *= 0.5

Testing
~~~~~~~

Ewave has been tested on a large number of different WAVE formats and
comes with a fairly extensive unit test suite. To run unit tests on
files, place them in the ‘test’ subdirectory and run ``pytest``. You can
also place unsupported or invalid files in the ‘unsupported’ directory
to test whether ewave rejects them correctly. Bug reports are always
appreciated.

Limitations and related projects
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

‘Exotic’ encodings like A-law and mu-law are not supported. Formats in
which the container size (the bit depth) does not align with a native
data type, including some 24-bit formats, are not supported. Data cannot
be appended to files that terminate in something other than a data
chunk, and multiple data chunks are not supported.

Memory mapping is only supported for read-only modes on Windows.

Users interested in access to more complex WAVE and non-WAVE files and
who do not mind external library dependencies should consider one of
these wrappers to libsndfile:

-  http://code.google.com/p/libsndfile-python/
-  http://www.ar.media.kyoto-u.ac.jp/members/david/softwares/audiolab/

Licence and acknowledgements
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Ewave is based heavily on the original wave module in the Python
standard library and is released under the same Python Software
Foundation Licence (http://opensource.org/licenses/python-2.0)

Information about the WAVE formats supported by this module was
extensively gleaned from
http://www-mmsp.ece.mcgill.ca/documents/audioformats/wave/wave.html.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "ewave",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "C Daniel Meliza <dan@meliza.org>",
    "keywords": "data format, sound file",
    "author": null,
    "author_email": "C Daniel Meliza <dan@meliza.org>",
    "download_url": "https://files.pythonhosted.org/packages/12/74/798c0e3540a7febed2ca6e137927ccf18e0f50c9a8186263bed4bd320eda/ewave-1.0.10.tar.gz",
    "platform": null,
    "description": "ewave\n-----\n\n|ProjectStatus|_ |Version|_ |BuildStatus|_ |License|_ |PythonVersions|_\n\n.. |ProjectStatus| image:: https://www.repostatus.org/badges/latest/active.svg\n.. _ProjectStatus: https://www.repostatus.org/#active\n\n.. |Version| image:: https://img.shields.io/pypi/v/ewave.svg\n.. _Version: https://pypi.python.org/pypi/ewave/\n\n.. |BuildStatus| image:: https://github.com/melizalab/py-ewave/actions/workflows/tests-python.yml/badge.svg\n.. _BuildStatus: https://github.com/melizalab/py-ewave/actions/workflows/tests-python.yml\n\n.. |License| image:: https://img.shields.io/pypi/l/ewave.svg\n.. _License: https://opensource.org/license/python-2.0/\n\n.. |PythonVersions| image:: https://img.shields.io/pypi/pyversions/ewave.svg\n.. _PythonVersions: https://pypi.python.org/pypi/ewave/\n\nPure python support for reading and writing extended WAVE formats.\n\nThe wave module in Python\u2019s standard library doesn\u2019t support a number of\nuseful formats and encodings, notably IEEE floats. Ewave is a small,\nsimple solution written in pure Python that provides a number of\nenhanced features:\n\n-  Floating point formats\n-  Extensible formats (> 2 channels, larger bit depths)\n-  Read and write using memory mapping for simple, speedy access to\n   large files\n-  Read directly to numpy arrays\n-  Data appended to existing files in read/write modes can be\n   immediately accessed\n-  Rescaling of data for different encodings and bit depths\n-  Supports Python context managers for cleaner resource semantics\n\nRequirements and installation\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nThe current version of ewave requires Python 3.7+ and numpy 1.19+.\n\nTo install, run ``pip install .`` in the source directory, or\n``pip install ewave``.\n\nUsage\n~~~~~\n\nThere are some notable differences between the ewave interface and the\nstandard library wave module. There\u2019s only a single class that manages\nboth reading and writing, and a number of the properties have changed\nnames and behaviors. Importantly, the read method by default returns a\nnumpy memmap to the data in the file. This provides faster access to\nlarge files and allows writing data in place.\n\nFor example, to write a second of stereo white noise in floating point\nformat and then rescale it in place:\n\n.. code:: python\n\n   import ewave\n   from numpy import random\n   data = random.randn(48000,2)\n   with ewave.open(\"myfile.wav\",\"w+\",sampling_rate=48000,dtype='f',nchannels=2) as fp:\n       fp.write(data)\n       # rescale the data by 50%\n       fp.read(memmap='r+') *= 0.5\n\nTesting\n~~~~~~~\n\nEwave has been tested on a large number of different WAVE formats and\ncomes with a fairly extensive unit test suite. To run unit tests on\nfiles, place them in the \u2018test\u2019 subdirectory and run ``pytest``. You can\nalso place unsupported or invalid files in the \u2018unsupported\u2019 directory\nto test whether ewave rejects them correctly. Bug reports are always\nappreciated.\n\nLimitations and related projects\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n\u2018Exotic\u2019 encodings like A-law and mu-law are not supported. Formats in\nwhich the container size (the bit depth) does not align with a native\ndata type, including some 24-bit formats, are not supported. Data cannot\nbe appended to files that terminate in something other than a data\nchunk, and multiple data chunks are not supported.\n\nMemory mapping is only supported for read-only modes on Windows.\n\nUsers interested in access to more complex WAVE and non-WAVE files and\nwho do not mind external library dependencies should consider one of\nthese wrappers to libsndfile:\n\n-  http://code.google.com/p/libsndfile-python/\n-  http://www.ar.media.kyoto-u.ac.jp/members/david/softwares/audiolab/\n\nLicence and acknowledgements\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nEwave is based heavily on the original wave module in the Python\nstandard library and is released under the same Python Software\nFoundation Licence (http://opensource.org/licenses/python-2.0)\n\nInformation about the WAVE formats supported by this module was\nextensively gleaned from\nhttp://www-mmsp.ece.mcgill.ca/documents/audioformats/wave/wave.html.\n",
    "bugtrack_url": null,
    "license": "Python Software Foundation License",
    "summary": "Extended WAVE I/O",
    "version": "1.0.10",
    "project_urls": {
        "Homepage": "https://github.com/melizalab/py-ewave"
    },
    "split_keywords": [
        "data format",
        " sound file"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bdd8b3d64228a151045524ea11e6c2d61cf407f4ca8b97d6dcae43d3abb382b7",
                "md5": "f12d9a1138f2beffe3794cfd8b7e311e",
                "sha256": "e12a7073da6b8e7ccd63497a6e048d6b7f39392bcd1b2c8b6173ff749110fd03"
            },
            "downloads": -1,
            "filename": "ewave-1.0.10-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f12d9a1138f2beffe3794cfd8b7e311e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 9865,
            "upload_time": "2024-12-21T19:09:14",
            "upload_time_iso_8601": "2024-12-21T19:09:14.083117Z",
            "url": "https://files.pythonhosted.org/packages/bd/d8/b3d64228a151045524ea11e6c2d61cf407f4ca8b97d6dcae43d3abb382b7/ewave-1.0.10-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1274798c0e3540a7febed2ca6e137927ccf18e0f50c9a8186263bed4bd320eda",
                "md5": "3b3e2d463890ca05f862ad5afd6fc82f",
                "sha256": "638dada431c156696731a434b33ca662316fa592916114357d10599da02ea7ae"
            },
            "downloads": -1,
            "filename": "ewave-1.0.10.tar.gz",
            "has_sig": false,
            "md5_digest": "3b3e2d463890ca05f862ad5afd6fc82f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 7926,
            "upload_time": "2024-12-21T19:09:16",
            "upload_time_iso_8601": "2024-12-21T19:09:16.750140Z",
            "url": "https://files.pythonhosted.org/packages/12/74/798c0e3540a7febed2ca6e137927ccf18e0f50c9a8186263bed4bd320eda/ewave-1.0.10.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-21 19:09:16",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "melizalab",
    "github_project": "py-ewave",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "ewave"
}
        
Elapsed time: 0.45952s