The HTML DOM Audio pause() Method is used to pause the currently playing audio. To use the audio pause() method, one must use the controls property to display the audio controls such as play, pause, volume, etc, attached on the audio. The audio pause() method does not accept any parameters and does not return any values.
Syntax:
audio.pause()
Parameters: This method does not accepts any parameters.
Return Value: This method does not return any value.
Example: Below example illustrates the use of Audio pause() Method.
<!DOCTYPE html> <html> <head> <title> Audio paused method </title> </head> <body style="text-align: center"> <h1 style="color: green"> GeeksforGeeks </h1> <h2>HTML DOM Audio pause() Method</h2> <br> <audio id="Test_Audio" controls> <source src= type="audio/mpeg"> </audio> <br><br> <button ondblclick="play()" type="button"> play Audio </button> <button ondblclick="pause()" type="button"> pause Audio </button> <p id="test"></p> <script> var gfg = document.getElementById("Test_Audio"); function play() { gfg.play(); } function pause() { gfg.pause(); } </script> </body> </html> |
Output:

Supported Browsers: The browser supported by HTML DOM audio paused() method are listed below:
- Google Chrome
- Internet Explorer 9.0
- Firefox
- Apple Safari
- Opera
Recommended Posts:
- HTML | Audio/Video DOM pause Event
- HTML | DOM Video pause( ) Method
- Node.js | Stream readable.pause() Method
- p5.js | pause() Function
- How to play/pause video using jQuery ?
- Node.js | Readable Stream pause Event
- CSS pause-before Property
- CSS pause-after Property
- CSS pause Property
- HTML Audio/Video DOM addTextTrack() Method
- HTML | DOM Audio play() Method
- HTML | DOM Audio canPlayType() Method
- HTML | DOM Audio load() Method
- HTML | DOM Audio preload Property
- HTML | DOM Audio readyState Property
- HTML | DOM Audio Object
- HTML | DOM Audio/Video Complete Reference
- HTML | DOM Audio audioTracks Property
- HTML | DOM Audio autoplay Property
- HTML | DOM Audio buffered Property
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


