先決條件:AudioContext outputLatency屬性
AudioContext接口中的baseLatency隻讀屬性用於表示AudioContext從AudioDestinationNode傳遞音頻緩衝區所引起的處理延遲的秒數
用法:
var Latency = audioCtx.baseLatency;
返回值:
A double value is returned in seconds.
範例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>
輸出:
範例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>
輸出:
支持的瀏覽器:下麵列出了HTML AudioContext baseLatency屬性支持的瀏覽器:
- 穀歌瀏覽器
- Edge
- Firefox
- Opera
相關用法
- HTML DOM value用法及代碼示例
- HTML DOM URL用法及代碼示例
- HTML Bdo dir用法及代碼示例
- HTML li value用法及代碼示例
- HTML DOM name用法及代碼示例
- HTML Map name用法及代碼示例
- HTML DOM specified用法及代碼示例
- HTML DOM dir用法及代碼示例
- HTML DOM id用法及代碼示例
- HTML Style right用法及代碼示例
- HTML DOM firstChild用法及代碼示例
- HTML DOM innerText用法及代碼示例
- HTML DOM childElementCount用法及代碼示例
- HTML DOM parentElement用法及代碼示例
- HTML ins cite用法及代碼示例
- HTML DOM nextElementSibling用法及代碼示例
- HTML IFrame name用法及代碼示例
- HTML DOM isContentEditable用法及代碼示例
- HTML DOM doctype用法及代碼示例
注:本文由純淨天空篩選整理自SHUBHAMSINGH10大神的英文原創作品 HTML | AudioContext baseLatency property。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。