From: Ben Nagy Date: 2006-10-25T03:37:15+09:00 Subject: Re: Bitstuct and binary files > -----Original Message----- [...] > Can anybody tell me why setting an audio.alength>=1024 breaks > the output > and provide a way to fix it ... ---borked--- num=359447 f.write(num.to_s(16)[0..2].instance_eval {(self.reverse + '0' * (6 - self.length)).reverse}.scan(/../).inject('') {|s,byte| s << byte.to_i(16)}) --- My code is broken. Where I said [0..2] I meant [0..5], I added it in at the last minute as an overflow check without testing - I was thinking 3 raw hex bytes but the string after the conversion is a 6 byte 'friendly' hex string. Sorry. :( ben