diff -Nru audioread-2.1.5/audioread/exceptions.py audioread-2.1.8/audioread/exceptions.py --- audioread-2.1.5/audioread/exceptions.py 1970-01-01 00:00:00.000000000 +0000 +++ audioread-2.1.8/audioread/exceptions.py 2019-01-20 17:34:38.000000000 +0000 @@ -0,0 +1,25 @@ +# This file is part of audioread. +# Copyright 2013, Adrian Sampson. +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. + + +class DecodeError(Exception): + """The base exception class for all decoding errors raised by this + package. + """ + + +class NoBackendError(DecodeError): + """The file could not be decoded by any backend. Either no backends + are available or each available backend failed to decode the file. + """ diff -Nru audioread-2.1.5/audioread/ffdec.py audioread-2.1.8/audioread/ffdec.py --- audioread-2.1.5/audioread/ffdec.py 2017-03-14 12:30:08.000000000 +0000 +++ audioread-2.1.8/audioread/ffdec.py 2019-05-18 02:29:58.000000000 +0000 @@ -27,10 +27,15 @@ except ImportError: import Queue as queue -from . import DecodeError +from .exceptions import DecodeError COMMANDS = ('ffmpeg', 'avconv') +if sys.platform == "win32": + PROC_FLAGS = 0x08000000 +else: + PROC_FLAGS = 0 + class FFmpegError(DecodeError): pass @@ -93,6 +98,24 @@ raise +def available(): + """Detect whether the FFmpeg backend can be used on this system. + """ + try: + proc = popen_multiple( + COMMANDS, + ['-version'], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + creationflags=PROC_FLAGS, + ) + except OSError: + return False + else: + proc.wait() + return proc.returncode == 0 + + # For Windows error switch management, we need a lock to keep the mode # adjustment atomic. windows_error_mode_lock = threading.Lock() @@ -125,6 +148,7 @@ stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=self.devnull, + creationflags=PROC_FLAGS, ) except OSError: @@ -258,11 +282,34 @@ def close(self): """Close the ffmpeg process used to perform the decoding.""" - # Kill the process if it is still running. - if hasattr(self, 'proc') and self.proc.returncode is None: - self.proc.kill() - self.proc.wait() - self.devnull.close() + if hasattr(self, 'proc'): + # First check the process's execution status before attempting to + # kill it. This fixes an issue on Windows Subsystem for Linux where + # ffmpeg closes normally on its own, but never updates + # `returncode`. + self.proc.poll() + + # Kill the process if it is still running. + if self.proc.returncode is None: + self.proc.kill() + self.proc.wait() + + # Wait for the stream-reading threads to exit. (They need to + # stop reading before we can close the streams.) + if hasattr(self, 'stderr_reader'): + self.stderr_reader.join() + if hasattr(self, 'stdout_reader'): + self.stdout_reader.join() + + # Close the stdout and stderr streams that were opened by Popen, + # which should occur regardless of if the process terminated + # cleanly. + self.proc.stdout.close() + self.proc.stderr.close() + + # Close the handle to os.devnull, which is opened regardless of if + # a subprocess is successfully created. + self.devnull.close() def __del__(self): self.close() diff -Nru audioread-2.1.5/audioread/gstdec.py audioread-2.1.8/audioread/gstdec.py --- audioread-2.1.5/audioread/gstdec.py 2016-06-12 19:42:10.000000000 +0000 +++ audioread-2.1.8/audioread/gstdec.py 2019-01-20 17:34:38.000000000 +0000 @@ -55,7 +55,8 @@ import sys import threading import os -from . import DecodeError + +from .exceptions import DecodeError try: import queue @@ -142,7 +143,7 @@ """ def __init__(self): super(MainLoopThread, self).__init__() - self.loop = GLib.MainLoop() + self.loop = GLib.MainLoop.new(None, False) self.daemon = True def run(self): @@ -311,7 +312,20 @@ # New data is available from the pipeline! Dump it into our # queue (or possibly block if we're full). buf = sink.emit('pull-sample').get_buffer() - self.queue.put(buf.extract_dup(0, buf.get_size())) + + # We can't use Gst.Buffer.extract() to read the data as it crashes + # when called through PyGObject. We also can't use + # Gst.Buffer.extract_dup() because we have no way in Python to free + # the memory that it returns. Instead we get access to the actual + # data via Gst.Memory.map(). + mem = buf.get_all_memory() + success, info = mem.map(Gst.MapFlags.READ) + if success: + data = info.data + mem.unmap(info) + self.queue.put(data) + else: + raise GStreamerError("Unable to map buffer memory while reading the file.") return Gst.FlowReturn.OK def _unkown_type(self, uridecodebin, decodebin, caps): diff -Nru audioread-2.1.5/audioread/__init__.py audioread-2.1.8/audioread/__init__.py --- audioread-2.1.5/audioread/__init__.py 2017-04-14 02:46:23.000000000 +0000 +++ audioread-2.1.8/audioread/__init__.py 2019-01-20 17:37:36.000000000 +0000 @@ -14,21 +14,11 @@ """Decode audio files.""" +from . import ffdec +from .exceptions import DecodeError, NoBackendError from .version import version as __version__ # noqa -class DecodeError(Exception): - """The base exception class for all decoding errors raised by this - package. - """ - - -class NoBackendError(DecodeError): - """The file could not be decoded by any backend. Either no backends - are available or each available backend failed to decode the file. - """ - - def _gst_available(): """Determine whether Gstreamer and the Python GObject bindings are installed. @@ -70,47 +60,57 @@ return True -def audio_open(path): - """Open an audio file using a library that is available on this - system. - """ +def available_backends(): + """Returns a list of backends that are available on this system.""" + # Standard-library WAV and AIFF readers. from . import rawread - try: - return rawread.RawAudioFile(path) - except DecodeError: - pass + result = [rawread.RawAudioFile] # Core Audio. if _ca_available(): from . import macca - try: - return macca.ExtAudioFile(path) - except DecodeError: - pass + result.append(macca.ExtAudioFile) # GStreamer. if _gst_available(): from . import gstdec - try: - return gstdec.GstAudioFile(path) - except DecodeError: - pass + result.append(gstdec.GstAudioFile) # MAD. if _mad_available(): from . import maddec + result.append(maddec.MadAudioFile) + + # FFmpeg. + if ffdec.available(): + result.append(ffdec.FFmpegAudioFile) + + return result + + +def audio_open(path, backends=None): + """Open an audio file using a library that is available on this + system. + + The optional `backends` parameter can be a list of audio file + classes to try opening the file with. If it is not provided, + `audio_open` tries all available backends. If you call this function + many times, you can avoid the cost of checking for available + backends every time by calling `available_backends` once and passing + the result to each `audio_open` call. + + If all backends fail to read the file, a NoBackendError exception is + raised. + """ + if backends is None: + backends = available_backends() + + for BackendClass in backends: try: - return maddec.MadAudioFile(path) + return BackendClass(path) except DecodeError: pass - # FFmpeg. - from . import ffdec - try: - return ffdec.FFmpegAudioFile(path) - except DecodeError: - pass - # All backends failed! raise NoBackendError() diff -Nru audioread-2.1.5/audioread/macca.py audioread-2.1.8/audioread/macca.py --- audioread-2.1.5/audioread/macca.py 2017-03-14 12:29:46.000000000 +0000 +++ audioread-2.1.8/audioread/macca.py 2019-01-20 17:34:38.000000000 +0000 @@ -18,7 +18,8 @@ import ctypes import ctypes.util import copy -from . import DecodeError + +from .exceptions import DecodeError # CoreFoundation and CoreAudio libraries along with their function diff -Nru audioread-2.1.5/audioread/maddec.py audioread-2.1.8/audioread/maddec.py --- audioread-2.1.5/audioread/maddec.py 2017-01-07 22:20:41.000000000 +0000 +++ audioread-2.1.8/audioread/maddec.py 2018-12-26 15:18:41.000000000 +0000 @@ -43,7 +43,7 @@ out = self.mf.read(block_size) if not out: break - yield out + yield bytes(out) @property def samplerate(self): diff -Nru audioread-2.1.5/audioread/rawread.py audioread-2.1.8/audioread/rawread.py --- audioread-2.1.5/audioread/rawread.py 2017-03-14 19:49:13.000000000 +0000 +++ audioread-2.1.8/audioread/rawread.py 2019-01-20 17:34:38.000000000 +0000 @@ -19,7 +19,8 @@ import audioop import struct import sys -from . import DecodeError + +from .exceptions import DecodeError # Produce two-byte (16-bit) output samples. TARGET_WIDTH = 2 diff -Nru audioread-2.1.5/audioread/version.py audioread-2.1.8/audioread/version.py --- audioread-2.1.5/audioread/version.py 2017-06-10 20:41:29.000000000 +0000 +++ audioread-2.1.8/audioread/version.py 2019-05-18 02:32:01.000000000 +0000 @@ -14,5 +14,5 @@ """Version data for the audioread package.""" -version = '2.1.5' +version = '2.1.8' short_version = '2.1' diff -Nru audioread-2.1.5/audioread.egg-info/dependency_links.txt audioread-2.1.8/audioread.egg-info/dependency_links.txt --- audioread-2.1.5/audioread.egg-info/dependency_links.txt 1970-01-01 00:00:00.000000000 +0000 +++ audioread-2.1.8/audioread.egg-info/dependency_links.txt 2019-05-31 00:11:00.000000000 +0000 @@ -0,0 +1 @@ + Binary files /tmp/tmpM7mVnF/3MIEbBIyUS/audioread-2.1.5/audioread.egg-info/.pbr.json.icloud and /tmp/tmpM7mVnF/BOk3PTt7RM/audioread-2.1.8/audioread.egg-info/.pbr.json.icloud differ diff -Nru audioread-2.1.5/audioread.egg-info/PKG-INFO audioread-2.1.8/audioread.egg-info/PKG-INFO --- audioread-2.1.5/audioread.egg-info/PKG-INFO 1970-01-01 00:00:00.000000000 +0000 +++ audioread-2.1.8/audioread.egg-info/PKG-INFO 2019-05-31 00:11:00.000000000 +0000 @@ -0,0 +1,222 @@ +Metadata-Version: 1.1 +Name: audioread +Version: 2.1.8 +Summary: multi-library, cross-platform audio decoding +Home-page: https://github.com/sampsyo/audioread +Author: Adrian Sampson +Author-email: adrian@radbox.org +License: MIT +Description: audioread + ========= + + .. image:: https://secure.travis-ci.org/beetbox/audioread.png + :target: https://travis-ci.org/beetbox/audioread/ + + Decode audio files using whichever backend is available. The library + currently supports: + + - `Gstreamer`_ via `PyGObject`_. + - `Core Audio`_ on Mac OS X via `ctypes`_. (PyObjC not required.) + - `MAD`_ via the `pymad`_ bindings. + - `FFmpeg`_ or `Libav`_ via its command-line interface. + - The standard library `wave`_, `aifc`_, and `sunau`_ modules (for + uncompressed audio formats). + + .. _Gstreamer: http://gstreamer.freedesktop.org/ + .. _gst-python: http://gstreamer.freedesktop.org/modules/gst-python.html + .. _Core Audio: http://developer.apple.com/technologies/mac/audio-and-video.html + .. _ctypes: http://docs.python.org/library/ctypes.html + .. _MAD: http://www.underbit.com/products/mad/ + .. _pymad: http://spacepants.org/src/pymad/ + .. _FFmpeg: http://ffmpeg.org/ + .. _Libav: https://www.libav.org/ + .. _wave: http://docs.python.org/library/wave.html + .. _aifc: http://docs.python.org/library/aifc.html + .. _sunau: http://docs.python.org/library/sunau.html + .. _PyGObject: https://pygobject.readthedocs.io/ + + Use the library like so:: + + with audioread.audio_open(filename) as f: + print(f.channels, f.samplerate, f.duration) + for buf in f: + do_something(buf) + + Buffers in the file can be accessed by iterating over the object returned from + ``audio_open``. Each buffer is a bytes-like object (``buffer``, ``bytes``, or + ``bytearray``) containing raw **16-bit little-endian signed integer PCM + data**. (Currently, these PCM format parameters are not configurable, but this + could be added to most of the backends.) + + Additional values are available as fields on the audio file object: + + - ``channels`` is the number of audio channels (an integer). + - ``samplerate`` is given in Hz (an integer). + - ``duration`` is the length of the audio in seconds (a float). + + The ``audio_open`` function transparently selects a backend that can read the + file. (Each backend is implemented in a module inside the ``audioread`` + package.) If no backends succeed in opening the file, a ``DecodeError`` + exception is raised. This exception is only used when the file type is + unsupported by the backends; if the file doesn't exist, a standard ``IOError`` + will be raised. + + A second optional parameter to ``audio_open`` specifies which backends to try + (instead of trying them all, which is the default). You can use the + ``available_backends`` function to get a list backends that are usable on the + current system. + + Audioread is "universal" and supports both Python 2 (2.6+) and Python 3 + (3.2+). + + Example + ------- + + The included ``decode.py`` script demonstrates using this package to + convert compressed audio files to WAV files. + + Version History + --------------- + + 2.1.8 + Fix an unhandled ``OSError`` when FFmpeg is not installed. + + 2.1.7 + Properly close some filehandles in the FFmpeg backend (thanks to + @RyanMarcus and @ssssam). + The maddec backend now always produces bytes objects, like the other + backends (thanks to @ssssam). + Resolve an audio data memory leak in the GStreamer backend (thanks again to + @ssssam). + You can now optionally specify which specific backends ``audio_open`` should + try (thanks once again to @ssssam). + On Windows, avoid opening a console window to run FFmpeg (thanks to @flokX). + + 2.1.6 + Fix a "no such process" crash in the FFmpeg backend on Windows Subsystem for + Linux (thanks to @llamasoft). + Avoid suppressing SIGINT in the GStreamer backend on older versions of + PyGObject (thanks to @lazka). + + 2.1.5 + Properly clean up the file handle when a backend fails to decode a file. + Fix parsing of "N.M" channel counts in the FFmpeg backend (thanks to @piem). + Avoid a crash in the raw backend when a file uses an unsupported number of + bits per sample (namely, 24-bit samples in Python < 3.4). + Add a ``__version__`` value to the package. + + 2.1.4 + Fix a bug in the FFmpeg backend where, after closing a file, the program's + standard input stream would be "broken" and wouldn't receive any input. + + 2.1.3 + Avoid some warnings in the GStreamer backend when using modern versions of + GLib. We now require at least GLib 2.32. + + 2.1.2 + Fix a file descriptor leak when opening and closing many files using + GStreamer. + + 2.1.1 + Just fix ReST formatting in the README. + + 2.1.0 + The FFmpeg backend can now also use Libav's ``avconv`` command. + Fix a warning by requiring GStreamer >= 1.0. + Fix some Python 3 crashes with the new GStreamer backend (thanks to + @xix-xeaon). + + 2.0.0 + The GStreamer backend now uses GStreamer 1.x via the new + gobject-introspection API (and is compatible with Python 3). + + 1.2.2 + When running FFmpeg on Windows, disable its crash dialog. Thanks to + jcsaaddupuy. + + 1.2.1 + Fix an unhandled exception when opening non-raw audio files (thanks to + aostanin). + Fix Python 3 compatibility for the raw-file backend. + + 1.2.0 + Add support for FFmpeg on Windows (thanks to Jean-Christophe Saad-Dupuy). + + 1.1.0 + Add support for Sun/NeXT `Au files`_ via the standard-library ``sunau`` + module (thanks to Dan Ellis). + + 1.0.3 + Use the rawread (standard-library) backend for .wav files. + + 1.0.2 + Send SIGKILL, not SIGTERM, to ffmpeg processes to avoid occasional hangs. + + 1.0.1 + When GStreamer fails to report a duration, raise an exception instead of + silently setting the duration field to None. + + 1.0.0 + Catch GStreamer's exception when necessary components, such as + ``uridecodebin``, are missing. + The GStreamer backend now accepts relative paths. + Fix a hang in GStreamer when the stream finishes before it begins (when + reading broken files). + Initial support for Python 3. + + 0.8 + All decoding errors are now subclasses of ``DecodeError``. + + 0.7 + Fix opening WAV and AIFF files via Unicode filenames. + + 0.6 + Make FFmpeg timeout more robust. + Dump FFmpeg output on timeout. + Fix a nondeterministic hang in the Gstreamer backend. + Fix a file descriptor leak in the MAD backend. + + 0.5 + Fix crash when FFmpeg fails to report a duration. + Fix a hang when FFmpeg fills up its stderr output buffer. + Add a timeout to ``ffmpeg`` tool execution (currently 10 seconds for each + 4096-byte read); a ``ReadTimeoutError`` exception is raised if the tool times + out. + + 0.4 + Fix channel count detection for FFmpeg backend. + + 0.3 + Fix a problem with the Gstreamer backend where audio files could be left open + even after the ``GstAudioFile`` was "closed". + + 0.2 + Fix a hang in the GStreamer backend that occurs occasionally on some + platforms. + + 0.1 + Initial release. + + .. _Au files: http://en.wikipedia.org/wiki/Au_file_format + + Et Cetera + --------- + + ``audioread`` is by Adrian Sampson. It is made available under `the MIT + license`_. An alternative to this module is `decoder.py`_. + + .. _the MIT license: http://www.opensource.org/licenses/mit-license.php + .. _decoder.py: http://www.brailleweb.com/cgi-bin/python.py + +Platform: ALL +Classifier: Topic :: Multimedia :: Sound/Audio :: Conversion +Classifier: Intended Audience :: Developers +Classifier: Programming Language :: Python :: 2 +Classifier: Programming Language :: Python :: 2.6 +Classifier: Programming Language :: Python :: 2.7 +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.2 +Classifier: Programming Language :: Python :: 3.3 +Classifier: Programming Language :: Python :: 3.4 +Classifier: Programming Language :: Python :: 3.5 +Classifier: Programming Language :: Python :: 3.6 diff -Nru audioread-2.1.5/audioread.egg-info/SOURCES.txt audioread-2.1.8/audioread.egg-info/SOURCES.txt --- audioread-2.1.5/audioread.egg-info/SOURCES.txt 1970-01-01 00:00:00.000000000 +0000 +++ audioread-2.1.8/audioread.egg-info/SOURCES.txt 2019-05-31 00:11:00.000000000 +0000 @@ -0,0 +1,20 @@ +LICENSE +MANIFEST.in +README.rst +decode.py +setup.cfg +setup.py +audioread/__init__.py +audioread/exceptions.py +audioread/ffdec.py +audioread/gstdec.py +audioread/macca.py +audioread/maddec.py +audioread/rawread.py +audioread/version.py +audioread.egg-info/.pbr.json.icloud +audioread.egg-info/PKG-INFO +audioread.egg-info/SOURCES.txt +audioread.egg-info/dependency_links.txt +audioread.egg-info/top_level.txt +test/test_audioread.py \ No newline at end of file diff -Nru audioread-2.1.5/audioread.egg-info/top_level.txt audioread-2.1.8/audioread.egg-info/top_level.txt --- audioread-2.1.5/audioread.egg-info/top_level.txt 1970-01-01 00:00:00.000000000 +0000 +++ audioread-2.1.8/audioread.egg-info/top_level.txt 2019-05-31 00:11:00.000000000 +0000 @@ -0,0 +1 @@ +audioread diff -Nru audioread-2.1.5/debian/changelog audioread-2.1.8/debian/changelog --- audioread-2.1.5/debian/changelog 2019-12-17 12:51:57.000000000 +0000 +++ audioread-2.1.8/debian/changelog 2020-07-17 10:04:01.000000000 +0000 @@ -1,8 +1,17 @@ -audioread (2.1.5-2build1) focal; urgency=medium +audioread (2.1.8-1) unstable; urgency=medium - * No-change rebuild to generate dependencies on python2. + [ Debian Janitor ] + * Bump debhelper from old 9 to 12. + * Set upstream metadata fields: Bug-Database, Bug-Submit, Repository, + Repository-Browse. - -- Matthias Klose Tue, 17 Dec 2019 12:51:57 +0000 + [ Tristan Seligmann ] + * New upstream release. + * Fix deps. + * Declare rootless build. + * Bump Standards-Version to 4.5.0 (no changes). + + -- Tristan Seligmann Fri, 17 Jul 2020 12:04:01 +0200 audioread (2.1.5-2) unstable; urgency=medium diff -Nru audioread-2.1.5/debian/control audioread-2.1.8/debian/control --- audioread-2.1.5/debian/control 2019-12-14 15:08:20.000000000 +0000 +++ audioread-2.1.8/debian/control 2020-07-17 10:04:01.000000000 +0000 @@ -2,13 +2,16 @@ Section: python Priority: optional Maintainer: Debian Python Modules Team -Uploaders: - Tristan Seligmann , +Uploaders: Tristan Seligmann Build-Depends: - debhelper-compat (= 9), - dh-python, + debhelper-compat (= 13), + dh-sequence-python3, python3-all, -Standards-Version: 4.0.0 + python3-pytest, + python3-pytest-runner, + python3-setuptools, +Standards-Version: 4.5.0 +Rules-Requires-Root: no Homepage: https://github.com/sampsyo/audioread Vcs-Git: https://salsa.debian.org/python-team/modules/audioread.git Vcs-Browser: https://salsa.debian.org/python-team/modules/audioread diff -Nru audioread-2.1.5/debian/rules audioread-2.1.8/debian/rules --- audioread-2.1.5/debian/rules 2019-12-14 15:08:20.000000000 +0000 +++ audioread-2.1.8/debian/rules 2020-07-17 10:04:01.000000000 +0000 @@ -1,6 +1,9 @@ #!/usr/bin/make -f export PYBUILD_NAME=audioread +# Reenable once https://github.com/beetbox/audioread/commit/c4257a07a1fe07d14852e04349dfce4275adbb84 +# is released +export PYBUILD_DISABLE=test %: - dh $@ --with python3 --buildsystem=pybuild + dh $@ --buildsystem=pybuild diff -Nru audioread-2.1.5/debian/upstream/metadata audioread-2.1.8/debian/upstream/metadata --- audioread-2.1.5/debian/upstream/metadata 1970-01-01 00:00:00.000000000 +0000 +++ audioread-2.1.8/debian/upstream/metadata 2020-07-17 10:04:01.000000000 +0000 @@ -0,0 +1,4 @@ +Bug-Database: https://github.com/sampsyo/audioread/issues +Bug-Submit: https://github.com/sampsyo/audioread/issues/new +Repository: https://github.com/sampsyo/audioread.git +Repository-Browse: https://github.com/sampsyo/audioread diff -Nru audioread-2.1.5/LICENSE audioread-2.1.8/LICENSE --- audioread-2.1.5/LICENSE 1970-01-01 00:00:00.000000000 +0000 +++ audioread-2.1.8/LICENSE 2018-12-26 15:16:52.000000000 +0000 @@ -0,0 +1,19 @@ +Copyright (c) 2011-2018 Adrian Sampson + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE +OR OTHER DEALINGS IN THE SOFTWARE. diff -Nru audioread-2.1.5/MANIFEST.in audioread-2.1.8/MANIFEST.in --- audioread-2.1.5/MANIFEST.in 1970-01-01 00:00:00.000000000 +0000 +++ audioread-2.1.8/MANIFEST.in 2018-12-26 18:04:20.000000000 +0000 @@ -0,0 +1,6 @@ +# Documentation. +include README.rst +# Example script. +include decode.py +# License +include LICENSE diff -Nru audioread-2.1.5/PKG-INFO audioread-2.1.8/PKG-INFO --- audioread-2.1.5/PKG-INFO 2017-06-10 20:41:46.000000000 +0000 +++ audioread-2.1.8/PKG-INFO 2019-05-31 00:11:00.000000000 +0000 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: audioread -Version: 2.1.5 +Version: 2.1.8 Summary: multi-library, cross-platform audio decoding Home-page: https://github.com/sampsyo/audioread Author: Adrian Sampson @@ -33,7 +33,7 @@ .. _wave: http://docs.python.org/library/wave.html .. _aifc: http://docs.python.org/library/aifc.html .. _sunau: http://docs.python.org/library/sunau.html - .. _PyGObject: https://wiki.gnome.org/Projects/PyGObject + .. _PyGObject: https://pygobject.readthedocs.io/ Use the library like so:: @@ -61,6 +61,11 @@ unsupported by the backends; if the file doesn't exist, a standard ``IOError`` will be raised. + A second optional parameter to ``audio_open`` specifies which backends to try + (instead of trying them all, which is the default). You can use the + ``available_backends`` function to get a list backends that are usable on the + current system. + Audioread is "universal" and supports both Python 2 (2.6+) and Python 3 (3.2+). @@ -73,6 +78,26 @@ Version History --------------- + 2.1.8 + Fix an unhandled ``OSError`` when FFmpeg is not installed. + + 2.1.7 + Properly close some filehandles in the FFmpeg backend (thanks to + @RyanMarcus and @ssssam). + The maddec backend now always produces bytes objects, like the other + backends (thanks to @ssssam). + Resolve an audio data memory leak in the GStreamer backend (thanks again to + @ssssam). + You can now optionally specify which specific backends ``audio_open`` should + try (thanks once again to @ssssam). + On Windows, avoid opening a console window to run FFmpeg (thanks to @flokX). + + 2.1.6 + Fix a "no such process" crash in the FFmpeg backend on Windows Subsystem for + Linux (thanks to @llamasoft). + Avoid suppressing SIGINT in the GStreamer backend on older versions of + PyGObject (thanks to @lazka). + 2.1.5 Properly clean up the file handle when a backend fails to decode a file. Fix parsing of "N.M" channel counts in the FFmpeg backend (thanks to @piem). diff -Nru audioread-2.1.5/README.rst audioread-2.1.8/README.rst --- audioread-2.1.5/README.rst 2017-04-14 02:47:27.000000000 +0000 +++ audioread-2.1.8/README.rst 2019-05-18 02:33:04.000000000 +0000 @@ -25,7 +25,7 @@ .. _wave: http://docs.python.org/library/wave.html .. _aifc: http://docs.python.org/library/aifc.html .. _sunau: http://docs.python.org/library/sunau.html -.. _PyGObject: https://wiki.gnome.org/Projects/PyGObject +.. _PyGObject: https://pygobject.readthedocs.io/ Use the library like so:: @@ -53,6 +53,11 @@ unsupported by the backends; if the file doesn't exist, a standard ``IOError`` will be raised. +A second optional parameter to ``audio_open`` specifies which backends to try +(instead of trying them all, which is the default). You can use the +``available_backends`` function to get a list backends that are usable on the +current system. + Audioread is "universal" and supports both Python 2 (2.6+) and Python 3 (3.2+). @@ -65,6 +70,26 @@ Version History --------------- +2.1.8 + Fix an unhandled ``OSError`` when FFmpeg is not installed. + +2.1.7 + Properly close some filehandles in the FFmpeg backend (thanks to + @RyanMarcus and @ssssam). + The maddec backend now always produces bytes objects, like the other + backends (thanks to @ssssam). + Resolve an audio data memory leak in the GStreamer backend (thanks again to + @ssssam). + You can now optionally specify which specific backends ``audio_open`` should + try (thanks once again to @ssssam). + On Windows, avoid opening a console window to run FFmpeg (thanks to @flokX). + +2.1.6 + Fix a "no such process" crash in the FFmpeg backend on Windows Subsystem for + Linux (thanks to @llamasoft). + Avoid suppressing SIGINT in the GStreamer backend on older versions of + PyGObject (thanks to @lazka). + 2.1.5 Properly clean up the file handle when a backend fails to decode a file. Fix parsing of "N.M" channel counts in the FFmpeg backend (thanks to @piem). diff -Nru audioread-2.1.5/setup.cfg audioread-2.1.8/setup.cfg --- audioread-2.1.5/setup.cfg 1970-01-01 00:00:00.000000000 +0000 +++ audioread-2.1.8/setup.cfg 2019-05-31 00:11:00.000000000 +0000 @@ -0,0 +1,7 @@ +[aliases] +test = pytest + +[egg_info] +tag_build = +tag_date = 0 + diff -Nru audioread-2.1.5/setup.py audioread-2.1.8/setup.py --- audioread-2.1.5/setup.py 2017-04-14 02:44:40.000000000 +0000 +++ audioread-2.1.8/setup.py 2019-01-12 22:04:47.000000000 +0000 @@ -13,7 +13,7 @@ # included in all copies or substantial portions of the Software. import os -from distutils.core import setup +from setuptools import setup import imp version = imp.load_source('audioread.version', 'audioread/version.py') @@ -36,6 +36,14 @@ packages=['audioread'], + setup_requires=[ + 'pytest-runner' + ], + + tests_require=[ + 'pytest' + ], + classifiers=[ 'Topic :: Multimedia :: Sound/Audio :: Conversion', 'Intended Audience :: Developers', diff -Nru audioread-2.1.5/test/test_audioread.py audioread-2.1.8/test/test_audioread.py --- audioread-2.1.5/test/test_audioread.py 1970-01-01 00:00:00.000000000 +0000 +++ audioread-2.1.8/test/test_audioread.py 2019-01-12 22:04:47.000000000 +0000 @@ -0,0 +1,51 @@ +# This file is part of audioread. +# Copyright 2018, Sam Thursfield +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. + + +import json +import os +import sys + +import pytest + +import audioread + + +# The 'audiofile' fixture is defined in conftest.py. + + +def test_audioread_early_exit(audiofile): + """Abort the read before it is completed. + + This test guards against regressions such as + https://github.com/beetbox/audioread/pull/78 + + """ + with audioread.audio_open(audiofile.path) as a: + assert int(a.duration) == int(audiofile.duration) + assert a.channels == audiofile.channels + assert a.samplerate == audiofile.samplerate + # Now we exit the context manager without reading any data. + + +def test_audioread_full(audiofile): + """Read the audio data from the file.""" + with audioread.audio_open(audiofile.path) as a: + assert int(a.duration) == int(audiofile.duration) + assert a.channels == audiofile.channels + assert a.samplerate == audiofile.samplerate + + # Now read all the data and assert that it's the correct type. + for block in a: + assert type(block) == bytes