Skip to content

Commit

Permalink
Auto-align .WAV chunks on 16-bit boundaries when reading (Walkabout d…
Browse files Browse the repository at this point in the history
…eclares odd-sized chunks, but still pads for even alignment)
  • Loading branch information
riggsd committed Jan 30, 2016
1 parent 7b1485f commit 37324a0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions guano.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ def _load(self):
metadata_buf = mmfile[offset:offset+size]
elif subchunk == 'data':
self.wav_data = mmfile[offset:offset+size]
if size % 2:
offset += 1 # align to 16-bit boundary
offset += size

if not self.wav_data:
Expand Down

0 comments on commit 37324a0

Please sign in to comment.