(sr=16000,
                  bins=40,
                  dither=True,
                  add_delta_deltas=False,
                  audio_desired_samples=-1,
                  audio_frame_length=0.025,
                  audio_frame_step=0.010,
                  cmvn=False,
                  cmvn_path='')
return p
speech feat params
speech feat params
speech feat params
def speech_params(sr=16000,
                  bins=40,
                  dither=True,
                  add_delta_deltas=False,
                  audio_desired_samples=-1,
                  audio_frame_length=0.025,
                  audio_frame_step=0.010,
                  cmvn=False,
                  cmvn_path=''):
  ''' speech feat params '''
  p = HParams()
  p.add_hparam("audio_sample_rate", sr)
  if dither:
    p.add_hparam("audio_dither", 1.0 / np.iinfo(np.int16).max)
  else:
    p.add_hparam("audio_dither", 0.0)

  p.add_hparam("audio_preemphasis", 0.97)
  p.add_hparam("audio_desired_channels", 1)
  p.add_hparam("audio_desired_samples", audio_desired_samples)
  p.add_hparam("audio_frame_length", audio_frame_length)
  p.add_hparam("audio_frame_step", audio_frame_step)
  p.add_hparam("audio_lower_edge_hertz", 20.0)
  p.add_hparam("audio_upper_edge_hertz", sr / 2.0)
  p.add_hparam("audio_num_mel_bins", bins)
  p.add_hparam("audio_add_delta_deltas", add_delta_deltas)
  p.add_hparam("num_zeropad_frames", 0)
  p.add_hparam("audio_global_cmvn", cmvn)
  p.add_hparam("audio_cmvn_path", cmvn_path)
  return p
def speech_params ( sr = 16000 , bins = 40 , dither = True , add_delta_deltas = False , audio_desired_samples = - 1 , audio_frame_length = 0.025 , audio_frame_step = 0.010 , cmvn = False , cmvn_path = '' ) : p = HParams ( ) p . add_hparam ( "audio_sample_rate" , sr ) if dither : p . add_hparam ( "audio_dither" , 1.0 / np . iinfo ( np . int16 ) . max ) else : p . add_hparam ( "audio_dither" , 0.0 ) p . add_hparam ( "audio_preemphasis" , 0.97 ) p . add_hparam ( "audio_desired_channels" , 1 ) p . add_hparam ( "audio_desired_samples" , audio_desired_samples ) p . add_hparam ( "audio_frame_length" , audio_frame_length ) p . add_hparam ( "audio_frame_step" , audio_frame_step ) p . add_hparam ( "audio_lower_edge_hertz" , 20.0 ) p . add_hparam ( "audio_upper_edge_hertz" , sr / 2.0 ) p . add_hparam ( "audio_num_mel_bins" , bins ) p . add_hparam ( "audio_add_delta_deltas" , add_delta_deltas ) p . add_hparam ( "num_zeropad_frames" , 0 ) p . add_hparam ( "audio_global_cmvn" , cmvn ) p . add_hparam ( "audio_cmvn_path" , cmvn_path ) return p