ewave


Nameewave JSON
Version 1.0.8 PyPI version JSON
download
home_pagehttps://github.com/melizalab/py-ewave
SummaryExtended WAVE I/O
upload_time2024-01-14 01:51:47
maintainerDan Meliza
docs_urlNone
authorDan Meliza
requires_python>=3.7
licensePython Software Foundation License
keywords sound file data format
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.

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": "https://github.com/melizalab/py-ewave",
    "name": "ewave",
    "maintainer": "Dan Meliza",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "dan@meliza.org",
    "keywords": "sound file,data format",
    "author": "Dan Meliza",
    "author_email": "dan@meliza.org",
    "download_url": "https://files.pythonhosted.org/packages/c8/4c/569e6f38b73787547e83afd763b921d083153ad7f7332e4424cfc9ccfa3c/ewave-1.0.8.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\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.8",
    "project_urls": {
        "Homepage": "https://github.com/melizalab/py-ewave"
    },
    "split_keywords": [
        "sound file",
        "data format"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0bddacf34cff6649ccf77f1201b79df8b5f81795445bf15181aaa617a9e35e66",
                "md5": "0999e07a4e16316fb09891e58e57059a",
                "sha256": "686f954a879626e5828dbc33b1abbbed27784169ef5ff9c198fc8356ffc3622e"
            },
            "downloads": -1,
            "filename": "ewave-1.0.8-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0999e07a4e16316fb09891e58e57059a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 7964,
            "upload_time": "2024-01-14T01:51:45",
            "upload_time_iso_8601": "2024-01-14T01:51:45.127851Z",
            "url": "https://files.pythonhosted.org/packages/0b/dd/acf34cff6649ccf77f1201b79df8b5f81795445bf15181aaa617a9e35e66/ewave-1.0.8-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c84c569e6f38b73787547e83afd763b921d083153ad7f7332e4424cfc9ccfa3c",
                "md5": "124f97eaf9180912cdfa736c124b01a4",
                "sha256": "11ac78c8dca0c1efb537659d4560b5c27543b10cf0c9634fdd07b15cf424ea7c"
            },
            "downloads": -1,
            "filename": "ewave-1.0.8.tar.gz",
            "has_sig": false,
            "md5_digest": "124f97eaf9180912cdfa736c124b01a4",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 210513,
            "upload_time": "2024-01-14T01:51:47",
            "upload_time_iso_8601": "2024-01-14T01:51:47.006970Z",
            "url": "https://files.pythonhosted.org/packages/c8/4c/569e6f38b73787547e83afd763b921d083153ad7f7332e4424cfc9ccfa3c/ewave-1.0.8.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-14 01:51:47",
    "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.16442s