|
|
@ -25,17 +25,19 @@ parser = argparse.ArgumentParser(description=__doc__)
|
|
|
|
add_arg = functools.partial(add_arguments, argparser=parser)
|
|
|
|
add_arg = functools.partial(add_arguments, argparser=parser)
|
|
|
|
# yapf: disable
|
|
|
|
# yapf: disable
|
|
|
|
add_arg('num_samples', int, -1, "# of samples to for statistics.")
|
|
|
|
add_arg('num_samples', int, -1, "# of samples to for statistics.")
|
|
|
|
|
|
|
|
|
|
|
|
add_arg('specgram_type', str,
|
|
|
|
add_arg('specgram_type', str,
|
|
|
|
'linear',
|
|
|
|
'linear',
|
|
|
|
"Audio feature type. Options: linear, mfcc, fbank.",
|
|
|
|
"Audio feature type. Options: linear, mfcc, fbank.",
|
|
|
|
choices=['linear', 'mfcc', 'fbank'])
|
|
|
|
choices=['linear', 'mfcc', 'fbank'])
|
|
|
|
add_arg('feat_dim', int, 13, "Audio feature dim.")
|
|
|
|
add_arg('feat_dim', int, 13, "Audio feature dim.")
|
|
|
|
add_arg('delta_delta', bool,
|
|
|
|
add_arg('delta_delta', bool, False, "Audio feature with delta delta.")
|
|
|
|
False,
|
|
|
|
|
|
|
|
"Audio feature with delta delta.")
|
|
|
|
|
|
|
|
add_arg('stride_ms', float, 10.0, "stride length in ms.")
|
|
|
|
add_arg('stride_ms', float, 10.0, "stride length in ms.")
|
|
|
|
add_arg('window_ms', float, 20.0, "stride length in ms.")
|
|
|
|
add_arg('window_ms', float, 20.0, "stride length in ms.")
|
|
|
|
add_arg('sample_rate', int, 16000, "target sample rate.")
|
|
|
|
add_arg('sample_rate', int, 16000, "target sample rate.")
|
|
|
|
|
|
|
|
add_arg('use_dB_normalization', bool, False, "do dB normalization.")
|
|
|
|
|
|
|
|
add_arg('target_dB', int, -20, "target dB.")
|
|
|
|
|
|
|
|
|
|
|
|
add_arg('manifest_path', str,
|
|
|
|
add_arg('manifest_path', str,
|
|
|
|
'data/librispeech/manifest.train',
|
|
|
|
'data/librispeech/manifest.train',
|
|
|
|
"Filepath of manifest to compute normalizer's mean and stddev.")
|
|
|
|
"Filepath of manifest to compute normalizer's mean and stddev.")
|
|
|
@ -63,8 +65,8 @@ def main():
|
|
|
|
n_fft=None,
|
|
|
|
n_fft=None,
|
|
|
|
max_freq=None,
|
|
|
|
max_freq=None,
|
|
|
|
target_sample_rate=args.sample_rate,
|
|
|
|
target_sample_rate=args.sample_rate,
|
|
|
|
use_dB_normalization=True,
|
|
|
|
use_dB_normalization=args.use_dB_normalization,
|
|
|
|
target_dB=-20,
|
|
|
|
target_dB=args.target_dB,
|
|
|
|
dither=0.0)
|
|
|
|
dither=0.0)
|
|
|
|
|
|
|
|
|
|
|
|
def augment_and_featurize(audio_segment):
|
|
|
|
def augment_and_featurize(audio_segment):
|
|
|
|