[futurebasic] Re: [FB] [X-FB] AIFF, Challenge Complete

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : October 1999 : Group Archive : Group : All Groups

From: Jamin <benjamen@...>
Date: Tue, 12 Oct 1999 21:49:42 +1000
Rick Brown said something like:

> So here's a coding challenge!  I challenge anyone to write an FB program that
> will (by calling SetupAIFFHeader) write an AIFF header to a file.  Use any
> parameters that you can get to work.  The program needn't write anything else
> at all to the file, nor do any actual sound recording.  You may either use the
> version of FN SetupAIFFHeader provided below, or create your own.  Hopefully,
> by examing the differences between your (working) code and mine, I can see
> what I'm doing wrong.

Now a _challenge_, thats going to get my blood going.  Unfortunatly,
its just your definition that was wrong.  How old are the headers you are using?  I thought
I was bad using my 1996 headers, yours must be even earlier than that!

Note the differences in the line

`     DC.W      $203C,$0B4C,$0014,$A800

Watch for email wrapping!!

'      Function:SetupAIFFHeader
LOCAL FN SetupAIFFHeader(fRefNum%,numChannels%,sampleRate&,sampleSize%,
  `     CLR.W     -(SP)
  `     MOVE.W    ^fRefNum%,-(SP)                 ;INTEGER
  `     MOVE.W    ^numChannels%,-(SP)             ;INTEGER
  `     MOVE.L    ^sampleRate&,-(SP)              ;UnsignedFixed
  `     MOVE.W    ^sampleSize%,-(SP)              ;INTEGER
  `     MOVE.L    ^compressionType&,-(SP)         ;OSType
  `     MOVE.L    ^numBytes&,-(SP)                ;LONGINT
  `     MOVE.L    ^numFrames&,-(SP)               ;LONGINT
  `     DC.W      $203C,$0B4C,$0014,$A800
  `     MOVE.W    (SP)+,D0
  `     EXT.L     D0
END FN = REGISTER(D0)                             'OSErr