HRESULT SetFormat(LPWAVEFORMATEX lpfxFormat);
Sets the format of the primary sound buffer for the application. Whenever this application has the input focus, DirectSound will set the primary buffer to the specified format.
·Returns DS_OK if successful, or one of the following error values otherwise:
DSERR_BADFORMAT | DSERR_INVALIDCALL |
DSERR_INVALIDPARAM | DSERR_OUTOFMEMORY |
DSERR_PRIOLEVELNEEDED | DSERR_UNSUPPORTED |
lpfxFormat
Address of a WAVEFORMATEX structure that describes the new format for the primary sound buffer.
A call to this method fails if the sound buffer is playing or the hardware does not directly support the requested pulse coded modulation (PCM) format. It will also fail if the calling application has the DSSCL_NORMAL cooperative level.
If a secondary buffer requires a format change, the application should create a new DirectSoundBuffer object using the new format.
DirectSound supports PCM formats; it does not currently support compressed formats.