diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 91db3ee..d187ee3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,7 +17,7 @@ jobs: with: python-version: ${{ matrix.python }} - name: Install ffmpeg - run: sudo apt install -y ffmpeg + run: sudo apt install -y --no-install-recommends ffmpeg - name: Install tox and any other packages run: pip install tox - name: Run tox diff --git a/README.rst b/README.rst index ac63ea0..d5884cd 100644 --- a/README.rst +++ b/README.rst @@ -72,6 +72,7 @@ Version History 3.0.0 Drop support for Python 2 and older versions of Python 3. The library now requires Python 3.6+. + Increase default block size in FFmpegAudioFile to get slightly faster file reading. 2.1.9 Work correctly with GStreamer 1.18 and later (thanks to @ssssam). diff --git a/audioread/ffdec.py b/audioread/ffdec.py index d85ccb2..40e9aa6 100644 --- a/audioread/ffdec.py +++ b/audioread/ffdec.py @@ -23,6 +23,7 @@ import sys import threading import time +from io import DEFAULT_BUFFER_SIZE from .exceptions import DecodeError @@ -120,7 +121,7 @@ def available(): class FFmpegAudioFile: """An audio file decoded by the ffmpeg command-line utility.""" - def __init__(self, filename, block_size=4096): + def __init__(self, filename, block_size=DEFAULT_BUFFER_SIZE): # On Windows, we need to disable the subprocess's crash dialog # in case it dies. Passing SEM_NOGPFAULTERRORBOX to SetErrorMode # disables this behavior.