Xref: utzoo comp.sys.amiga.misc:4032 comp.sys.amiga.audio:777 comp.sys.amiga.programmer:3996 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!zaphod.mps.ohio-state.edu!mips!pacbell.com!tandem!zorch!amiga0!mykes From: mykes@amiga0.SF-Bay.ORG (Mike Schwartz) Newsgroups: comp.sys.amiga.misc,comp.sys.amiga.audio,comp.sys.amiga.programmer Subject: Re: Amiga to Mac sound file conversion Message-ID: Date: 28 May 91 08:00:20 GMT References: <1991May22.131159.29523@magnus.acs.ohio-state.edu> <1991May27.175826.8556@watserv1.waterloo.edu> Organization: Amiga makes it possible Lines: 104 In article <1991May27.175826.8556@watserv1.waterloo.edu> tcapener@watserv1.waterloo.edu (CAPENER TD - ENGLISH ) writes: >In article <1991May22.131159.29523@magnus.acs.ohio-state.edu>, dasay@magnus.acs.ohio-state.edu (Devin N Asay) writes: >> Anybody out there know of any utilities that convert Amiga IFF sampled >> audio files to any Mac audio file format? >> >> Devin N. Asay >> Computer-Based Instruction >> *The* Ohio State University > >SoundEdit from Farralon Computing (a Mac program) can read and write >IFF format files (sort of). I recently converted a lot of PD Mac sounds >into Amiga format. Unfortunately, it wasn't all that straightforward. > >What I did was to load the Mac sound resources into SoundEdit, then save >them as IFF files. Unfortunately, most 8SVX players don't like SoundEdit's >idea of IFF (but the PD player 'play' does). So, I used a byte-by-byte >file editor (zap) to remove all of the IFF header information and turned >the file into raw 8SVX sound, which I then loaded into Perfect Sound and >saved in a more palatteable IFF format which all of my 8SVX players can >read. > >I realise you want to do the opposite of what I did, so if SoundEdit can't >read Amiga's IFF sound files then you'll have to do what I did in reverse. >Look in the Addisson Wesely Amiga Autodocs book for info on how to make >an 8SVX header if you need to. > >Sorry this is so vague, but I hope it helps a bit. The following 'C' program should do the trick. It compiles under SAS 5.10. It reads in an IFF file and converts into a Mac sound format compatible with various Mac utilities (just xmodem to a mac). It also will convert a Mac sound to Amiga format, but doesn't write out IFF. #include #include #include ULONG sampleSize = 0; BYTE *samplePtr, *sampleData, *malloc(); ReadSound(fn) char *fn; { int fd; ULONG *pl; if (sampleSize) free(sampleData); sampleSize = 0; fd = open(fn, O_RDONLY); if (fd == -1) return 0; sampleSize = (ULONG)lseek(fd, 0, 2); lseek(fd, 0,0); samplePtr = (BYTE *)malloc(sampleSize); if (!samplePtr) { printf("Insufficient memory for %d bytes\n", sampleSize); return 0; } read(fd, samplePtr, sampleSize); close(fd); sampleData = samplePtr; if (!strncmp(sampleData, "FORM", 4)) { samplePtr = &samplePtr[0x60]; while (strncmp(samplePtr, "BODY", 4)) samplePtr += 2; samplePtr += 4; pl = (ULONG *)&samplePtr[0]; sampleSize = *pl; samplePtr += 4; } printf("SampleSize = %d bytes\n", sampleSize); return !0; } main(ac, av) int ac; char *av[]; { long i; int fd; if (ac != 3) { printf("Usage: maccvt infile outfile\n"); exit(999); } if (!ReadSound(av[1])) { printf("Can't read %s\n", av[1]); exit(999); } for (i=0; i