code: def _convert_audio_and_split_sentences(
      extracted_dir, data_set, dest_dir
  ):
      source_dir = os.path.join(extracted_dir, data_set)
      target_dir = os.path.join(extracted_dir, dest_dir)
  
      if not os.path.exists(target_dir):
          os.makedirs(target_dir)
  
      # Loop over transcription files and split each one
      #
      # The format for each file 1-2.trans.txt is:
      #  1-2-0 transcription of 1-2-0.flac
      #  1-2-1 transcription of 1-2-1.flac
      #  ...
      #
      # Each file is then split into several files:
      #  1-2-0.txt (contains transcription of 1-2-0.flac)
      #  1-2-1.txt (contains transcription of 1-2-1.flac)
      #  ...
      #
      # We also convert the corresponding FLACs to WAV in the same pass
      files = []
      for root, dirnames, filenames in os.walk(source_dir):
          for filename in fnmatch.filter(filenames, "*.trans.txt"):
              trans_filename = os.path.join(root, filename)
              with codecs.open(trans_filename, "r", "utf-8") as fin:
                  for line in fin:
                      # Parse each segment line
                      first_space = line.find(" ")
                      seqid, transcript = (
                          line[:first_space],
                          line[first_space + 1 :],
                      )
  
                      # We need to do the encode-decode dance here because encode
                      # returns a bytes() object on Python 3, and text_to_char_array
                      # expects a string.
                      transcript = (
                          unicodedata.normalize("NFKD", transcript)
                          .encode("ascii", "ignore")
                          .decode("ascii", "ignore")
                      )
  
                      transcript = transcript.lower().strip()
  
                      # Convert corresponding FLAC to a WAV
                      flac_file = os.path.join(root, seqid + ".flac")
                      wav_file = os.path.join(
                          target_dir, seqid + ".wav"
                      )
                      if not os.path.exists(wav_file):
                          tfm = Transformer()
                          tfm.set_output_format(rate=SAMPLE_RATE)
                          tfm.build(flac_file, wav_file)
                      wav_filesize = os.path.getsize(wav_file)
  
                      files.append(
                          (
                              os.path.abspath(wav_file),
                              wav_filesize,
                              transcript,
                          )
                      )
  
      return pandas.DataFrame(
          data=files,
          columns=["wav_filename", "wav_filesize", "transcript"],
      )
  
file_path: DeepSpeech/bin/import_librivox.py
imports: import codecs
  import fnmatch
  import os
  import subprocess
  import sys
  import tarfile
  import unicodedata
  import pandas
  import progressbar
  from sox import Transformer
  from tensorflow.python.platform import gfile
  from deepspeech_training.util.downloader import maybe_download
label_desc: Use image node_id 3 for calling a global function with example usage: _convert_audio_and_split_sentences(extracted_dir, data_set, dest_dir) and returns: pandas