Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Abdelwahab HEBA
kaldi_2015
Commits
b20fa8ad
Commit
b20fa8ad
authored
Jul 21, 2015
by
Daniel Povey
Browse files
Fix to wave-reading code to read wav's with odd number of samples.
parent
4b4ad10a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
src/feat/wave-reader.cc
src/feat/wave-reader.cc
+4
-1
No files found.
src/feat/wave-reader.cc
View file @
b20fa8ad
...
...
@@ -220,7 +220,10 @@ void WaveData::Read(std::istream &is) {
uint32
data_chunk_size
=
ReadUint32
(
is
,
swap
);
riff_chunk_read
+=
4
;
if
(
riff_chunk_read
+
data_chunk_size
!=
riff_chunk_size
)
{
if
(
std
::
abs
((
riff_chunk_read
+
data_chunk_size
)
-
riff_chunk_size
)
>
1
)
{
// we allow the size to be off by one, because there is a weirdness in the
// format of RIFF files that means that the input may sometimes be padded
// with 1 unused byte to make the total size even.
KALDI_ERR
<<
"Expected "
<<
riff_chunk_size
<<
" bytes in RIFF chunk, but "
<<
"after first data block there will be "
<<
riff_chunk_read
<<
" + "
<<
data_chunk_size
<<
" bytes "
...
...
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