Platform SDK: DirectX |
The IDirectMusicPort::GetFormat method retrieves information about the wave format specified in the DMUS_PORTPARAMS structure passed to IDirectMusic::CreatePort, and the recommended size of the buffer to use for wave output. The information can be used to create a compatible IDirectSoundBuffer for the port.
HRESULT GetFormat( LPWAVEFORMATEX pWaveFormatEx, LPDWORD pdwWaveFormatExSize LPDWORD pdwBufferSize );
Return values are determined by the implementation. If the method succeeds, it returns S_OK.
If it fails, the method can return E_POINTER.
The WAVEFORMATEX structure can have a variable length that depends on the details of the format. Before retrieving the format description, the application should query the synthesizer object for the size of the format by calling this method and specifying NULL for the pWaveFormatEx parameter. The size of the structure is returned in the variable pointed to by pdwWaveFormatExSize. The application can then allocate sufficient memory and call GetFormat again to retrieve the format description.
If pWaveFormatEx is not NULL, DirectMusic writes, at most, pdwWaveFormatExSize bytes to the structure.
Windows NT/2000: Requires Windows 2000.
Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
Header: Declared in dmusicc.h.