## MMPM/2 Device Driver Reference

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

### VSD_SETDATATYPE - Example Code

The following code illustrates how to set the data type, sampling rate, channels, and bits per sample for an audio VSD.

    HVSD                     hvsd;

    VSD_AUDIODATATYPE_PARMS  AudioDatatype;

    PMMAUDIOHEADER           pmmaudioheader;

    AudioDatatype.ulDataType = pmmaudioheader->mmXWAVHeader.WAVEHeader.usFormatTag;

    AudioDatatype.ulBitsPerSample = pmmaudioheader->mmXWAVHeader.WAVEHeader.usBitsPerSample;

    AudioDatatype.ulSamplingRate = pmmaudioheader->mmXWAVHeader.WAVEHeader.usSamplesPerSec;

    AudioDatatype.ulChannels = pmmaudioheader->mmXWAVHeader.WAVEHeader.usChannels;

    AudioDatatype.ulOperation = VSD_PLAY;

    AudioDatatype.ulFlags = VSD_MODE|VSD_CHANNELS|VSD_SAMPLESPERSEC|

                            VSD_OPERATION|VSD_BITSPERSAMPLE;

       rc = pInstance->pfnNewVSD(hvsd,

                                 VSD_SET,

                                 VSD_SETDATATYPE,

                        (PVOID)&AudioDatatype);

       if(rc)

         {

         return(rc)

         }