Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Hertz-Lab
Research
Intelligent Museum
language-identification
Commits
12f74332
Commit
12f74332
authored
Jul 16, 2021
by
Paul Bethge
Browse files
fix data loss by cast
parent
8b24b2e3
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/audio/utils.py
View file @
12f74332
...
...
@@ -30,7 +30,7 @@ def pad_with_silence(data, max_len):
def
pad_with_data
(
data
,
max_len
):
to_add
=
max
(
max_len
-
len
(
data
),
0
)
padded
=
np
.
zeros
(
shape
=
(
max_len
,),
dtype
=
"
int16
"
)
padded
=
np
.
zeros
(
shape
=
(
max_len
,),
dtype
=
"
float32
"
)
if
to_add
:
repeat
=
int
(
max_len
/
len
(
data
))
rest
=
max_len
%
len
(
data
)
...
...
Write
Preview
Supports
Markdown
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