code: def mid_feature_extraction_to_file(
      file_path,
      mid_window,
      mid_step,
      short_window,
      short_step,
      output_file,
      store_short_features=False,
      store_csv=False,
      plot=False,
  ):
      """
      This function is used as a wrapper to:
      a) read the content of a WAV file
      b) perform mid-term feature extraction on that signal
      c) write the mid-term feature sequences to a np file
      d) optionally write contents to csv file as well
      e) optionally write short-term features in csv and np file
      """
      sampling_rate, signal = audioBasicIO.read_audio_file(file_path)
      signal = audioBasicIO.stereo_to_mono(signal)
      mid_features, short_features, _ = mid_feature_extraction(
          signal,
          sampling_rate,
          round(sampling_rate * mid_window),
          round(sampling_rate * mid_step),
          round(sampling_rate * short_window),
          round(sampling_rate * short_step),
      )
      if store_short_features:
          # save st features to np file
          np.save(output_file + "_st", short_features)
          if plot:
              print(
                  "Short-term np file: " + output_file + "_st.npy saved"
              )
          if store_csv:
              # store st features to CSV file
              np.savetxt(
                  output_file + "_st.csv",
                  short_features.T,
                  delimiter=",",
              )
              if plot:
                  print(
                      "Short-term CSV file: "
                      + output_file
                      + "_st.csv saved"
                  )
  
      # save mt features to np file
      np.save(output_file + "_mt", mid_features)
      if plot:
          print("Mid-term np file: " + output_file + "_mt.npy saved")
      if store_csv:
          np.savetxt(
              output_file + "_mt.csv", mid_features.T, delimiter=","
          )
          if plot:
              print(
                  "Mid-term CSV file: " + output_file + "_mt.csv saved"
              )
  
file_path: pyAudioAnalysis/pyAudioAnalysis/MidTermFeatures.py
imports: from __future__ import print_function
  import os
  import time
  import glob
  import numpy
  import matplotlib.pyplot
  import sys
  from pyAudioAnalysis import utilities
  from pyAudioAnalysis import audioBasicIO
  from pyAudioAnalysis import ShortTermFeatures
label_desc: Use image node_id 6 for calling a global function with example usage: mid_feature_extraction_to_file(file_path, mid_window, mid_step, short_window, short_step, output_file, store_short_features, store_csv, plot) without return types