Skip to content

Commit

Permalink
Examples: Clean up. (#29972)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mugen87 authored Nov 26, 2024
1 parent 4d476ff commit 66bba62
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions examples/webgpu_compute_audio.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
const analyserBuffer = new Uint8Array( 1024 );
let analyserTexture;

init();
const startButton = document.getElementById( 'startButton' );
startButton.addEventListener( 'click', init );

async function playAudioBuffer() {

Expand Down Expand Up @@ -79,6 +80,9 @@

async function init() {

const overlay = document.getElementById( 'overlay' );
overlay.remove();

// audio buffer

const soundBuffer = await fetch( 'sounds/webgpu-audio-processing.mp3' ).then( res => res.arrayBuffer() );
Expand All @@ -104,7 +108,7 @@
// The Pixel Buffer Object (PBO) is required to get the GPU computed data to the CPU in the WebGL2 fallback.
// As used in `renderer.getArrayBufferAsync( waveArray.value )`.

waveNode.setPBO( true );
// waveNode.setPBO( true );

// params

Expand Down Expand Up @@ -192,15 +196,7 @@

window.addEventListener( 'resize', onWindowResize );


document.onclick = () => {

const overlay = document.getElementById( 'overlay' );
if ( overlay !== null ) overlay.remove();

playAudioBuffer();

};
playAudioBuffer();

}

Expand Down

0 comments on commit 66bba62

Please sign in to comment.