Partager via


IMDSPDeviceControl::Play

banner art

The Play method begins playing at the current seek position. If the IMDSPDeviceControl::Seek method has not been called, then playing begins at the beginning of the first file, and the play length is not defined.

Syntax

HRESULT Play();

Parameters

This method takes no parameters.

Return Values

The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.

Return code Description
S_OK The method succeeded.
E_BUSY The device is busy.
WMDM_E_NOTSUPPORTED The play function is not implemented on this device.
E_FAIL An unspecified error occurred.

Remarks

This method is used to invoke both device playback (playback of an audio track on a storage medium of the media device) and streaming audio playback (streaming audio data from the user's computer to the media device, where it is played). The IMDSPDeviceControl::Seek method determines the form of playback that occurs.

Some devices do not support either device playback or streaming audio playback. Before attempting to start playback of a particular type, the IMDSPDeviceControl::GetCapabilities method must be called. If unsupported playback is attempted, this method returns WMDM_E_NOTSUPPORTED.

To determine whether an audio format can be played by the media device before invoking the play operation, you can call the IMDSPDevice::GetFormatSupport method.

Requirements

Header: Defined in wmsp.idl.

Library: mssachlp.lib

See Also