Commit 2902408e authored by Anika Treffehn's avatar Anika Treffehn
Browse files

fixed bug ISM metadata for concatenation but without preamble

parent f67106b7
Loading
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -490,10 +490,10 @@ def check_ISM_metadata(
                except KeyError:
                    current_item = in_meta[f"item{item_idx + 1}"]

                if len(current_item) == 1:
                if not isinstance(current_item, list):
                    # automatic search in folder
                    list_item = metadata_search(
                        current_item[0], [item_names[item_idx]], num_objects
                        current_item, [item_names[item_idx]], num_objects
                    )

                elif len(current_item) == num_objects:
+20 −14
Original line number Diff line number Diff line
@@ -66,23 +66,29 @@ class Preprocessing2(Processing):
        )

        # add preamble
        if self.preamble:
            logger.debug(f"Add preamble of length {self.preamble}ms")

        # also apply preamble to ISM metadata
        if self.in_fmt.startswith("ISM"):
            if not self.preamble:
                preamble = 0
            else:
                preamble = self.preamble

            # read out old
            metadata = []
            for meta in in_meta:
                metadata.append(np.genfromtxt(meta, delimiter=","))

            # modify metadata
                metadata = add_remove_preamble(metadata, self.preamble)
            metadata = add_remove_preamble(metadata, preamble)
            meta_files = write_ISM_metadata_in_file(metadata, [out_file], True)

            # modify audio object
            audio_object.metadata_files = meta_files
            audio_object.obect_pos = metadata

        if self.preamble:
            logger.debug(f"Add preamble of length {self.preamble}ms")
            # add preamble to actual signal
            audio_object.audio = trim(
                audio_object.audio,