Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Anthony Larcher
sidekit
Commits
9bff8db3
Commit
9bff8db3
authored
Apr 11, 2021
by
Anthony Larcher
Browse files
debug
parent
4283067f
Changes
1
Hide whitespace changes
Inline
Side-by-side
nnet/augmentation.py
View file @
9bff8db3
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment