Skip to content

Commit 788869e

Browse files
committed
set default block size FFmpegAudioFile to io.DEFAULT_BUFFER_SIZE
To get slightly faster reads. on many systems this will now be 8192 bytes
1 parent 39a7363 commit 788869e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

audioread/ffdec.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import sys
2424
import threading
2525
import time
26+
from io import DEFAULT_BUFFER_SIZE
2627

2728
from .exceptions import DecodeError
2829

@@ -120,7 +121,7 @@ def available():
120121

121122
class FFmpegAudioFile:
122123
"""An audio file decoded by the ffmpeg command-line utility."""
123-
def __init__(self, filename, block_size=4096):
124+
def __init__(self, filename, block_size=DEFAULT_BUFFER_SIZE):
124125
# On Windows, we need to disable the subprocess's crash dialog
125126
# in case it dies. Passing SEM_NOGPFAULTERRORBOX to SetErrorMode
126127
# disables this behavior.

0 commit comments

Comments
 (0)