Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!apple!uokmax!d.cs.okstate.edu!unx2.ucc.okstate.edu!minich From: minich@unx2.ucc.okstate.edu (Robert Minich) Newsgroups: comp.sys.next Subject: Re: Soundfiles Message-ID: <1991Mar26.004133.4930@unx2.ucc.okstate.edu> Date: 26 Mar 91 00:41:33 GMT References: <17776@sdcc6.ucsd.edu> Organization: Oklahoma State University Computer Center Lines: 39 kasdan@cunixa.cc.columbia.edu (John Kasdan) writes: ! What is a reference for the format of the Soundfiles? From the ! on-line documentation, I get the impression that data is stored in the ! form of 1 byte which is interpretted [sic] by something called mulaw. How ! do I find out what all this means? To be more specific, I would like ! to be able to get my hands on data in pure amplitude form, so as to be ! able to do FFT work on it. Like, is there some form of conversion to ! 16 bit format, and would that do what I want? by cpenrose@sdcc13.ucsd.edu (Christopher Penrose): | look at the header files in /usr/include/sound. Here is an excerpt from | soundconvert.h: | | unsigned char SNDMulaw(short n); | short SNDiMulaw(unsigned char m); | /* | * Routines to convert from 8 bit mulaw sound to/from 16 linear sound. | * SNDMulaw returns the mulaw value for the given 16 bit linear value, | * and SNDiMulaw returns the 16 bit linear value for the given mulaw value. | */ | | soundstruct.h will give you some info on the header that is prepended to | each NeXT soundfile. Look at the on-line documentation again. It is | very helpful. | | Christopher Penrose | jesus!penrose How about a reference that explains mulaw encoding for those of use without these info sources. I don't have access to a NeXT (still too expensive at this time...price is right, wallet is wrong...) but I want to know how it works. Thanks. -- |_ /| | Robert Minich | |\'o.O' | Oklahoma State University| "I'm not discouraging others from using |=(___)= | minich@d.cs.okstate.edu | their power of the pen, but mine will | U | - "Ackphtth" | continue to do the crossword." M. Ho