HTML | Propiedad AudioContext baseLatency

Requisito previo: propiedad AudioContext outputLatency

La propiedad de solo lectura baseLatency en la interfaz de AudioContext se usa para representar la cantidad de segundos de latencia de procesamiento en que incurre el AudioContext al pasar un búfer de audio desde AudioDestinationNode.

Sintaxis:

var Latency = audioCtx.baseLatency;

Valor devuelto:

A double value is returned in seconds.

Ejemplo 1:

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

Producción:

Ejemplo 2:

<!DOCTYPE html> 
<html> 
<head> 
    <title> 
        AudioContext baseLatency property 
    </title> 
</head> 
    
<body style="text-align:center;">
    <center> 
        <h1 style="color:green"> 
        GeeksforGeeks 
        </h1> 
        <h2>AudioContext baseLatency property</h2> 
        <script> 
        const laten2 = new AudioContext({ latencyHint: 'playback' });
        console.log(laten2.baseLatency);
        </script> 
    </center> 
</body> 
    
</html> 

Producción:

Navegadores compatibles: los navegadores compatibles con la propiedad HTML AudioContext baseLatency se enumeran a continuación:

  • Google Chrome
  • Borde
  • Firefox
  • Ópera

Publicación traducida automáticamente

Artículo escrito por SHUBHAMSINGH10 y traducido por Barcelona Geeks. The original can be accessed here. Licence: CCBY-SA

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *