Article View: comp.windows.ms
Article #84Re: Transfering sounds
From: Mort Rasmussen
Date: Thu, 23 Jul 1992 18:27
Date: Thu, 23 Jul 1992 18:27
70 lines
2592 bytes
2592 bytes
In article <1992Jul21.193004.4711@newstand.syr.edu> ggreenbe@rodan.acs.syr.edu (Gerald Greenberg) writes:
>Can anybody suggest a way to translate Mac sound files
>generated by SoundEdit to .wav files for Windows? Are there
>any programs (commercial or shareware/pd) that will translate
>aiff format sounds into .wav files?
>Thanks for your help.
Here's some (Turbo) Pascal source that'll do it.
(No comments about the coding, which is pretty awfull)
PROGRAM sw2win;
TYPE hbt = array [1..44] of byte;
li = array [1..4] of byte;
VAR i,u : file;
buf : array [1..50000] of byte;
hb : hbt;
ai,au : word;
si,so : string;
fs : longint;
x,y,z : longint;
CONST hbi : hbt = ($52,$49,$46,$46, 0,0,0,0, $57,$41,$56,$45, $66,$6D,$74,$20,
$10,0,0,0, 1,0,1,0, $22,$56,0,0, $22,$56,0,0,
1,0,8,0, $64,$61,$74,$61, 0,0,0,0);
VAR hi : li absolute fs;
BEGIN
writeln('SoundWave to Windows converter, ver. 1.0, 1992');
writeln;
hb:=hbi;
IF paramcount>0 then
BEGIN
si:=paramstr(1);
so:=si;
IF pos('.',so)=0 then
so:=so+'.WAV'
ELSE
so:=copy(si,1,pos('.',si))+'WAV';
assign(i,si);
reset(i,1);
assign(u,so);
rewrite(u,1);
fs:=filesize(i);
writeln('Creating Windows Wave-file ',so,' from SoundWave file ',si);
writeln('Reading ', fs,' bytes...');
fs:=fs;
hb[5]:=hi[1];
hb[6]:=hi[2];
hb[7]:=hi[3];
hb[8]:=hi[4];
fs:=fs-36;
hb[41]:=hi[1];
hb[42]:=hi[2];
hb[43]:=hi[3];
hb[44]:=hi[4];
blockwrite(u,hb,sizeof(hb),au);
REPEAT
BlockRead(i,buf,SizeOf(Buf),ai);
BlockWrite(u,Buf,ai,au);
UNTIL (ai=0) or (au<> ai);
close(i);
close(u)
END
ELSE
BEGIN
writeln('Syntax : SW2WIN filename.ext');
writeln;
writeln('Adds WAV header to binary soundfiles,');
writeln('from fi SoundWave editor (Mac)')
END
END.
Technical Details
Message-ID:
<mortr.134.711916001@windmill.tulip.lmt.mn.org>Path:
arc1-ca.pugleaf.net!sparky!uunet!usc!sol.ctr.columbia.edu!The-Star.honeywell.com!umn.edu!kksys.com!edgar!brainiac!lmt!mr.tulip.lmt.com!mortrReferences:
<1992Jul21.193004.4711@newstand.syr.edu>Show Full Headers
Complete Article Headers
Newsgroups: comp.windows.ms Path: arc1-ca.pugleaf.net!sparky!uunet!usc!sol.ctr.columbia.edu!The-Star.honeywell.com!umn.edu!kksys.com!edgar!brainiac!lmt!mr.tulip.lmt.com!mortr From: mortr@windmill.tulip.lmt.mn.org (Mort Rasmussen) Subject: Re: Transfering sounds Message-ID: <mortr.134.711916001@windmill.tulip.lmt.mn.org> Summary: Looking to go from Mac to Windows Keywords: sound, mac, aiff Sender: usenet@lmt.mn.org Nntp-Posting-Host: mr.tulip.lmt.com Organization: LaserMaster (Europe), Hoofddorp, Holland References: <1992Jul21.193004.4711@newstand.syr.edu> Date: Thu, 23 Jul 92 18:27:11 GMT Lines: 70