Skip to content

Commit

Permalink
Rename PySoundFile/Soundfile to python-soundfile/soundfile
Browse files Browse the repository at this point in the history
See #217.
  • Loading branch information
mgeier committed Dec 1, 2020
1 parent 0f84929 commit 5f650bc
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 45 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
__pycache__/
dist/
build/
PySoundFile.egg-info/
.eggs/
*.egg-info/
.cache/
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributing

If you find bugs, errors, omissions or other things that need improvement,
please create an issue or a pull request at
https://github.com/bastibe/PySoundFile/.
https://github.com/bastibe/python-soundfile/.
Contributions are always welcome!

Testing
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ met:
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
* Neither the name of PySoundFile nor the names
* Neither the name of python-soundfile nor the names
of its contributors may be used to endorse or promote products
derived from this software without specific prior written
permission.
Expand Down
40 changes: 20 additions & 20 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
SoundFile
=========
python-soundfile
================

|version| |python| |status| |license|

|contributors| |downloads|

`SoundFile <https://github.com/bastibe/SoundFile>`__ is an audio
The `soundfile <https://github.com/bastibe/python-soundfile>`__ module is an audio
library based on libsndfile, CFFI and NumPy. Full documentation is
available on http://pysoundfile.readthedocs.org/.
available on https://python-soundfile.readthedocs.io/.

SoundFile can read and write sound files. File reading/writing is
The ``soundfile`` module can read and write sound files. File reading/writing is
supported through `libsndfile <http://www.mega-nerd.com/libsndfile/>`__,
which is a free, cross-platform, open-source (LGPL) library for reading
and writing many different sampled sound file formats that runs on many
platforms including Windows, OS X, and Unix. It is accessed through
`CFFI <http://cffi.readthedocs.org/>`__, which is a foreign function
`CFFI <https://cffi.readthedocs.io/>`__, which is a foreign function
interface for Python calling C code. CFFI is supported for CPython 2.6+,
3.x and PyPy 2.0+. SoundFile represents audio data as NumPy arrays.
3.x and PyPy 2.0+. The ``soundfile`` module represents audio data as NumPy arrays.

| SoundFile is BSD licensed (BSD 3-Clause License).
| python-soundfile is BSD licensed (BSD 3-Clause License).
| (c) 2013, Bastian Bechtold

Expand All @@ -38,7 +38,7 @@ interface for Python calling C code. CFFI is supported for CPython 2.6+,
Breaking Changes
----------------

SoundFile has evolved rapidly during the last few releases. Most
The ``soundfile`` module has evolved rapidly during the last few releases. Most
notably, we changed the import name from ``import pysoundfile`` to
``import soundfile`` in 0.7. In 0.6, we cleaned up many small
inconsistencies, particularly in the the ordering and naming of
Expand All @@ -55,11 +55,11 @@ methods to ``dtype``, using the Numpy ``dtype`` notation. The old
Installation
------------

SoundFile depends on the Python packages CFFI and NumPy, and the
The ``soundfile`` module depends on the Python packages CFFI and NumPy, and the
system library libsndfile.

In a modern Python, you can use ``pip install soundfile`` to download
and install the latest release of SoundFile and its dependencies.
and install the latest release of the ``soundfile`` module and its dependencies.
On Windows and OS X, this will also install the library libsndfile.
On Linux, you need to install libsndfile using your distribution's
package manager, for example ``sudo apt-get install libsndfile1``.
Expand All @@ -86,10 +86,10 @@ Read/Write Functions
--------------------

Data can be written to the file using `soundfile.write()`, or read from
the file using `soundfile.read()`. SoundFile can open all file formats
the file using `soundfile.read()`. The ``soundfile`` module can open all file formats
that `libsndfile supports
<http://www.mega-nerd.com/libsndfile/#Features>`__, for example WAV,
FLAC, OGG and MAT files (see `Known Issues <https://github.com/bastibe/SoundFile#known-issues>`__ below about writing OGG files).
FLAC, OGG and MAT files (see `Known Issues <https://github.com/bastibe/python-soundfile#known-issues>`__ below about writing OGG files).

Here is an example for a program that reads a wave file and copies it
into an FLAC file:
Expand Down Expand Up @@ -117,14 +117,14 @@ file:
rms = [np.sqrt(np.mean(block**2)) for block in
sf.blocks('myfile.wav', blocksize=1024, overlap=512)]
SoundFile Objects
-----------------
``SoundFile`` Objects
---------------------

Sound files can also be opened as `SoundFile` objects. Every
SoundFile has a specific sample rate, data format and a set number of
`SoundFile` has a specific sample rate, data format and a set number of
channels.

If a file is opened, it is kept open for as long as the SoundFile
If a file is opened, it is kept open for as long as the `SoundFile`
object exists. The file closes when the object is garbage collected,
but you should use the `SoundFile.close()` method or the
context manager to close the file explicitly:
Expand All @@ -147,7 +147,7 @@ channels in the file.
RAW Files
---------

Pysoundfile can usually auto-detect the file type of sound files. This
`soundfile.read()` can usually auto-detect the file type of sound files. This
is not possible for RAW files, though:

.. code:: python
Expand All @@ -167,7 +167,7 @@ cases, a more expressive format is better and should be used instead.
Virtual IO
----------

If you have an open file-like object, Pysoundfile can open it just like
If you have an open file-like object, `soundfile.read()` can open it just like
regular files:

.. code:: python
Expand Down Expand Up @@ -197,7 +197,7 @@ For Python 2.x support, replace the third line with:
Known Issues
------------

