Commit 9bff8db3 authored by Anthony Larcher's avatar Anthony Larcher
Browse files

debug

parent 4283067f
......@@ -543,14 +543,16 @@ def data_augmentation(speech,
speech = (scale * speech + noise) / 2
if "codec" in augmentations:
final_shape = speech.shape[1]
configs = [
{"format": "wav", "encoding": 'ULAW', "bits_per_sample": 8},
{"format": "gsm"},
{"format": "mp3", "compression": -9},
{"format": "vorbis", "compression": -1}
({"format": "wav", "encoding": 'ULAW', "bits_per_sample": 8}, "8 bit mu-law"),
({"format": "gsm"}, "GSM-FR"),
({"format": "mp3", "compression": -9}, "MP3"),
({"format": "vorbis", "compression": -1}, "Vorbis")
]
param, title = random.choice(configs)
speech = torchaudio.functional.apply_codec(speech, sample_rate, **param)
speech = speech[:, :final_shape]
return speech
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment