Currently working on a small music visualizer project using WebGL and Three.js with the help of the ThreeAudio.js library. Everything seems to be running smoothly, but I've encountered an error that I'm keen on resolving:
"Uncaught Type Error: Type error"
This error seems to originate from my animate function, leading to the render function, then to the three.js render function, followed by something called "l", renderBuffer, and finally "z".
Here is my animate function:
function animate() {
requestAnimationFrame( animate );
audioTextures.update();
stats.update();
render();
}
And here is my render function:
function render(){
renderer.render( scene, camera );
}
I suspect the issue lies with the mesh I am creating, as commenting out the code to add it to the scene resolves the error.
Below is the code for the animated sphere:
audioSource = (new ThreeAudio.Source()).load('https://api.soundcloud.com/tracks/125098652/stream?client_id=MYCLIENTID').play();
audioTextures = new ThreeAudio.Textures(renderer, audioSource);
audioMaterial = new ThreeAudio.Material(audioTextures, vertexShader, fragmentShader);
audioMesh = new THREE.Mesh(geometry, audioMaterial);
scene.add(audioMesh);
The ThreeAudio library can be found on GitHub here: https://github.com/unconed/ThreeAudio.js Please advise if sharing my shaders would be beneficial.
If anyone has encountered this error and knows how to tackle it, your insights would be greatly appreciated. Thank you.