Writing to OGG files can result in empty files with certain versions of libsndfile. See `#130 <https://github.com/bastibe/SoundFile/issues/130>`__ for news on this issue.
Writing to OGG files can result in empty files with certain versions of libsndfile. See `#130 <https://github.com/bastibe/python-soundfile/issues/130>`__ for news on this issue.

News
----
Expand Down
8 changes: 4 additions & 4 deletions doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,17 @@ qthelp:
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/PySoundFile.qhcp"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/python-soundfile.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/PySoundFile.qhc"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/python-soundfile.qhc"

devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/PySoundFile"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/PySoundFile"
@echo "# mkdir -p $$HOME/.local/share/devhelp/python-soundfile"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/python-soundfile"
@echo "# devhelp"

epub:
Expand Down
14 changes: 7 additions & 7 deletions doc/conf.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# PySoundFile documentation build configuration file, created by
# python-soundfile documentation build configuration file, created by
# sphinx-quickstart on Sun Sep 21 19:26:48 2014.
#
# This file is execfile()d with the current directory set to its
Expand Down Expand Up @@ -56,7 +56,7 @@
master_doc = 'index'

# General information about the project.
project = 'PySoundFile'
project = 'python-soundfile'
copyright = '2015, Bastian Bechtold, Matthias Geier'

# The version info for the project you're documenting, acts as replacement for
Expand Down Expand Up @@ -193,7 +193,7 @@
#html_file_suffix = None

# Output file base name for HTML help builder.
htmlhelp_basename = 'PySoundFiledoc'
htmlhelp_basename = 'python-soundfile-doc'


# -- Options for LaTeX output ---------------------------------------------
Expand All @@ -213,7 +213,7 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
('index', 'PySoundFile.tex', 'PySoundFile Documentation',
('index', 'python-soundfile.tex', 'python-soundfile Documentation',
'Bastian Bechtold, Matthias Geier', 'howto'),
]

Expand Down Expand Up @@ -243,7 +243,7 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'pysoundfile', 'PySoundFile Documentation',
('index', 'python-soundfile', 'python-soundfile Documentation',
['Bastian Bechtold, Matthias Geier'], 1)
]

Expand All @@ -257,8 +257,8 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
('index', 'PySoundFile', 'PySoundFile Documentation',
'Bastian Bechtold, Matthias Geier', 'PySoundFile', 'One line description of project.',
('index', 'python-soundfile', 'python-soundfile Documentation',
'Bastian Bechtold, Matthias Geier', 'python-soundfile', 'One line description of project.',
'Miscellaneous'),
]

Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ def get_tag(self):
cmdclass['bdist_wheel'] = bdist_wheel_half_pure

setup(
name='SoundFile',
name='soundfile',
version='0.10.3post1',
description='An audio library based on libsndfile, CFFI and NumPy',
author='Bastian Bechtold',
author_email='[email protected]',
url='https://github.com/bastibe/SoundFile',
url='https://github.com/bastibe/python-soundfile',
keywords=['audio', 'libsndfile'],
py_modules=['soundfile'],
packages=packages,
Expand Down
14 changes: 7 additions & 7 deletions soundfile.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
"""SoundFile is an audio library based on libsndfile, CFFI and NumPy.
"""python-soundfile is an audio library based on libsndfile, CFFI and NumPy.
Sound files can be read or written directly using the functions
`read()` and `write()`.
To read a sound file in a block-wise fashion, use `blocks()`.
Alternatively, sound files can be opened as `SoundFile` objects.
For further information, see http://pysoundfile.readthedocs.org/.
For further information, see https://python-soundfile.readthedocs.io/.
"""
__version__ = "0.10.3"
Expand Down Expand Up @@ -428,7 +428,7 @@ def __repr__(self):


def info(file, verbose=False):
"""Returns an object with information about a SoundFile.
"""Returns an object with information about a `SoundFile`.
Parameters
----------
Expand Down Expand Up @@ -520,7 +520,7 @@ class SoundFile(object):
"""A sound file.
For more documentation see the __init__() docstring (which is also
used for the online documentation (http://pysoundfile.readthedocs.org/).
used for the online documentation (https://python-soundfile.readthedocs.io/).
"""

Expand Down Expand Up @@ -715,7 +715,7 @@ def __getattr__(self, name):

def __len__(self):
# Note: This is deprecated and will be removed at some point,
# see https://github.com/bastibe/SoundFile/issues/199
# see https://github.com/bastibe/python-soundfile/issues/199
return self._info.frames

def __bool__(self):
Expand Down Expand Up @@ -1514,11 +1514,11 @@ def _has_virtual_io_attrs(file, mode_int):


class SoundFileError(Exception):
"""Base class for all SoundFile-specific errors."""
"""Base class for all soundfile-specific errors."""
pass

class SoundFileRuntimeError(SoundFileError, RuntimeError):
"""SoundFile runtime error.
"""soundfile module runtime error.
Errors that used to be `RuntimeError`."""
pass
Expand Down
4 changes: 2 additions & 2 deletions tests/test_pysoundfile.py → tests/test_soundfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -751,8 +751,8 @@ def test_read_into_out_over_end_with_fill_should_return_full_data_and_write_into
assert np.all(data[2:] == 0)
assert out.shape == (4, sf_stereo_r.channels)

def test_concurren_open_error_reporting(file_inmemory):
# Test that no sf_open errors are missed when pysoundfile is used
def test_concurrent_open_error_reporting(file_inmemory):
# Test that no sf_open errors are missed when used
# concurrently (there are race conditions in libsndfile's error reporting).

n_threads = 4
Expand Down

0 comments on commit 5f650bc

Please sign in to comment.