Just chucking up a random gist to document that if you're trying to create a positional audio
in threejs via a stream that's passed in remotely (i.e. not initiated within the current browser)
then you will need to create a new Audio (not threejs Audio, the native browser Audio) object and set the srcObject
to the stream.
I suspect this activates the stream. Whereas a locally initiated stream is already active, hence why some of the examples I
found demo'ing setMediaStreamSource
worked, because the stream was local.
So here's my code to demonstrate this.
const audioObj = new Audio()
audioObj.srcObject = stream
const audio = new PositionalAudio(listener)
audio.setMediaStreamSource(stream)
Hope that this might be of help.
Some additional key phrases for anyone googling:ThreeJS positional audio stream not working
ThreeJS setMediaStreamSource stream not working