Skip to content

Commit

Permalink
Check if coneOuterGain is defined before clamping its value
Browse files Browse the repository at this point in the history
  • Loading branch information
keianhzo committed Nov 23, 2023
1 parent 000ffa1 commit 982610d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/inflators/audio-params.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ export function inflateAudioParams(world: HubsWorld, eid: number, params: AudioS
addComponent(world, AudioParams, eid);

// https://developer.mozilla.org/en-US/docs/Web/API/PannerNode/coneOuterGain#value
params.coneOuterGain = params.coneOuterGain > 1 ? 1 : params.coneOuterGain;
params.coneOuterGain = params.coneOuterGain < 0 ? 0 : params.coneOuterGain;
if (params.coneOuterGain !== undefined) {
params.coneOuterGain = params.coneOuterGain > 1 ? 1 : params.coneOuterGain;
params.coneOuterGain = params.coneOuterGain < 0 ? 0 : params.coneOuterGain;
}

APP.audioOverrides.set(eid, params);
}

0 comments on commit 982610d

Please sign in to comment.