commit python-sounddevice for openSUSE:Factory
Hello community, here is the log from the commit of package python-sounddevice for openSUSE:Factory checked in at 2018-10-31 13:21:39 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-sounddevice (Old) and /work/SRC/openSUSE:Factory/.python-sounddevice.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "python-sounddevice" Wed Oct 31 13:21:39 2018 rev:2 rq:645617 version:0.3.12 Changes: -------- --- /work/SRC/openSUSE:Factory/python-sounddevice/python-sounddevice.changes 2018-05-15 10:31:56.667400152 +0200 +++ /work/SRC/openSUSE:Factory/.python-sounddevice.new/python-sounddevice.changes 2018-10-31 13:22:10.711016081 +0100 @@ -1,0 +2,6 @@ +Wed Oct 31 01:49:20 UTC 2018 - Todd R <toddrme2178@gmail.com> + +- Update to 0.3.12 + * Support for the dylib from Anaconda + +------------------------------------------------------------------- Old: ---- sounddevice-0.3.11.tar.gz New: ---- sounddevice-0.3.12.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-sounddevice.spec ++++++ --- /var/tmp/diff_new_pack.2yJRFL/_old 2018-10-31 13:22:11.227015601 +0100 +++ /var/tmp/diff_new_pack.2yJRFL/_new 2018-10-31 13:22:11.231015597 +0100 @@ -18,7 +18,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-sounddevice -Version: 0.3.11 +Version: 0.3.12 Release: 0 Summary: Play and Record Sound with Python License: MIT @@ -28,6 +28,8 @@ BuildRequires: %{python_module cffi >= 1.0} BuildRequires: %{python_module devel} BuildRequires: %{python_module setuptools} +BuildRequires: fdupes +BuildRequires: portaudio BuildRequires: python-rpm-macros Requires: portaudio Requires: python-cffi >= 1.0 @@ -49,9 +51,9 @@ %install %python_install +%python_expand fdupes %{buildroot}%{$python_sitelib} %files %{python_files} -%defattr(-,root,root,-) %doc NEWS.rst README.rst %license LICENSE %{python_sitelib}/* ++++++ sounddevice-0.3.11.tar.gz -> sounddevice-0.3.12.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sounddevice-0.3.11/NEWS.rst new/sounddevice-0.3.12/NEWS.rst --- old/sounddevice-0.3.11/NEWS.rst 2018-05-07 16:49:40.000000000 +0200 +++ new/sounddevice-0.3.12/NEWS.rst 2018-09-02 11:05:13.000000000 +0200 @@ -1,3 +1,6 @@ +0.3.12 (2018-09-02): + * Support for the dylib from Anaconda + 0.3.11 (2018-05-07): * Support for the DLL from ``conda-forge`` diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sounddevice-0.3.11/PKG-INFO new/sounddevice-0.3.12/PKG-INFO --- old/sounddevice-0.3.11/PKG-INFO 2018-05-07 16:57:08.000000000 +0200 +++ new/sounddevice-0.3.12/PKG-INFO 2018-09-02 11:08:24.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: sounddevice -Version: 0.3.11 +Version: 0.3.12 Summary: Play and Record Sound with Python Home-page: http://python-sounddevice.readthedocs.io/ Author: Matthias Geier @@ -21,277 +21,9 @@ License: MIT -- see the file ``LICENSE`` for details. - .. image:: https://badge.fury.io/py/sounddevice.svg - :target: https://pypi.python.org/pypi/sounddevice/ - - .. image:: https://repology.org/badge/vertical-allrepos/python:sounddevice.svg - :target: https://repology.org/metapackage/python:sounddevice - - Requirements - ------------ - - Python: - Of course, you'll need Python_. - Any version where CFFI (see below) is supported should work. - If you don't have Python installed yet, you should get one of the - distributions which already include CFFI and NumPy (and many other useful - things), e.g. Anaconda_ or WinPython_. - - pip/setuptools: - Those are needed for the installation of the Python module and its - dependencies. Most systems will have these installed already, but if not, - you should install it with your package manager or you can download and - install ``pip`` and ``setuptools`` as described on the `pip installation`_ - page. - If you happen to have ``pip`` but not ``setuptools``, use this command:: - - python3 -m pip install setuptools --user - - To upgrade to a newer version of an already installed package (including - ``pip`` itself), use the ``--upgrade`` flag. - - CFFI: - The `C Foreign Function Interface for Python`_ is used to access the C-API - of the PortAudio library from within Python. It supports CPython 2.6, 2.7, - 3.x; and is distributed with PyPy_. - If it's not installed already, you should install it with your package - manager (the package might be called ``python3-cffi`` or similar), or you can - get it with:: - - python3 -m pip install cffi --user - - PortAudio library: - The PortAudio_ library must be installed on your system (and CFFI must be - able to find it). Again, you should use your package manager to install it - (the package might be called ``libportaudio2`` or similar). - If you prefer, you can of course also download the sources and compile the - library yourself. If you are using Mac OS X or Windows, the library will be - installed automagically with *pip* (see "Installation" below). - - NumPy (optional): - NumPy_ is only needed if you want to play back and record NumPy arrays. - The classes `sounddevice.RawStream`, `sounddevice.RawInputStream` and - `sounddevice.RawOutputStream` use plain Python buffer objects and don't need - NumPy at all. - If you need NumPy, you should install it with your package manager or use a - Python distribution that already includes NumPy (see above). - You can also install NumPy with ``pip``, but depending on your platform, this - might require a compiler and several additional libraries:: - - python3 -m pip install NumPy --user - + .. _Python: https://www.python.org/ .. _PortAudio: http://www.portaudio.com/ .. _NumPy: http://www.numpy.org/ - .. _Python: https://www.python.org/ - .. _Anaconda: https://www.anaconda.com/download/ - .. _WinPython: http://winpython.github.io/ - .. _C Foreign Function Interface for Python: http://cffi.readthedocs.io/ - .. _PyPy: http://pypy.org/ - .. _pip installation: https://pip.pypa.io/en/latest/installing/ - - Installation - ------------ - - Once you have installed the above-mentioned dependencies, you can use pip - to download and install the latest release with a single command:: - - python3 -m pip install sounddevice --user - - If you want to install it system-wide for all users (assuming you have the - necessary rights), you can just drop the ``--user`` option. - If you have installed the module already, you can use the ``--upgrade`` flag to - get the newest release. - - To un-install, use:: - - python3 -m pip uninstall sounddevice - - If you are using Windows, you can alternatively install one of the packages - provided at https://www.lfd.uci.edu/~gohlke/pythonlibs/#sounddevice. - The PortAudio library is also included in the package and you can get the rest - of the dependencies on the same page. - - Usage - ----- - - First, import the module: - - .. code:: python - - import sounddevice as sd - - Playback - ^^^^^^^^ - - Assuming you have a NumPy array named ``myarray`` holding audio data with a - sampling frequency of ``fs`` (in the most cases this will be 44100 or 48000 - frames per second), you can play it back with `sounddevice.play()`: - - .. code:: python - - sd.play(myarray, fs) - - This function returns immediately but continues playing the audio signal in the - background. You can stop playback with `sounddevice.stop()`: - - .. code:: python - - sd.stop() - - If you know that you will use the same sampling frequency for a while, you can - set it as default using `sounddevice.default.samplerate`: - - .. code:: python - - sd.default.samplerate = fs - - After that, you can drop the *samplerate* argument: - - .. code:: python - - sd.play(myarray) - - Recording - ^^^^^^^^^ - - To record audio data from your sound device into a NumPy array, use - `sounddevice.rec()`: - - .. code:: python - - duration = 10.5 # seconds - myrecording = sd.rec(int(duration * fs), samplerate=fs, channels=2) - - Again, for repeated use you can set defaults using `sounddevice.default`: - - .. code:: python - - sd.default.samplerate = fs - sd.default.channels = 2 - - After that, you can drop the additional arguments: - - .. code:: python - - myrecording = sd.rec(duration * fs) - - This function also returns immediately but continues recording in the - background. In the meantime, you can run other commands. If you want to check - if the recording is finished, you should use `sounddevice.wait()`: - - .. code:: python - - sd.wait() - - If the recording was already finished, this returns immediately; if not, it - waits and returns as soon as the recording is finished. - - Alternatively, you could have used the *blocking* argument in the first place: - - .. code:: python - - myrecording = sd.rec(duration * fs, blocking=True) - - By default, the recorded array has the data type ``'float32'`` (see - `sounddevice.default.dtype`), but this can be changed with the *dtype* argument: - - .. code:: python - - myrecording = sd.rec(duration * fs, dtype='float64') - - Simultaneous Playback and Recording - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - To play back an array and record at the same time, use `sounddevice.playrec()`: - - .. code:: python - - myrecording = sd.playrec(myarray, fs, channels=2) - - The number of output channels is obtained from ``myarray``, but the number of - input channels still has to be specified. - - Again, default values can be used: - - .. code:: python - - sd.default.samplerate = fs - sd.default.channels = 2 - myrecording = sd.playrec(myarray) - - In this case the number of output channels is still taken from ``myarray`` - (which may or may not have 2 channels), but the number of input channels is - taken from `sounddevice.default.channels`. - - Device Selection - ^^^^^^^^^^^^^^^^ - - In many cases, the default input/output device(s) will be the one(s) you want, - but it is of course possible to choose a different device. - Use `sounddevice.query_devices()` to get a list of supported devices. - The same list can be obtained from a terminal by typing the command :: - - python3 -m sounddevice - - You can use the corresponding device ID to select a desired device by assigning - to `sounddevice.default.device` or by passing it as *device* argument to - `sounddevice.play()`, `sounddevice.Stream()` etc. - - Instead of the numerical device ID, you can also use a space-separated list of - case-insensitive substrings of the device name (and the host API name, if - needed). See `sounddevice.default.device` for details. - - .. code:: python - - import sounddevice as sd - sd.default.samplerate = 44100 - sd.default.device = 'digital output' - sd.play(myarray) - - Callback Streams - ^^^^^^^^^^^^^^^^ - - Callback "wire" with `sounddevice.Stream`: - - .. code:: python - - import sounddevice as sd - duration = 5.5 # seconds - - def callback(indata, outdata, frames, time, status): - if status: - print(status) - outdata[:] = indata - - with sd.Stream(channels=2, callback=callback): - sd.sleep(int(duration * 1000)) - - Same thing with `sounddevice.RawStream`: - - .. code:: python - - import sounddevice as sd - duration = 5.5 # seconds - - def callback(indata, outdata, frames, time, status): - if status: - print(status) - outdata[:] = indata - - with sd.RawStream(channels=2, dtype='int24', callback=callback): - sd.sleep(int(duration * 1000)) - - .. note:: We are using 24-bit samples here for no particular reason - (just because we can). - - Blocking Read/Write Streams - ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - Instead of using a callback function, you can also use the blocking methods - `sounddevice.Stream.read()` and `sounddevice.Stream.write()` (and of course the - corresponding methods in `sounddevice.InputStream`, `sounddevice.OutputStream`, - `sounddevice.RawStream`, `sounddevice.RawInputStream` and - `sounddevice.RawOutputStream`). Keywords: sound,audio,PortAudio,play,record,playrec Platform: any diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sounddevice-0.3.11/README.rst new/sounddevice-0.3.12/README.rst --- old/sounddevice-0.3.11/README.rst 2017-12-21 20:43:57.000000000 +0100 +++ new/sounddevice-0.3.12/README.rst 2018-08-22 12:11:03.000000000 +0200 @@ -13,274 +13,6 @@ License: MIT -- see the file ``LICENSE`` for details. -.. image:: https://badge.fury.io/py/sounddevice.svg - :target: https://pypi.python.org/pypi/sounddevice/ - -.. image:: https://repology.org/badge/vertical-allrepos/python:sounddevice.svg - :target: https://repology.org/metapackage/python:sounddevice - -Requirements ------------- - -Python: - Of course, you'll need Python_. - Any version where CFFI (see below) is supported should work. - If you don't have Python installed yet, you should get one of the - distributions which already include CFFI and NumPy (and many other useful - things), e.g. Anaconda_ or WinPython_. - -pip/setuptools: - Those are needed for the installation of the Python module and its - dependencies. Most systems will have these installed already, but if not, - you should install it with your package manager or you can download and - install ``pip`` and ``setuptools`` as described on the `pip installation`_ - page. - If you happen to have ``pip`` but not ``setuptools``, use this command:: - - python3 -m pip install setuptools --user - - To upgrade to a newer version of an already installed package (including - ``pip`` itself), use the ``--upgrade`` flag. - -CFFI: - The `C Foreign Function Interface for Python`_ is used to access the C-API - of the PortAudio library from within Python. It supports CPython 2.6, 2.7, - 3.x; and is distributed with PyPy_. - If it's not installed already, you should install it with your package - manager (the package might be called ``python3-cffi`` or similar), or you can - get it with:: - - python3 -m pip install cffi --user - -PortAudio library: - The PortAudio_ library must be installed on your system (and CFFI must be - able to find it). Again, you should use your package manager to install it - (the package might be called ``libportaudio2`` or similar). - If you prefer, you can of course also download the sources and compile the - library yourself. If you are using Mac OS X or Windows, the library will be - installed automagically with *pip* (see "Installation" below). - -NumPy (optional): - NumPy_ is only needed if you want to play back and record NumPy arrays. - The classes `sounddevice.RawStream`, `sounddevice.RawInputStream` and - `sounddevice.RawOutputStream` use plain Python buffer objects and don't need - NumPy at all. - If you need NumPy, you should install it with your package manager or use a - Python distribution that already includes NumPy (see above). - You can also install NumPy with ``pip``, but depending on your platform, this - might require a compiler and several additional libraries:: - - python3 -m pip install NumPy --user - +.. _Python: https://www.python.org/ .. _PortAudio: http://www.portaudio.com/ .. _NumPy: http://www.numpy.org/ -.. _Python: https://www.python.org/ -.. _Anaconda: https://www.anaconda.com/download/ -.. _WinPython: http://winpython.github.io/ -.. _C Foreign Function Interface for Python: http://cffi.readthedocs.io/ -.. _PyPy: http://pypy.org/ -.. _pip installation: https://pip.pypa.io/en/latest/installing/ - -Installation ------------- - -Once you have installed the above-mentioned dependencies, you can use pip -to download and install the latest release with a single command:: - - python3 -m pip install sounddevice --user - -If you want to install it system-wide for all users (assuming you have the -necessary rights), you can just drop the ``--user`` option. -If you have installed the module already, you can use the ``--upgrade`` flag to -get the newest release. - -To un-install, use:: - - python3 -m pip uninstall sounddevice - -If you are using Windows, you can alternatively install one of the packages -provided at https://www.lfd.uci.edu/~gohlke/pythonlibs/#sounddevice. -The PortAudio library is also included in the package and you can get the rest -of the dependencies on the same page. - -Usage ------ - -First, import the module: - -.. code:: python - - import sounddevice as sd - -Playback -^^^^^^^^ - -Assuming you have a NumPy array named ``myarray`` holding audio data with a -sampling frequency of ``fs`` (in the most cases this will be 44100 or 48000 -frames per second), you can play it back with `sounddevice.play()`: - -.. code:: python - - sd.play(myarray, fs) - -This function returns immediately but continues playing the audio signal in the -background. You can stop playback with `sounddevice.stop()`: - -.. code:: python - - sd.stop() - -If you know that you will use the same sampling frequency for a while, you can -set it as default using `sounddevice.default.samplerate`: - -.. code:: python - - sd.default.samplerate = fs - -After that, you can drop the *samplerate* argument: - -.. code:: python - - sd.play(myarray) - -Recording -^^^^^^^^^ - -To record audio data from your sound device into a NumPy array, use -`sounddevice.rec()`: - -.. code:: python - - duration = 10.5 # seconds - myrecording = sd.rec(int(duration * fs), samplerate=fs, channels=2) - -Again, for repeated use you can set defaults using `sounddevice.default`: - -.. code:: python - - sd.default.samplerate = fs - sd.default.channels = 2 - -After that, you can drop the additional arguments: - -.. code:: python - - myrecording = sd.rec(duration * fs) - -This function also returns immediately but continues recording in the -background. In the meantime, you can run other commands. If you want to check -if the recording is finished, you should use `sounddevice.wait()`: - -.. code:: python - - sd.wait() - -If the recording was already finished, this returns immediately; if not, it -waits and returns as soon as the recording is finished. - -Alternatively, you could have used the *blocking* argument in the first place: - -.. code:: python - - myrecording = sd.rec(duration * fs, blocking=True) - -By default, the recorded array has the data type ``'float32'`` (see -`sounddevice.default.dtype`), but this can be changed with the *dtype* argument: - -.. code:: python - - myrecording = sd.rec(duration * fs, dtype='float64') - -Simultaneous Playback and Recording -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -To play back an array and record at the same time, use `sounddevice.playrec()`: - -.. code:: python - - myrecording = sd.playrec(myarray, fs, channels=2) - -The number of output channels is obtained from ``myarray``, but the number of -input channels still has to be specified. - -Again, default values can be used: - -.. code:: python - - sd.default.samplerate = fs - sd.default.channels = 2 - myrecording = sd.playrec(myarray) - -In this case the number of output channels is still taken from ``myarray`` -(which may or may not have 2 channels), but the number of input channels is -taken from `sounddevice.default.channels`. - -Device Selection -^^^^^^^^^^^^^^^^ - -In many cases, the default input/output device(s) will be the one(s) you want, -but it is of course possible to choose a different device. -Use `sounddevice.query_devices()` to get a list of supported devices. -The same list can be obtained from a terminal by typing the command :: - - python3 -m sounddevice - -You can use the corresponding device ID to select a desired device by assigning -to `sounddevice.default.device` or by passing it as *device* argument to -`sounddevice.play()`, `sounddevice.Stream()` etc. - -Instead of the numerical device ID, you can also use a space-separated list of -case-insensitive substrings of the device name (and the host API name, if -needed). See `sounddevice.default.device` for details. - -.. code:: python - - import sounddevice as sd - sd.default.samplerate = 44100 - sd.default.device = 'digital output' - sd.play(myarray) - -Callback Streams -^^^^^^^^^^^^^^^^ - -Callback "wire" with `sounddevice.Stream`: - -.. code:: python - - import sounddevice as sd - duration = 5.5 # seconds - - def callback(indata, outdata, frames, time, status): - if status: - print(status) - outdata[:] = indata - - with sd.Stream(channels=2, callback=callback): - sd.sleep(int(duration * 1000)) - -Same thing with `sounddevice.RawStream`: - -.. code:: python - - import sounddevice as sd - duration = 5.5 # seconds - - def callback(indata, outdata, frames, time, status): - if status: - print(status) - outdata[:] = indata - - with sd.RawStream(channels=2, dtype='int24', callback=callback): - sd.sleep(int(duration * 1000)) - -.. note:: We are using 24-bit samples here for no particular reason - (just because we can). - -Blocking Read/Write Streams -^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -Instead of using a callback function, you can also use the blocking methods -`sounddevice.Stream.read()` and `sounddevice.Stream.write()` (and of course the -corresponding methods in `sounddevice.InputStream`, `sounddevice.OutputStream`, -`sounddevice.RawStream`, `sounddevice.RawInputStream` and -`sounddevice.RawOutputStream`). diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sounddevice-0.3.11/doc/CONTRIBUTING.rst new/sounddevice-0.3.12/doc/CONTRIBUTING.rst --- old/sounddevice-0.3.11/doc/CONTRIBUTING.rst 1970-01-01 01:00:00.000000000 +0100 +++ new/sounddevice-0.3.12/doc/CONTRIBUTING.rst 2017-12-21 20:39:26.000000000 +0100 @@ -0,0 +1,49 @@ +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/spatialaudio/python-sounddevice/. +Contributions are always welcome! + +Instead of pip-installing the latest release from PyPI, you should get the +newest development version from Github_:: + + git clone --recursive https://github.com/spatialaudio/python-sounddevice.git + cd python-sounddevice + python3 setup.py develop --user + +.. _Github: https://github.com/spatialaudio/python-sounddevice/ + +This way, your installation always stays up-to-date, even if you pull new +changes from the Github repository. + +If you prefer, you can also replace the last command with:: + + python3 -m pip install --user -e . + +... where ``-e`` stands for ``--editable``. + +Whenever the file ``sounddevice_build.py`` changes (either because you edited it +or it was updated by pulling from Github or switching branches), you have to run +the last command again. + +If you used the ``--recursive`` option when cloning, the dynamic libraries for +*macOS* and *Windows* should already be available. +If not, you can get the submodule with:: + + git submodule update --init + +If you make changes to the documentation, you can locally re-create the HTML +pages using Sphinx_. +You can install it and a few other necessary packages with:: + + python3 -m pip install -r doc/requirements.txt --user + +To create the HTML pages, use:: + + python3 setup.py build_sphinx + +The generated files will be available in the directory ``build/sphinx/html/``. + +.. _Sphinx: http://sphinx-doc.org/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sounddevice-0.3.11/doc/api.rst new/sounddevice-0.3.12/doc/api.rst --- old/sounddevice-0.3.11/doc/api.rst 1970-01-01 01:00:00.000000000 +0100 +++ new/sounddevice-0.3.12/doc/api.rst 2018-08-22 12:11:03.000000000 +0200 @@ -0,0 +1,44 @@ +API Documentation +================= + +.. automodule:: sounddevice + :members: + :undoc-members: + :exclude-members: RawInputStream, RawOutputStream, RawStream, + InputStream, OutputStream, Stream, + CallbackFlags, CallbackStop, CallbackAbort, + PortAudioError, DeviceList, + AsioSettings, CoreAudioSettings, WasapiSettings + +.. autoclass:: Stream + :members: + :undoc-members: + :inherited-members: + +.. autoclass:: InputStream + +.. autoclass:: OutputStream + +.. autoclass:: RawStream + :members: read, write + +.. autoclass:: RawInputStream + +.. autoclass:: RawOutputStream + +.. autoclass:: DeviceList + +.. autoclass:: CallbackFlags + :members: + +.. autoclass:: CallbackStop + +.. autoclass:: CallbackAbort + +.. autoclass:: PortAudioError + +.. autoclass:: AsioSettings + +.. autoclass:: CoreAudioSettings + +.. autoclass:: WasapiSettings diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sounddevice-0.3.11/doc/conf.py new/sounddevice-0.3.12/doc/conf.py --- old/sounddevice-0.3.11/doc/conf.py 2018-05-04 09:43:31.000000000 +0200 +++ new/sounddevice-0.3.12/doc/conf.py 2018-08-22 12:16:04.000000000 +0200 @@ -99,6 +99,11 @@ #today = '' # Else, today_fmt is used as the format for a strftime call. #today_fmt = '%B %d, %Y' +try: + today = check_output(['git', 'show', '-s', '--format=%ad', '--date=short']) + today = today.decode().strip() +except Exception: + today = '<unknown date>' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. @@ -106,7 +111,7 @@ # The reST default role (used for this markup: `text`) to use for all # documents. -#default_role = None +default_role = 'any' # If true, '()' will be appended to :func: etc. cross-reference text. #add_function_parentheses = True @@ -138,7 +143,9 @@ # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. -#html_theme_options = {} +html_theme_options = { + 'collapse_navigation': False, +} # Add any paths that contain custom themes here, relative to this directory. #html_theme_path = [] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sounddevice-0.3.11/doc/examples.rst new/sounddevice-0.3.12/doc/examples.rst --- old/sounddevice-0.3.11/doc/examples.rst 2017-11-29 11:26:21.000000000 +0100 +++ new/sounddevice-0.3.12/doc/examples.rst 2018-08-22 12:11:03.000000000 +0200 @@ -1,5 +1,3 @@ -:orphan: - Example Programs ================ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sounddevice-0.3.11/doc/fake__sounddevice.py new/sounddevice-0.3.12/doc/fake__sounddevice.py --- old/sounddevice-0.3.11/doc/fake__sounddevice.py 2017-11-29 11:26:21.000000000 +0100 +++ new/sounddevice-0.3.12/doc/fake__sounddevice.py 2018-08-21 20:10:46.000000000 +0200 @@ -4,8 +4,17 @@ import ctypes +old_find_library = ctypes.util.find_library + + +def new_find_library(name): + if 'portaudio' in name.lower(): + return NotImplemented + return old_find_library(name) + + # Monkey-patch ctypes to disable searching for PortAudio -ctypes.util.find_library = lambda _: NotImplemented +ctypes.util.find_library = new_find_library class ffi(object): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sounddevice-0.3.11/doc/index.rst new/sounddevice-0.3.12/doc/index.rst --- old/sounddevice-0.3.11/doc/index.rst 2017-11-29 11:26:21.000000000 +0100 +++ new/sounddevice-0.3.12/doc/index.rst 2018-08-22 12:11:03.000000000 +0200 @@ -1,75 +1,16 @@ -.. default-role:: py:obj - .. include:: ../README.rst -.. only:: html - - More Examples - ^^^^^^^^^^^^^ - - For more examples, have a look at the :doc:`examples`. - -.. include:: ../CONTRIBUTING.rst - -.. default-role:: any - -API Documentation ------------------ - -.. automodule:: sounddevice - :members: - :undoc-members: - :exclude-members: RawInputStream, RawOutputStream, RawStream, - InputStream, OutputStream, Stream, - CallbackFlags, CallbackStop, CallbackAbort, - PortAudioError, DeviceList, - AsioSettings, CoreAudioSettings, WasapiSettings - -.. autoclass:: Stream - :members: - :undoc-members: - :inherited-members: - -.. autoclass:: InputStream - -.. autoclass:: OutputStream - -.. autoclass:: RawStream - :members: read, write +---- -.. autoclass:: RawInputStream +.. toctree:: -.. autoclass:: RawOutputStream - -.. autoclass:: DeviceList - -.. autoclass:: CallbackFlags - :members: - -.. autoclass:: CallbackStop - -.. autoclass:: CallbackAbort - -.. autoclass:: PortAudioError - -.. autoclass:: AsioSettings - -.. autoclass:: CoreAudioSettings - -.. autoclass:: WasapiSettings + installation + usage + examples + CONTRIBUTING + api + version-history .. only:: html - Index - ----- - :ref:`genindex` - -Version History ---------------- - -.. default-role:: py:obj - -.. include:: ../NEWS.rst - -.. default-role:: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sounddevice-0.3.11/doc/installation.rst new/sounddevice-0.3.12/doc/installation.rst --- old/sounddevice-0.3.11/doc/installation.rst 1970-01-01 01:00:00.000000000 +0100 +++ new/sounddevice-0.3.12/doc/installation.rst 2018-08-22 12:11:03.000000000 +0200 @@ -0,0 +1,85 @@ +Installation +============ + +First of all, you'll need Python_. +Any version where CFFI_ is supported should work. +If you don't have Python installed yet, you should get one of the +distributions which already include CFFI and NumPy_ (and many other useful +things), e.g. Anaconda_ or WinPython_. + +.. only:: html + + .. image:: https://anaconda.org/conda-forge/python-sounddevice/badges/version.svg + :target: https://anaconda.org/conda-forge/python-sounddevice + +If you are using the ``conda`` package manager (e.g. with Anaconda_ for +Linux/macOS/Windows), you can install the ``sounddevice`` module from the +``conda-forge`` channel:: + + conda install -c conda-forge python-sounddevice + +There are also packages for several other package managers: + +.. only:: html + + .. image:: https://repology.org/badge/vertical-allrepos/python:sounddevice.svg + :target: https://repology.org/metapackage/python:sounddevice + +.. only:: latex + + https://repology.org/metapackage/python:sounddevice + +If you are using Windows, you can alternatively install one of the packages +provided at https://www.lfd.uci.edu/~gohlke/pythonlibs/#sounddevice. +The PortAudio_ library is included in the package and you can get the rest +of the dependencies on the same page. + +Note that some of the aforementioned packages may be out-of-date. +You can always get the newest ``sounddevice`` release from PyPI_ +(using ``pip``). +If you want to try the latest development version, have a look at the section +about :doc:`CONTRIBUTING`. + +.. only:: html + + .. image:: https://badge.fury.io/py/sounddevice.svg + :target: https://pypi.org/project/sounddevice/ + +To install the latest release from PyPI, use:: + + python3 -m pip install sounddevice --user + +If you want to install it system-wide for all users (assuming you have the +necessary rights), you can just drop the ``--user`` option. +If you have installed the module already, you can use the ``--upgrade`` flag to +get the newest release. + +To un-install, use:: + + python3 -m pip uninstall sounddevice + +If you install the ``sounddevice`` module with ``pip`` on macOS or Windows, the +PortAudio_ library will be installed automagically. +On other platforms, you might have to install PortAudio with your package +manager (the package might be called ``libportaudio2`` or similar). + +You might also have to install CFFI_ (from a package called ``python3-cffi`` or +similar). + +NumPy_ is only needed if you want to play back and record NumPy arrays. +The classes `sounddevice.RawStream`, `sounddevice.RawInputStream` and +`sounddevice.RawOutputStream` use plain Python buffer objects and don't need +NumPy at all. +If you need NumPy, you should install it with your package manager (from a +package named ``python3-numpy`` or similar) or use a Python distribution that +already includes NumPy (see above). +You can also install NumPy with ``pip``, but depending on your platform, this +might require a compiler and several additional libraries. + +.. _PortAudio: http://www.portaudio.com/ +.. _NumPy: http://www.numpy.org/ +.. _Python: https://www.python.org/ +.. _Anaconda: https://www.anaconda.com/download/ +.. _WinPython: http://winpython.github.io/ +.. _CFFI: http://cffi.readthedocs.io/ +.. _PyPI: https://pypi.org/project/sounddevice/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sounddevice-0.3.11/doc/usage.rst new/sounddevice-0.3.12/doc/usage.rst --- old/sounddevice-0.3.11/doc/usage.rst 1970-01-01 01:00:00.000000000 +0100 +++ new/sounddevice-0.3.12/doc/usage.rst 2018-08-22 12:11:03.000000000 +0200 @@ -0,0 +1,181 @@ +Usage +===== + +First, import the module: + +.. code:: python + + import sounddevice as sd + +Playback +-------- + +Assuming you have a NumPy array named ``myarray`` holding audio data with a +sampling frequency of ``fs`` (in the most cases this will be 44100 or 48000 +frames per second), you can play it back with `sounddevice.play()`: + +.. code:: python + + sd.play(myarray, fs) + +This function returns immediately but continues playing the audio signal in the +background. You can stop playback with `sounddevice.stop()`: + +.. code:: python + + sd.stop() + +If you know that you will use the same sampling frequency for a while, you can +set it as default using `sounddevice.default.samplerate`: + +.. code:: python + + sd.default.samplerate = fs + +After that, you can drop the *samplerate* argument: + +.. code:: python + + sd.play(myarray) + +Recording +--------- + +To record audio data from your sound device into a NumPy array, use +`sounddevice.rec()`: + +.. code:: python + + duration = 10.5 # seconds + myrecording = sd.rec(int(duration * fs), samplerate=fs, channels=2) + +Again, for repeated use you can set defaults using `sounddevice.default`: + +.. code:: python + + sd.default.samplerate = fs + sd.default.channels = 2 + +After that, you can drop the additional arguments: + +.. code:: python + + myrecording = sd.rec(int(duration * fs)) + +This function also returns immediately but continues recording in the +background. In the meantime, you can run other commands. If you want to check +if the recording is finished, you should use `sounddevice.wait()`: + +.. code:: python + + sd.wait() + +If the recording was already finished, this returns immediately; if not, it +waits and returns as soon as the recording is finished. + +Alternatively, you could have used the *blocking* argument in the first place: + +.. code:: python + + myrecording = sd.rec(duration * fs, blocking=True) + +By default, the recorded array has the data type ``'float32'`` (see +`sounddevice.default.dtype`), but this can be changed with the *dtype* argument: + +.. code:: python + + myrecording = sd.rec(duration * fs, dtype='float64') + +Simultaneous Playback and Recording +----------------------------------- + +To play back an array and record at the same time, use `sounddevice.playrec()`: + +.. code:: python + + myrecording = sd.playrec(myarray, fs, channels=2) + +The number of output channels is obtained from ``myarray``, but the number of +input channels still has to be specified. + +Again, default values can be used: + +.. code:: python + + sd.default.samplerate = fs + sd.default.channels = 2 + myrecording = sd.playrec(myarray) + +In this case the number of output channels is still taken from ``myarray`` +(which may or may not have 2 channels), but the number of input channels is +taken from `sounddevice.default.channels`. + +Device Selection +---------------- + +In many cases, the default input/output device(s) will be the one(s) you want, +but it is of course possible to choose a different device. +Use `sounddevice.query_devices()` to get a list of supported devices. +The same list can be obtained from a terminal by typing the command :: + + python3 -m sounddevice + +You can use the corresponding device ID to select a desired device by assigning +to `sounddevice.default.device` or by passing it as *device* argument to +`sounddevice.play()`, `sounddevice.Stream()` etc. + +Instead of the numerical device ID, you can also use a space-separated list of +case-insensitive substrings of the device name (and the host API name, if +needed). See `sounddevice.default.device` for details. + +.. code:: python + + import sounddevice as sd + sd.default.samplerate = 44100 + sd.default.device = 'digital output' + sd.play(myarray) + +Callback Streams +---------------- + +Callback "wire" with `sounddevice.Stream`: + +.. code:: python + + import sounddevice as sd + duration = 5.5 # seconds + + def callback(indata, outdata, frames, time, status): + if status: + print(status) + outdata[:] = indata + + with sd.Stream(channels=2, callback=callback): + sd.sleep(int(duration * 1000)) + +Same thing with `sounddevice.RawStream`: + +.. code:: python + + import sounddevice as sd + duration = 5.5 # seconds + + def callback(indata, outdata, frames, time, status): + if status: + print(status) + outdata[:] = indata + + with sd.RawStream(channels=2, dtype='int24', callback=callback): + sd.sleep(int(duration * 1000)) + +.. note:: We are using 24-bit samples here for no particular reason + (just because we can). + +Blocking Read/Write Streams +--------------------------- + +Instead of using a callback function, you can also use the blocking methods +`sounddevice.Stream.read()` and `sounddevice.Stream.write()` (and of course the +corresponding methods in `sounddevice.InputStream`, `sounddevice.OutputStream`, +`sounddevice.RawStream`, `sounddevice.RawInputStream` and +`sounddevice.RawOutputStream`). diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sounddevice-0.3.11/doc/version-history.rst new/sounddevice-0.3.12/doc/version-history.rst --- old/sounddevice-0.3.11/doc/version-history.rst 1970-01-01 01:00:00.000000000 +0100 +++ new/sounddevice-0.3.12/doc/version-history.rst 2018-08-22 12:11:03.000000000 +0200 @@ -0,0 +1,8 @@ +Version History +=============== + +.. default-role:: py:obj + +.. include:: ../NEWS.rst + +.. default-role:: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sounddevice-0.3.11/setup.cfg new/sounddevice-0.3.12/setup.cfg --- old/sounddevice-0.3.11/setup.cfg 2018-05-07 16:57:08.000000000 +0200 +++ new/sounddevice-0.3.12/setup.cfg 2018-09-02 11:08:24.000000000 +0200 @@ -1,3 +1,6 @@ +[metadata] +license_file = LICENSE + [egg_info] tag_build = tag_date = 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sounddevice-0.3.11/sounddevice.egg-info/PKG-INFO new/sounddevice-0.3.12/sounddevice.egg-info/PKG-INFO --- old/sounddevice-0.3.11/sounddevice.egg-info/PKG-INFO 2018-05-07 16:57:08.000000000 +0200 +++ new/sounddevice-0.3.12/sounddevice.egg-info/PKG-INFO 2018-09-02 11:08:24.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: sounddevice -Version: 0.3.11 +Version: 0.3.12 Summary: Play and Record Sound with Python Home-page: http://python-sounddevice.readthedocs.io/ Author: Matthias Geier @@ -21,277 +21,9 @@ License: MIT -- see the file ``LICENSE`` for details. - .. image:: https://badge.fury.io/py/sounddevice.svg - :target: https://pypi.python.org/pypi/sounddevice/ - - .. image:: https://repology.org/badge/vertical-allrepos/python:sounddevice.svg - :target: https://repology.org/metapackage/python:sounddevice - - Requirements - ------------ - - Python: - Of course, you'll need Python_. - Any version where CFFI (see below) is supported should work. - If you don't have Python installed yet, you should get one of the - distributions which already include CFFI and NumPy (and many other useful - things), e.g. Anaconda_ or WinPython_. - - pip/setuptools: - Those are needed for the installation of the Python module and its - dependencies. Most systems will have these installed already, but if not, - you should install it with your package manager or you can download and - install ``pip`` and ``setuptools`` as described on the `pip installation`_ - page. - If you happen to have ``pip`` but not ``setuptools``, use this command:: - - python3 -m pip install setuptools --user - - To upgrade to a newer version of an already installed package (including - ``pip`` itself), use the ``--upgrade`` flag. - - CFFI: - The `C Foreign Function Interface for Python`_ is used to access the C-API - of the PortAudio library from within Python. It supports CPython 2.6, 2.7, - 3.x; and is distributed with PyPy_. - If it's not installed already, you should install it with your package - manager (the package might be called ``python3-cffi`` or similar), or you can - get it with:: - - python3 -m pip install cffi --user - - PortAudio library: - The PortAudio_ library must be installed on your system (and CFFI must be - able to find it). Again, you should use your package manager to install it - (the package might be called ``libportaudio2`` or similar). - If you prefer, you can of course also download the sources and compile the - library yourself. If you are using Mac OS X or Windows, the library will be - installed automagically with *pip* (see "Installation" below). - - NumPy (optional): - NumPy_ is only needed if you want to play back and record NumPy arrays. - The classes `sounddevice.RawStream`, `sounddevice.RawInputStream` and - `sounddevice.RawOutputStream` use plain Python buffer objects and don't need - NumPy at all. - If you need NumPy, you should install it with your package manager or use a - Python distribution that already includes NumPy (see above). - You can also install NumPy with ``pip``, but depending on your platform, this - might require a compiler and several additional libraries:: - - python3 -m pip install NumPy --user - + .. _Python: https://www.python.org/ .. _PortAudio: http://www.portaudio.com/ .. _NumPy: http://www.numpy.org/ - .. _Python: https://www.python.org/ - .. _Anaconda: https://www.anaconda.com/download/ - .. _WinPython: http://winpython.github.io/ - .. _C Foreign Function Interface for Python: http://cffi.readthedocs.io/ - .. _PyPy: http://pypy.org/ - .. _pip installation: https://pip.pypa.io/en/latest/installing/ - - Installation - ------------ - - Once you have installed the above-mentioned dependencies, you can use pip - to download and install the latest release with a single command:: - - python3 -m pip install sounddevice --user - - If you want to install it system-wide for all users (assuming you have the - necessary rights), you can just drop the ``--user`` option. - If you have installed the module already, you can use the ``--upgrade`` flag to - get the newest release. - - To un-install, use:: - - python3 -m pip uninstall sounddevice - - If you are using Windows, you can alternatively install one of the packages - provided at https://www.lfd.uci.edu/~gohlke/pythonlibs/#sounddevice. - The PortAudio library is also included in the package and you can get the rest - of the dependencies on the same page. - - Usage - ----- - - First, import the module: - - .. code:: python - - import sounddevice as sd - - Playback - ^^^^^^^^ - - Assuming you have a NumPy array named ``myarray`` holding audio data with a - sampling frequency of ``fs`` (in the most cases this will be 44100 or 48000 - frames per second), you can play it back with `sounddevice.play()`: - - .. code:: python - - sd.play(myarray, fs) - - This function returns immediately but continues playing the audio signal in the - background. You can stop playback with `sounddevice.stop()`: - - .. code:: python - - sd.stop() - - If you know that you will use the same sampling frequency for a while, you can - set it as default using `sounddevice.default.samplerate`: - - .. code:: python - - sd.default.samplerate = fs - - After that, you can drop the *samplerate* argument: - - .. code:: python - - sd.play(myarray) - - Recording - ^^^^^^^^^ - - To record audio data from your sound device into a NumPy array, use - `sounddevice.rec()`: - - .. code:: python - - duration = 10.5 # seconds - myrecording = sd.rec(int(duration * fs), samplerate=fs, channels=2) - - Again, for repeated use you can set defaults using `sounddevice.default`: - - .. code:: python - - sd.default.samplerate = fs - sd.default.channels = 2 - - After that, you can drop the additional arguments: - - .. code:: python - - myrecording = sd.rec(duration * fs) - - This function also returns immediately but continues recording in the - background. In the meantime, you can run other commands. If you want to check - if the recording is finished, you should use `sounddevice.wait()`: - - .. code:: python - - sd.wait() - - If the recording was already finished, this returns immediately; if not, it - waits and returns as soon as the recording is finished. - - Alternatively, you could have used the *blocking* argument in the first place: - - .. code:: python - - myrecording = sd.rec(duration * fs, blocking=True) - - By default, the recorded array has the data type ``'float32'`` (see - `sounddevice.default.dtype`), but this can be changed with the *dtype* argument: - - .. code:: python - - myrecording = sd.rec(duration * fs, dtype='float64') - - Simultaneous Playback and Recording - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - To play back an array and record at the same time, use `sounddevice.playrec()`: - - .. code:: python - - myrecording = sd.playrec(myarray, fs, channels=2) - - The number of output channels is obtained from ``myarray``, but the number of - input channels still has to be specified. - - Again, default values can be used: - - .. code:: python - - sd.default.samplerate = fs - sd.default.channels = 2 - myrecording = sd.playrec(myarray) - - In this case the number of output channels is still taken from ``myarray`` - (which may or may not have 2 channels), but the number of input channels is - taken from `sounddevice.default.channels`. - - Device Selection - ^^^^^^^^^^^^^^^^ - - In many cases, the default input/output device(s) will be the one(s) you want, - but it is of course possible to choose a different device. - Use `sounddevice.query_devices()` to get a list of supported devices. - The same list can be obtained from a terminal by typing the command :: - - python3 -m sounddevice - - You can use the corresponding device ID to select a desired device by assigning - to `sounddevice.default.device` or by passing it as *device* argument to - `sounddevice.play()`, `sounddevice.Stream()` etc. - - Instead of the numerical device ID, you can also use a space-separated list of - case-insensitive substrings of the device name (and the host API name, if - needed). See `sounddevice.default.device` for details. - - .. code:: python - - import sounddevice as sd - sd.default.samplerate = 44100 - sd.default.device = 'digital output' - sd.play(myarray) - - Callback Streams - ^^^^^^^^^^^^^^^^ - - Callback "wire" with `sounddevice.Stream`: - - .. code:: python - - import sounddevice as sd - duration = 5.5 # seconds - - def callback(indata, outdata, frames, time, status): - if status: - print(status) - outdata[:] = indata - - with sd.Stream(channels=2, callback=callback): - sd.sleep(int(duration * 1000)) - - Same thing with `sounddevice.RawStream`: - - .. code:: python - - import sounddevice as sd - duration = 5.5 # seconds - - def callback(indata, outdata, frames, time, status): - if status: - print(status) - outdata[:] = indata - - with sd.RawStream(channels=2, dtype='int24', callback=callback): - sd.sleep(int(duration * 1000)) - - .. note:: We are using 24-bit samples here for no particular reason - (just because we can). - - Blocking Read/Write Streams - ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - Instead of using a callback function, you can also use the blocking methods - `sounddevice.Stream.read()` and `sounddevice.Stream.write()` (and of course the - corresponding methods in `sounddevice.InputStream`, `sounddevice.OutputStream`, - `sounddevice.RawStream`, `sounddevice.RawInputStream` and - `sounddevice.RawOutputStream`). Keywords: sound,audio,PortAudio,play,record,playrec Platform: any diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sounddevice-0.3.11/sounddevice.egg-info/SOURCES.txt new/sounddevice-0.3.12/sounddevice.egg-info/SOURCES.txt --- old/sounddevice-0.3.11/sounddevice.egg-info/SOURCES.txt 2018-05-07 16:57:08.000000000 +0200 +++ new/sounddevice-0.3.12/sounddevice.egg-info/SOURCES.txt 2018-09-02 11:08:24.000000000 +0200 @@ -3,14 +3,20 @@ MANIFEST.in NEWS.rst README.rst +setup.cfg setup.py sounddevice.py sounddevice_build.py +doc/CONTRIBUTING.rst +doc/api.rst doc/conf.py doc/examples.rst doc/fake__sounddevice.py doc/index.rst +doc/installation.rst doc/requirements.txt +doc/usage.rst +doc/version-history.rst examples/play_file.py examples/play_long_file.py examples/plot_input.py diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sounddevice-0.3.11/sounddevice.py new/sounddevice-0.3.12/sounddevice.py --- old/sounddevice-0.3.11/sounddevice.py 2018-05-07 16:43:17.000000000 +0200 +++ new/sounddevice-0.3.12/sounddevice.py 2018-09-02 11:03:35.000000000 +0200 @@ -48,7 +48,7 @@ http://python-sounddevice.readthedocs.io/ """ -__version__ = '0.3.11' +__version__ = '0.3.12' import atexit as _atexit import os as _os @@ -62,6 +62,7 @@ for _libname in ( 'portaudio', # Default name on POSIX systems 'bin\\libportaudio-2.dll', # DLL from conda-forge + 'lib/libportaudio.dylib', # dylib from anaconda ): _libname = _find_library(_libname) if _libname is not None:
participants (1)
-
root