siriwave模仿siri从麦克风获取声音并波动震动效果代码
代码语言:html
所属分类:多媒体
代码描述:siriwave模仿siri从麦克风获取声音并波动震动效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!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> <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: true }); function getAverageVolume(data) { var values = 0; var length = data.length; for (var i = 0; i < data.length; i++) { values += data[i]; } return values / data.length; } window.navigator.getUserMedia( { audio: true }, fun.........完整代码请登录后点击上方下载按钮下载查看
网友评论0