I am trying to do some positional audio using the Web Audio API. I have been working in Chrome and my code functions perfectly. However, when testing in firefox, I am getting errors because the listener doesn’t seem to have any of the correct properties (positionX etc.)
Focussing on these two lines of code:
var context = this.app.systems.sound.context;
var listener = context.listener;
When inspecting the listener in Chrome, it looks like this:
But in Firefox, it looks like this:
So when later on I am using code like this:
var listener = this.context.listener;
var pos = this.camera.getPosition();
listener.positionX.value = pos.x;
listener.positionY.value = pos.y;
listener.positionZ.value = pos.z;
It runs fine in Chrome, but errors in Firefox.
Does anyone know why this would be happening?