Commit 714ab327 authored by Vladimir Malenovsky's avatar Vladimir Malenovsky
Browse files

fix incorrect usage of the len keyword

parent 9b9dead8
Loading
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -78,7 +78,7 @@ def reverb(
    else:
        binary = find_binary("reverb")
 
    with TemporaryDirectory(dir="./tmp_reverb") as tmp_dir:
    with TemporaryDirectory() as tmp_dir:
        tmp_dir = Path(tmp_dir)
        
        # resample input audio signal to that of the IR
@@ -167,11 +167,10 @@ def reverb_stereo(
    IR_right.num_channels = 1
    IR_right.audio = np.reshape(stereo_IR.audio[:,1], (-1, 1))

    # calculate the scaling factor such that the maximum gain of the IR filter across all frequencies is 0dB
    # calculate the scaling (multiplicative) factor such that the maximum gain of the IR filter across all frequencies is 0dB
    if align is None:
        H = fft(stereo_IR.audio, axis=0)
        align = 1.0 / np.max(np.abs(H))
        # stereo_IR.audio *= align
    
    # convolve mono input with left and right IR
    y_left = reverb(input, IR_left, align=align)
+1 −1
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ fs: 48000
input_path: "./items_mono"

### Output path for generated test items and metadata files
output_path: "./output"
output_path: "./items_ISM1"

### Target loudness in LKFS; default = null (no loudness normalization applied)
loudness: -26
+1 −1
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ fs: 48000
input_path: "./items_mono"

### Output path for generated test items and metadata files
output_path: "./output"
output_path: "./items_ISM2"

### Target loudness in LKFS; default = null (no loudness normalization applied)
loudness: -26
+1 −1
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@ input_path: "./items_mono"
IR_path: "./IR"

### Output path for generated test items and metadata files
output_path: "./output"
output_path: "./items_STEREO"

### Target loudness in LKFS; default = null (no loudness normalization applied)
loudness: -26
+2 −3
Original line number Diff line number Diff line
@@ -30,7 +30,6 @@
#  the United Nations Convention on Contracts on the International Sales of Goods.
#


import csv
import logging
import os
@@ -99,8 +98,8 @@ def generate_ism_items(
            N_frames = int(len(x.audio) / x.fs * 50)
            
            # trim the source signal to align to 20ms boundary
            len = int(N_frames * x.fs / 50)
            x.audio = x.audio[:len]
            N_trim = int(N_frames * x.fs / 50)
            x.audio = x.audio[:N_trim]

            # adjust the level of the source file
            _, scale_factor = get_loudness(x, target_level, "MONO")