FB II Compiler

PG PRO

Debugging

Memory

System

Mathematics

Resources

Disk I/O

Windows

Controls

Menus

Mouse

Keyboard

Text

Fonts

Drawing

Sound

Clipboard

Printing

Communication

ASM

Made with FB

SOUND

Record 16 bit sounds


I use the sound input part of the sound manager.

To record 16 bit, you need to open the sound input driver and configure it with your recording parameters and then start your recording. I would recommend that you check out Apple's developer web site for information on the sound input manager. There are PDF files there that document the sound manager and sound input manager.

Below are a few of the sound input reutines to help get you started. If you don't have it, you need to download the pascal interface files for the Mac OS from Apple's developer site and use the Pascal Converter that was included with FBII to convert the sound manager p interface files to FB.
'---------------------------------------

LOCAL MODE
LOCAL FN SPBOpenDevice(deviceName&,permission%,@inRefNum&)
  `     CLR.W     -(SP)
  `     MOVE.L    ^deviceName&,-(SP)              ;ConstStr255Param
  `     MOVE.W    ^permission%,-(SP)              ;INTEGER
  `     MOVE.L    ^inRefNum&,-(SP)                ;Var: LONGINT
  `     DC.W      $203C,$0518,$0014,$A800
  `     MOVE.W    (SP)+,D0
  `     EXT.L     D0
END FN = REGISTER(D0)                             'OSErr

'---------------------------------------

LOCAL MODE
LOCAL FN SPBCloseDevice(inRefNum&)
  `     CLR.W     -(SP)
  `     MOVE.L    ^inRefNum&,-(SP)                ;LONGINT
  `     DC.W      $203C,$021C,$0014,$A800
  `     MOVE.W    (SP)+,D0
  `     EXT.L     D0
END FN = REGISTER(D0)                             'OSErr

'---------------------------------------

LOCAL MODE
LOCAL FN SPBGetDeviceInfo(inRefNum&,infoType&,infoData&)
  `     CLR.W     -(SP)
  `     MOVE.L    ^inRefNum&,-(SP)                ;LONGINT
  `     MOVE.L    ^infoType&,-(SP)                ;OSType
   `     MOVE.L    ^infoData&,-(SP)                ;UNIVPtr
  `     DC.W      $203C,$0638,$0014,$A800
  `     MOVE.W    (SP)+,D0
  `     EXT.L     D0
END FN = REGISTER(D0)                             'OSErr

'---------------------------------------

LOCAL MODE
LOCAL FN SPBSetDeviceInfo(inRefNum&,infoType&,infoData&)
  `     CLR.W     -(SP)
  `     MOVE.L    ^inRefNum&,-(SP)                ;LONGINT
  `     MOVE.L    ^infoType&,-(SP)                ;OSType
  `     MOVE.L    ^infoData&,-(SP)                ;UNIVPtr
  `     DC.W      $203C,$063C,$0014,$A800
  `     MOVE.W    (SP)+,D0
  `     EXT.L     D0
END FN = REGISTER(D0)                             'OSErr

'---------------------------------------

LOCAL MODE
LOCAL FN SPBRecord(inParamPtr&,asynchFlag%)
  `     CLR.W     -(SP)
  `     MOVE.L    ^inParamPtr&,-(SP)              ;SPBPtr
  `     MOVE.B    ^asynchFlag%,-(SP)              ;BOOLEAN
  `     DC.W      $203C,$0320,$0014,$A800
  `     MOVE.W    (SP)+,D0
  `     EXT.L     D0
END FN = REGISTER(D0)                             'OSErr
.

'---------------------------------------

CLEAR LOCAL
LOCAL FN SetSRate(SIDeviceRefNum&,theRate&)
  err = FN SPBSetDeviceInfo (SIDeviceRefNum&, _"srat" , @ theRate&)
  err = FN SPBGetDeviceInfo (SIDeviceRefNum&, _"srat" , @ theRate&)
END FN = theRate&

'---------------------------------------

CLEAR LOCAL
LOCAL FN SetSSize(SIDeviceRefNum&, sampleSize)
  err = FN SPBSetDeviceInfo (SIDeviceRefNum&, _"ssiz" , @ sampleSize)
  err = FN SPBGetDeviceInfo (SIDeviceRefNum&, _"ssiz" , @ sampleSize)
END FN = sampleSize

'---------------------------------------

CLEAR LOCAL
LOCAL FN SetNumChannels(SIDeviceRefNum&, numChannels)
  err = FN SPBSetDeviceInfo (SIDeviceRefNum&, _"chan" , @ numChannels)
  err = FN SPBGetDeviceInfo (SIDeviceRefNum&, _"chan" , @ numChannels)
END FN = numChannels

'---------------------------------------
Bill Sanford