Fix a case where someone's audio could be missing if the audio track

arrived late
This commit is contained in:
Robin Townsend 2022-08-12 14:17:09 -04:00
parent 51ae1c819a
commit 88cffdb70e

View file

@ -213,12 +213,7 @@ export const useSpatialMediaStream = (
const sourceRef = useRef<MediaStreamAudioSourceNode>();
useEffect(() => {
if (
spatialAudio &&
tileRef.current &&
!mute &&
stream.getAudioTracks().length > 0
) {
if (spatialAudio && tileRef.current && !mute) {
if (!pannerNodeRef.current) {
pannerNodeRef.current = new PannerNode(audioContext, {
panningModel: "HRTF",