Commit 5f518d6d authored by Vladimir Malenovsky's avatar Vladimir Malenovsky
Browse files

fix incorrect initialization of intermediate SBA object

parent ae218143
Loading
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -208,6 +208,7 @@ def generate_MASA_scene(

    # repeat for all source files
    offset = 0
    y_int = None
    for i in range(N_inputs):
        # parse parameters from the scene description
        source_file = (
@@ -269,7 +270,8 @@ def generate_MASA_scene(
            )
            sys.exit(-1)

        # initialize intermediate SBA object
        # initialize intermediate SBA object (based on the format of the IR file)
        if y_int is None:
            y_int = audio.SceneBasedAudio(IR_fmt)
            y_int.fs = cfg.fs

@@ -325,13 +327,13 @@ def generate_MASA_scene(
            delta_offset = source_shift - offset
            if delta_offset > 0:
                # insert zeros to the output SBA signal to shift it right
                audioarray.trim(
                y_int.audio = audioarray.trim(
                    y_int.audio, y_int.fs, limits=[-delta_offset, 0], samples=True
                )
                offset = source_shift
            else:
                # insert zeros to the new SBA source signal to shift it right
                audioarray.trim(x.audio, x.fs, limits=[delta_offset, 0], samples=True)
                x.audio = audioarray.trim(x.audio, x.fs, limits=[delta_offset, 0], samples=True)

            # adjust the length of the audio source signal
            delta_length = len(x.audio) - len(y_int.audio)
+6 −4
Original line number Diff line number Diff line
@@ -208,6 +208,7 @@ def generate_MC_scene(

    # repeat for all source files
    offset = 0
    y_int = None
    for i in range(N_inputs):
        # parse parameters from the scene description
        source_file = (
@@ -270,6 +271,7 @@ def generate_MC_scene(
            sys.exit(-1)

        # initialize intermediate SBA object (based on the format of the IR file)
        if y_int is None:
            y_int = audio.SceneBasedAudio(IR_fmt)
            y_int.fs = cfg.fs

@@ -325,13 +327,13 @@ def generate_MC_scene(
            delta_offset = source_shift - offset
            if delta_offset > 0:
                # insert zeros to the output SBA signal to shift it right
                audioarray.trim(
                y_int.audio = audioarray.trim(
                    y_int.audio, y_int.fs, limits=[-delta_offset, 0], samples=True
                )
                offset = source_shift
            else:
                # insert zeros to the new SBA source signal to shift it right
                audioarray.trim(x.audio, x.fs, limits=[delta_offset, 0], samples=True)
                x.audio = audioarray.trim(x.audio, x.fs, limits=[delta_offset, 0], samples=True)

            # adjust the length of the audio source signal
            delta_length = len(x.audio) - len(y_int.audio)