请问js如何抑制清除从麦克风捕获的声音产生的回音?
网友回复
可以在获取的时候将echoCancellation设为true
navigator.mediaDevices.getUserMedia({ audio: { echoCancellation: true } })
.then(stream => audio.srcObject = stream)
.catch(e => log(e));
完整代码:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<style>
body {
background: #000;
}
</style>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/siriwave.umd.js"></script>
<body>
不要在iframe中打开
<div id="container" style="width: 900px; height: 300px; background: #000"></div>
<script>
var SW = new SiriWave({
style: 'ios9',
speed: 0.1,
amplitude: 0.2,
speedInterpolationSpeed: 0,
frequency: 2,
height: 424,
width: 964,
container: document.getElementById('container'),
autostart: tr...点击查看剩余70%


