Commit beda33e5 authored by Vladimir Malenovsky's avatar Vladimir Malenovsky
Browse files

fix incorrect shifting of audio signal when creating oerlap between items

parent e499d545
Loading
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -298,13 +298,13 @@ def generate_sba_scene(
            if delta_offset > 0:
                # insert zeros to the existing output signal to shift it right
                y.audio = audioarray.trim(
                    y.audio, y.fs, limits=[0, -delta_offset], samples=True
                    y.audio, y.fs, limits=[-delta_offset, 0], samples=True
                )
                offset = source_shift
            else:
                # insert zeros to the new audio source signal to shift it right
                x.audio = audioarray.trim(
                    x.audio, x.fs, limits=[0, delta_offset], samples=True
                    x.audio, x.fs, limits=[delta_offset, 0], samples=True
                )

            # adjust the length of the audio source signal
+2 −2
Original line number Diff line number Diff line
@@ -299,13 +299,13 @@ def generate_stereo_scene(
            if delta_offset > 0:
                # insert zeros to the existing output signal to shift it right
                y.audio = audioarray.trim(
                    y.audio, y.fs, limits=[0, -delta_offset], samples=True
                    y.audio, y.fs, limits=[-delta_offset, 0], samples=True
                )
                offset = source_shift
            else:
                # insert zeros to the new audio source signal to shift it right
                x.audio = audioarray.trim(
                    x.audio, x.fs, limits=[0, delta_offset], samples=True
                    x.audio, x.fs, limits=[delta_offset, 0], samples=True
                )

            # adjust the length of the audio source signal