three.js: Control gui or play sound
2021-03-05 03:28
阅读:658
YPE html>
标签:download xhr mes sse rac 监听 date -- 声音
Control gui
// const listener = new THREE.AudioListener(); const audio = new THREE.Audio( listener ); const file = ‘./sounds/376737_Skullbeatz___Bad_Cat_Maste.mp3‘; if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) { const loader = new THREE.AudioLoader(); loader.load( file, function ( buffer ) { audio.setBuffer( buffer ); audio.play(); } ); } else { const mediaElement = new Audio( file ); mediaElement.play(); audio.setMediaElementSource( mediaElement ); } analyser = new THREE.AudioAnalyser( audio, fftSize ); // const format = ( renderer.capabilities.isWebGL2 ) ? THREE.RedFormat : THREE.LuminanceFormat; uniforms = { tAudioData: { value: new THREE.DataTexture( analyser.data, fftSize / 2, 1, format ) } };
three.js: Control gui or play sound
标签:download xhr mes sse rac 监听 date -- 声音
原文地址:https://www.cnblogs.com/geovindu/p/14479229.html
上一篇:给你一个网站,你如何测试?
文章来自:搜素材网的编程语言模块,转载请注明文章出处。
文章标题:three.js: Control gui or play sound
文章链接:http://soscw.com/index.php/essay/60269.html
文章标题:three.js: Control gui or play sound
文章链接:http://soscw.com/index.php/essay/60269.html
评论
亲,登录后才可以留言!