C
Chris
Dear All,
I'm trying to use perl in a way I am not usd to, and coming unstuck :-(
I have a binary file of unsigned byte values, and I wish to convert these
into a .wav file, so that I can use the soundcard DAC to generate the
waveform the binary file describes (cool huh? Cheap signal generator
The problem is that the wav file format needs to have all all sorts of stuff
munged into the header, including strings "RIFF" "WAVE" and "fmt " and
values that describe other paramters. SOme of these data types are 32 bit,
some are 16 some are 8.
In perl how do i ...
a) write to a file in binary mode. I have tried using binmode(FH) before the
writing beging, but it seems to make little difference
b) write strings in binary mode. I dont really have to do write 0x52 0x49
0x46 0x46 if there is a way to write "RIFF" and have perl do the donkey work
c) Declare the widths of my variables. I need to be able to assign a
variable with a value, and output all 4 bytes of that value to the file in
binary mode.
I'm guessing that all this is very easy, and I'm just looking in the wrong
place :-(
Cheers
Chris
I'm trying to use perl in a way I am not usd to, and coming unstuck :-(
I have a binary file of unsigned byte values, and I wish to convert these
into a .wav file, so that I can use the soundcard DAC to generate the
waveform the binary file describes (cool huh? Cheap signal generator
The problem is that the wav file format needs to have all all sorts of stuff
munged into the header, including strings "RIFF" "WAVE" and "fmt " and
values that describe other paramters. SOme of these data types are 32 bit,
some are 16 some are 8.
In perl how do i ...
a) write to a file in binary mode. I have tried using binmode(FH) before the
writing beging, but it seems to make little difference
b) write strings in binary mode. I dont really have to do write 0x52 0x49
0x46 0x46 if there is a way to write "RIFF" and have perl do the donkey work
c) Declare the widths of my variables. I need to be able to assign a
variable with a value, and output all 4 bytes of that value to the file in
binary mode.
I'm guessing that all this is very easy, and I'm just looking in the wrong
place :-(
Cheers
Chris