I did not see an example of this, is there a way to redirect the audio output from a video texture to a spatial sound object instead of it just playing omnipresent?
I believe audio textures are handled at DOM natively in not in engine, so was thinking probably not, but was not 100% sure.
I know I could fake it with a second audio only file, but I rather I did not have to given the videos will play with audio at some point when full screened, all the pieces mesh+sound file for spatial sound are already present when a video texture is applied to a mesh so seems like a logical thing to do, and doing so seems like a recipe for unsynchronized video+audio.
As you noted, the video texture is basically handing over everything to the dom sounds wise so if you find a way to link it to WebAudio, we could do it in Babylon too Let me know your findings.
It’s been put on my todo list for this project, but realistically 1-3 months before I can get to it. I will share it back when done unless someone beats me to a solution.
Here is intermediate example - https://playground.babylonjs.com/#CHQ4T#343
Audio source from video is connected to lowpass audio filter (check slider).
Now it is just a matter of some time to find the right syntax how to bind the audio to a mesh.
Hi @sebavan , curious about how I can just use the Sound element to control a Video’s sound. Right now, I’m passing in a video mediaElement into a VideoTexture, and the same mediaElement to the Sound class in hopes of controlling it fully from the Sound. I can’t avoid passing the mediaElement into the videoTexture, because that’s where the video is. But then when I set the mediaElement to unmuted, it will play from both the VideoTexture and the Sound element at once. Any ideas no how I could just control a video’s sound from an instance of the Sound class?
That shows me how to pass the video element as a source for the Sound class, but it’s not clear to me how to manipulate the sound without affecting the sound from the same media element being passed to the videotexture. @labris , thanks for the help !