## MMPM/2 Device Driver Reference

[prev][next][parent][TOC]

### VSD_OPEN - Example Code

The following code illustrates how to open an audio VSD.

     VSD_OPEN_PARMS        vsdOpenParms;

     VSD_AUDIOOPEN_PARMS   vsdData;

     vsdData.ulLength = sizeof(VSD_AUDIOOPEN_PARMS);

     vsdData.ulFlags = 0;

     vsdData.ulSamplingRate       = pInstance->lSRate;

     vsdData.ulBitsPerSample      = pInstance->lBitsPerSRate;

     vsdData.ulChannels           = pInstance->sChannels;

     vsdData.ulDataType           = pInstance->sMode;

     vsdData.ulDeviceID           = pInstance->ulDeviceID;

     vsdData.ulOperation          = pInstance->ulOperation;

     vsdOpenParms.pDevInfo = (PVOID)&vsdData;

         vsdOpenParms.ulLength = sizeof(VSD_OPEN_PARMS);

         memmove(&vsdOpenParms.szPDDName,

                 pInstance->szDeviceName,

                 strlen(pInstance->szDeviceName));

           /* Open the audio VSD */

         rc = pInstance->pfnAUDIOIF(0,

                                    VSD_OPEN,

                                    0L

                                    (PVOID)&vsdOpenParms);

         if (!rc)

            }

            pInstance->hvsd = vsdOpenParms.hvsd;

            {