[futurebasic] more: SndRecord Toolbox function

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

From: "support@..." <support@...>
Date: Wed, 30 Jun 1999 12:25:44 -0500
Hello FB People,

  Thanks for all the responses I got on the SndRecord posting. I
actually had no idea there was a pascal converter accompanying FBII.
Thanks for the tip, Bill.

In further working with the code snippets posted, and comparing them
to the converted pascal routine (which looks identical) I was still
unable to achieve the results I expected to see from reading the
docs at the apple site. Correct me if I am mistaken, but I am under the
impression that calling the SndRecord function should pop up a dialog
with stop, start, pause, play and resume recording controls. I seem to
get nothing, and my call returns -108 which is not listed in the docs.

I call the function like this:

        DIM myPoint.4, lp
        myPoint.v = 0
        myPoint.h = 0
        lp = FN SndRecord(_nil,myPoint.nil, _Sigoodquality ,_nil)
        print str$(lp)

and the function is defined like so:

LOCAL FN SndRecord(filterProc&,@corner&,quality&,sndHandle&)
  `     SUBQ.L    #2, SP
  `     MOVE.L    ^filterProc&,-(SP)              ;ModalFilterUPP
  `     MOVE.L    ^corner&,A0
  `     MOVE.L    (A0),-(SP)                      ;Point
  `     MOVE.L    ^quality&,-(SP)                 ;OSType
  `     MOVE.L    ^sndHandle&,-(SP)               ;Var: SndListHandle
  `     DC.W      $203C,$0804,$0014,$A800
  `     MOVE.W    (SP)+,D0
  `     EXT.L     D0
END FN = REGISTER(D0)                             'OSErr

according to the docs sndHandle& in the function definition is
declared @sndHandle&, but I changed it in order to be able to pass
NIL to it. Could this be my problem? The docs say I can pass a handle
to some storage space or NIL to use default storage space. Does anyone
have a working example of sound recording, showing call and
function definition?

Robert Price
Programmer/Technical Support