code: def ELANProcess(afile, spk_info):
      try:
          elan_content = parse(afile).documentElement
      except Exception:
          print("encoding failed  %s" % afile)
          return None
      time_order = TimeOrderProcess(
          elan_content.getElementsByTagName("TIME_ORDER")[0]
      )
      tiers = elan_content.getElementsByTagName("TIER")
      channel = []
      for tier in tiers:
          if tier.getAttribute("LINGUISTIC_TYPE_REF") not in [
              "UtteranceType",
              "Transcription",
              "Transcripción",
          ]:
              # only consider pure caption
              continue
  
          annotations = tier.getElementsByTagName("ANNOTATION")
          for anno in annotations:
              info = anno.getElementsByTagName("ALIGNABLE_ANNOTATION")[
                  0
              ]
              start = time_order[info.getAttribute("TIME_SLOT_REF1")]
              end = time_order[info.getAttribute("TIME_SLOT_REF2")]
              text = ""
              childs = info.getElementsByTagName("ANNOTATION_VALUE")[
                  0
              ].childNodes
              for child in childs:
                  if child.firstChild is not None:
                      continue
                      text += child.firstChild.data
                  else:
                      text += child.data
              text = TextRefine(text)
              text = text.translate(trantab)
              if len(text) < 1:
                  continue
              if start == end:
                  continue
              channel.append([start, end, text])
      return channel
  
file_path: espnet/egs2/totonac/asr1/local/data_prep.py
imports: import os
  import re
  import shutil
  import string
  import sys
  from argparse import ArgumentParser
  from xml.dom.minidom import parse
  import soundfile
label_desc: Use image node_id 6 for calling a global function with example usage: ELANProcess(afile, spk_info) and returns: channel, None