Audio playbackRateProperty

Audio 对象参考手册Audio Object

Example

Set audio to play at a slow speed:

document.getElementById("myAudio").playbackRate = 0.5;

Try it Yourself »

Definition and Usage

The playbackRate property sets or returns the current playback speed of the audio.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the playbackRate property.

Note:Internet Explorer 9 and earlier IE versions do not support the playbackRate property.


Syntax

Return the playbackRate property:

audioObject.playbackRate

Set the playbackRate property:

audioObject.playbackRate=playbackspeed

Property Values

Value Description
playbackspeed

Indicates the current playback speed of the audio.

Example values:

  • 1.0 Normal speed
  • 0.5 Half speed (slower)
  • 2.0 Double speed (faster)
  • -1.0 Backward, normal speed
  • -0.5 Backward, half speed

Technical Details

Return value: A numeric value representing the current playback speed of the audio.
Default value 1.0


More Examples

Example

Set audio to play fast:

document.getElementById("myaudio").playbackRate = 2;

Try it Yourself »


Audio 对象参考手册Audio Object Other Extensions