Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Audio playbackRate attribute

Audio playbackRate attribute

Audio Object Reference Audio object

Example

Set the audio to play at a slow speed:

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

Try it »


Definition and Usage

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


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the playbackRate attribute.

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


Syntax

Return the playbackRate attribute:

audioObject

.playbackRate

Set the playbackRate attribute:

audioObject

.playbackRate=

playbackspeed

Attribute 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: Numeric value representing the current playback speed of the audio.
    Default value 1.0

    More examples

    Example

    Set the audio to play fast:

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

    Try it »


    Audio Object Reference Audio object