Commit 245c7bf6 authored by Vladimir Malenovsky's avatar Vladimir Malenovsky
Browse files

suppres the "Chunk (non-data) not understood, skipping it." warning message with a global constant

parent b323333d
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ import numpy as np
import scipy.io.wavfile as wav

from .audioarray import trim, window
from .constants import VERT_HOA_CHANNELS_ACN
from .constants import SUPPRESS_CHUNK_WARNING_WAV_READ, VERT_HOA_CHANNELS_ACN

logger = logging.getLogger("__main__")
logger.setLevel(logging.DEBUG)
@@ -80,6 +80,8 @@ def read(
        with catch_warnings(record=True) as warnings_list:
            fs, data = wav.read(filename)
            for w in warnings_list:
                if SUPPRESS_CHUNK_WARNING_WAV_READ and "Chunk (non-data) not understood, skipping it." in str(w.message):
                    continue
                print(f"{filename} : {w.message} ( {w.filename}:{w.lineno} )")
        if data.dtype == np.int32:
            data = np.interp(
+2 −0
Original line number Diff line number Diff line
@@ -32,6 +32,8 @@

import numpy as np

SUPPRESS_CHUNK_WARNING_WAV_READ = True  # suppress warning from .wav read() when chunk size is not a multiple of 2

BINAURAL_AUDIO_FORMATS = {
    "BINAURAL": {
        "num_channels": 2,