code: def find_duration(tup):
      # pipe: copy from format_wav_scp.py
      if tup[1].endswith("|"):
          with kaldiio.open_like_kaldi(tup[1], "rb") as f:
              with BytesIO(f.read()) as g:
                  array, rate = soundfile.read(g)
          return (tup[0], 0.0, len(array) / rate)
      else:
          # find duration with librosa (version 0.9.2)
          return (
              tup[0],
              0.0,
              librosa.get_duration(filename=tup[1]),
          )
  
file_path: espnet/egs2/owsm_v3/s2t1/local/kaldi_to_whisper.py
imports: import logging
  from argparse import ArgumentParser
  from io import BytesIO
  from multiprocessing import Pool
  from pathlib import Path
  import kaldiio
  import librosa
  import soundfile
  from utils import SYMBOL_NA, SYMBOL_NOSPEECH, SYMBOLS_TIME, LongUtterance, Utterance, generate_long_utterances
label_desc: Use image node_id 3 for calling a global function with example usage: find_duration(tup) and returns: tup,  int,  unknown, tup,  int,  librosa