Skip to content

Conversation

@KarelVesely84
Copy link
Contributor

  • Apple creates wavs with extra RIFF tags for optimizing memory layout,

  • Please let me know if you'd like to do further refactoring of the code,
    i can imagine there could be a method 'ProceedTo4ByteTag("ABCD")',
    which would skip tags until it reaches 'ABCD' and returns number of bytes read...

  • On the other hand, the code in this PR already solves the issue, and the changes are the smallest possible.

while (strcmp(reader.tag,"fmt ") != 0) {
uint32 filler_size = reader.ReadUint32();
riff_chunk_read += 4;
KALDI_WARN << "Skipping RIFF tag '" << reader.tag
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't imagine you want that warning there permanently...

- Apple creates wavs with extra RIFF tags for optimizing memory layout,
  - instead of standard 'RIFF,WAVE,fmt ,data'
    we observed a file with 'RIFF,WAVE,JUNK,fmt ,FLLR,data'
  - according to RIFF specs, we should skip the unknown tags, which is
    what the fix does, as it skips the 'JUNK', the skip of 'FLLR' was
    already in the code.
  - similar problem discussed in: https://stackoverflow.com/questions/6284651/avaudiorecorder-doesnt-write-out-proper-wav-file-header
- Please let me know if you'd like to refactor the code,
  i can imagine there could be a method 'ProceedToTag("ABCD")',
  which skips tags until it reaches 'ABCD', but this would change
  more of the code, also 'byte-counting' would be more diffcult...
- The code as in this PR already solves the issue, and the changes
  are smallest possible.
@KarelVesely84
Copy link
Contributor Author

Okay, the warning-print is now removed. The code is tested on both the Apple and non-Apple wavefile...

@danpovey danpovey merged commit eba50e4 into kaldi-asr:master Mar 20, 2018
@KarelVesely84 KarelVesely84 deleted the iphone_wav branch January 16, 2019 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants