class_docstr: Base class for speech recognition problems.
code: def preprocess_example(self, example, mode, hparams):
      p = hparams
      if p.audio_preproc_in_bottom:
          example["inputs"] = tf.expand_dims(
              tf.expand_dims(example["waveforms"], -1), -1
          )
      else:
          waveforms = tf.expand_dims(example["waveforms"], 0)
          mel_fbanks = common_audio.compute_mel_filterbank_features(
              waveforms,
              sample_rate=p.audio_sample_rate,
              dither=p.audio_dither,
              preemphasis=p.audio_preemphasis,
              frame_length=p.audio_frame_length,
              frame_step=p.audio_frame_step,
              lower_edge_hertz=p.audio_lower_edge_hertz,
              upper_edge_hertz=p.audio_upper_edge_hertz,
              num_mel_bins=p.audio_num_mel_bins,
              apply_mask=False,
          )
          if p.audio_add_delta_deltas:
              mel_fbanks = common_audio.add_delta_deltas(mel_fbanks)
          fbank_size = common_layers.shape_list(mel_fbanks)
          assert fbank_size[0] == 1
  
          # This replaces CMVN estimation on data
          var_epsilon = 1e-09
          mean = tf.reduce_mean(mel_fbanks, keepdims=True, axis=1)
          variance = tf.reduce_mean(
              tf.squared_difference(mel_fbanks, mean),
              keepdims=True,
              axis=1,
          )
          mel_fbanks = (mel_fbanks - mean) * tf.rsqrt(
              variance + var_epsilon
          )
  
          # Later models like to flatten the two spatial dims. Instead, we add a
          # unit spatial dim and flatten the frequencies and channels.
          example["inputs"] = tf.concat(
              [
                  tf.reshape(
                      mel_fbanks,
                      [fbank_size[1], fbank_size[2], fbank_size[3]],
                  ),
                  tf.zeros(
                      (
                          p.num_zeropad_frames,
                          fbank_size[2],
                          fbank_size[3],
                      )
                  ),
              ],
              0,
          )
  
      if not p.audio_keep_example_waveforms:
          del example["waveforms"]
      return super(SpeechRecognitionProblem, self).preprocess_example(
          example, mode, hparams
      )
  
imports: import numpy
  from tensor2tensor.data_generators import audio_encoder
  from tensor2tensor.data_generators import problem
  from tensor2tensor.data_generators import text_encoder
  from tensor2tensor.layers import common_audio
  from tensor2tensor.layers import common_layers
  from tensor2tensor.layers import modalities
  from tensor2tensor.utils import metrics
  import tensorflow.compat.v1
label_desc: Use image node_id 7 for calling the SpeechRecognitionProblem obj's underlying member method code with example usage: obj.preprocess_example(example, mode, hparams) and returns: super