Inside Macintosh: Sound Manager

| Previous | Chapter contents | Chapter top | Section top | Next |

Legacy Documentclose button

Important: Sound Input Manager is deprecated as of Mac OS X v10.5. For new audio development in Mac OS X, use Core Audio. See the Audio page in the ADC Reference Library.

Responding to Read Requests

When a sound input device receives a Read request, it must start recording and saving recorded data into the buffer specified by the ioBuffer field of the request parameter block. If that field is NIL , the driver should record but not save the data. During a Read request, your sound input device driver can access the sound parameter block that initiated recording through the ioMisc field of the request parameter block.

If a previous Control request has assigned a sound input interrupt routine to the device driver and your driver records asynchronously, then the driver must call the routine each time its internal buffer becomes filled, setting up registers as described in "Defining a Sound Input Interrupt Routine" . The buffer size that your device driver specifies in the D1 register should indicate how much your device records during every interrupt. For example, a sound input device driver that uses the serial port might use a buffer as small as 3 bytes. For the built-in sound input port on the Macintosh LC and other Macintosh models, the buffer is 512 bytes long.

Your device driver should update the ioActCount field of the request parameter block with the actual number of bytes of sampled-sound data recorded. This allows the Sound Input Manager to monitor the activity of your device driver. Whether your device driver operates synchronously or asynchronously, it should complete recording by jumping to the Device Manager's IODone function via the global jump vector JIODone . You need to set the D0 register to the appropriate result code before jumping to the Device Manager's IODone function.


© 1999 Apple Computer, Inc.

Inside Macintosh: Sound Manager

| Previous | Chapter contents | Chapter top | Section top | Next |

Legacy Documentclose button

Important: Sound Input Manager is deprecated as of Mac OS X v10.5. For new audio development in Mac OS X, use Core Audio. See the Audio page in the ADC Reference Library.