次の方法で共有


IWMPSettings::put_rate method (wmp.h)

[The feature associated with this page, Windows Media Player SDK, is a legacy feature. It has been superseded by MediaPlayer. MediaPlayer has been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer instead of Windows Media Player SDK, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

The put_rate method specifies the current playback rate for video.

Syntax

HRESULT put_rate(
  [in] double dRate
);

Parameters

[in] dRate

double containing the rate with a default value of 1.0.

Return value

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.

Remarks

The value retrieved by this method acts as a multiplier value that enables you to play a media item at a faster or slower rate. The default value of 1.0 indicates the authored speed.

Note that an audio track becomes difficult to understand at rates lower than 0.5 or higher than 1.5. A playback rate of 2 equates to twice the normal playback speed.

Windows Media Player will attempt to use the most effective of the following four different playback modes

  • Smooth video playback with audio pitch maintained
  • Smooth video playback with audio pitch not maintained
  • Smooth video playback with no audio
  • Keyframe video playback with no audio
The mode chosen by Windows Media Player depends on numerous factors including file type and location, operating system, network, and server.

Other considerations apply as well, depending on the digital media format used to create the content:

  • Windows Media Video (WMV) and ASF. Optimal values for this property are from 1 to 10, or from –1 to –10 for reverse play. Values from 0.5 to 1.0 or from -0.5 to -1.0 may also work well in cases where audio pitch can be maintained, such as when playing files located on the local computer. Values with an absolute magnitude greater than 10 are allowed, but are not very meaningful.
  • Other video formats. This property can range from 0 to 9. Negative values are not allowed. Values less than 1 represent slow motion. Values above 9 are allowed, but are not very meaningful.
The IWMPControls::fastForward method changes the value retrieved by get_rate to 5.0, while the IWMPControls::fastReverse method changes the value retrieved by get_rate to –5.0.

The playback rate of some digital media formats cannot be altered. Use the IWMPSettings::get_isAvailable method to determine whether this property can be specified for a particular media item.

Windows Media Player 10 Mobile: This method only accepts a long set to -5.0, 1.0, or 5.0. Otherwise, E_INVALIDARG is returned.

Requirements

Requirement Value
Minimum supported client Windows Media Player 9 Series or later.
Target Platform Windows
Header wmp.h
DLL Wmp.dll

See also

IWMPControls::fastForward

IWMPControls::fastReverse

IWMPSettings Interface

IWMPSettings::get_isAvailable

IWMPSettings::get_rate

IWMPSettings::put_mute