Web Audio API | AudioContext outputLatency property

The AudioContext interface has a outputLatency property which provides an approximation of the latency in output of the current audio context. This time is between the browser requesting to the host system to start a buffer and the time at which the first sample in the buffer is actually processed by the audio output device.

Syntax:

var latency = audioCtx.outputLatency;

Return Value:

A double value is returned in seconds

Example 1:

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html>
  
<head>
    <title>
        AudioContext outputLatency property
    </title>
</head>
  
<body>
    <center>
        <h1 style="color:green">
        GeeksforGeeks
        </h1>
        <h2>AudioContext outputLatency property</h2>
        <script>
            const audioCtx = new AudioContext();
            console.log(audioCtx.outputLatency);
        </script>
    </center>
</body>
  
</html>

chevron_right


Output:

undefined

Supported Browsers:

    None


My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

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.




Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.