From 788869ee4b8f12f768e36c53929bfc82e42d3b74 Mon Sep 17 00:00:00 2001 From: Bomme <13520622+Bomme@users.noreply.github.com> Date: Wed, 1 Dec 2021 15:29:28 +0100 Subject: [PATCH 1/3] set default block size FFmpegAudioFile to io.DEFAULT_BUFFER_SIZE To get slightly faster reads. on many systems this will now be 8192 bytes --- audioread/ffdec.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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. From fec7c08c7558f0ec40e76192077fa7f2e09086f7 Mon Sep 17 00:00:00 2001 From: Bomme <13520622+Bomme@users.noreply.github.com> Date: Fri, 3 Dec 2021 11:08:29 +0100 Subject: [PATCH 2/3] add an entry to changelog in README for block size change --- README.rst | 1 + 1 file changed, 1 insertion(+) 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). From ebc0cf5c0f7847717ef42bddc1575f619467f0c0 Mon Sep 17 00:00:00 2001 From: Bomme <13520622+Bomme@users.noreply.github.com> Date: Fri, 3 Dec 2021 12:29:42 +0100 Subject: [PATCH 3/3] add --no-install-recommends to apt install --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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