Path: utzoo!attcan!uunet!ogicse!ucsd!usc!cs.utexas.edu!rice!sun-spots-request From: andrew@ambra.dk (Leif Andrew Rump) Newsgroups: comp.sys.sun Subject: What is the _REAL_ SunSparc1 sound-format?!? Keywords: Miscellaneous Message-ID: <8823@brazos.Rice.edu> Date: 12 Jun 90 11:54:56 GMT Sender: root@rice.edu Organization: Sun-Spots Lines: 46 Approved: Sun-Spots@rice.edu X-Sun-Spots-Digest: Volume 9, Issue 213, message 2 The reason I ask is that none of the documentation that I have access to conform to the actual content of the files I found in /usr/demo/SOUND/sounds neither that in /usr/demo/SOUND/man or SunOS 4.1 manuals! The sample.au under 4.0.3 contained only data (about debug!) but under 4.1 a header which looks something like this unsigned '.snd' ; magic number unsigned offset ; header length unsigned length ; data lengtgh unsigned channels ; or encoding (1) unsigned samples ; per second unsigned encoding ; or channels (1) 4 * char title ; zterminated padded with 0's char data ; sound The title isn't mentioned anywhere in any of the documents and parts like bytes per unit is missing completely! BTW: Could somebody please explain to me - down to earth (I think that is a Danish expression said in English!) - what signed/unsigned is (on a SunSparc)! Or at least tell me why I have to write my programs like below: #include main() { char tmp; while ((tmp = getchar()) != EOF) printf("%c", (tmp < 0) ? tmp : 128 - tmp); } I don't understand the: (tmp < 0) ? 128 - tmp : tmp; part. If I don't do it my sound get mangled and looks very funny in the sound-tool application. The lines below is from a program that generates sinus: tmp = (128 + volume * sin((Hz * 2 * PI * nr) / SAMPLE / 10)); buffer[nr] = (tmp < 0) ? 128 - tmp : tmp; Leif Andrew Rump, AmbraSoft AS, Stroedamvej 50, DK-2100 Copenhagen OE, Denmark UUCP: andrew@ambra.dk, phone: +45 39 27 11 77 / Currently at Scandinavian Airline Systems =======/ UUCP: andrew@resam.dk, phone: +45 32 32 22 79 \ SAS, RESAM Project Office, CPHML-V, P.O.BOX 150, DK-2770 Kastrup, Denmark