Skip to content

WAV loader is not dealing with possible 'JUNK' chunk and therefore might fail in file loading. #23

@MaGetzUb

Description

@MaGetzUb

Sometimes WAV encoders might add an additional 'JUNK' chunk into .wav files to ensure byte alignment with the pcm data (so I'd think at least). 'JUNK' chunk might appear before 'fmt ' chunk, and therefore some action should be taken, to prevent the decoder from failing.

My suggestion is to read 4 bytes, compare it to 'JUNK' first, if it exist then read the next four bytes to acquire the chunk size, and then skip the number chunk size bytes, and then proceed to deal with 'fmt ' chunk. If the 'JUNK' chunk didn't exist, seek back last 4bytes, and then proceed read and to deal with 'fmt ' chunk.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions