jstrait / wavefile

A Ruby gem for reading and writing sound files in Wave format (*.wav)
https://wavefilegem.com
MIT License
209 stars 24 forks source link

use little-endian pack codes #18

Closed hzulla closed 8 years ago

hzulla commented 8 years ago

Hi Joel,

the wavefile gem uses pack codes for "native endian", but it should use "little endian" for RIFF files instead.

After packaging the gem for Debian, it turned out that software using the gem didn't work properly when running on big-endian hardware.

Changing the pack codes fixes the gem and rake test is happy again. Tested on x86 (little endian) and powerpc (big endian).

hzulla commented 8 years ago

(I don't know if it's worth adding RIFX support, which is RIFF with big-endian byte order, since I haven't seen that file format in the wild...)

samaaron commented 8 years ago

Is there any likelihood of this patch making it into this library - or should we consider the lib unmaintained at this stage? :-)

jstrait commented 8 years ago

Hey @hzulla, thanks for opening this PR! I released a new version of this gem today (0.7.0) which should include a fix for this issue (along with some other changes), so I'll close this PR out. (I had actually already fixed this on the 0.7.0 branch when you opened this PR, but hadn't released it yet). Please let me know if the new release fixes the issues on big endian platforms.

@samaaron This gem is still maintained, but it's a hobby project I work on when I have free time, so sometimes it takes me awhile to get to things. Cool to see this being used in Sonic Pi!

hzulla commented 8 years ago

Thank you! I'll test it on my big-endian VM during the week and possibly pack it for Debian, too.