Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HIFI-683 - setting the volumeThreshold to null makes the client use the space default volumeThreshold. #172

Merged
merged 2 commits into from
Aug 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/classes/HiFiCommunicator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -966,7 +966,7 @@ export class HiFiCommunicator {
* @param position - The new position of the user.
* @param orientationQuat - The new orientationQuat of the user.
* @param orientationEuler - The new orientationEuler of the user.
* @param volumeThreshold - The new volumeThreshold of the user.
* @param volumeThreshold - The new volumeThreshold of the user. Setting this to null will use the space default volume threshold.
* @param hiFiGain - This value affects how loud User A will sound to User B at a given distance in 3D space.
* This value also affects the distance at which User A can be heard in 3D space.
* Higher values for User A means that User A will sound louder to other users around User A, and it also means that User A will be audible from a greater distance.
Expand Down Expand Up @@ -1003,7 +1003,8 @@ export class HiFiCommunicator {
this._currentHiFiAudioAPIData.orientationQuat = eulerToQuaternion(checkedEuler, ourHiFiAxisConfiguration.eulerOrder);
}

if (typeof (volumeThreshold) === "number") {
if (typeof (volumeThreshold) === "number" ||
volumeThreshold === null) {
this._currentHiFiAudioAPIData.volumeThreshold = volumeThreshold;
}
if (typeof (hiFiGain) === "number") {
Expand Down Expand Up @@ -1058,7 +1059,8 @@ export class HiFiCommunicator {
this._lastTransmittedHiFiAudioAPIData.orientationQuat.z = dataJustTransmitted.orientationQuat.z ?? this._lastTransmittedHiFiAudioAPIData.orientationQuat.z;
}

if (typeof (dataJustTransmitted.volumeThreshold) === "number") {
if (typeof (dataJustTransmitted.volumeThreshold) === "number" ||
dataJustTransmitted.volumeThreshold === null) {
this._lastTransmittedHiFiAudioAPIData["volumeThreshold"] = dataJustTransmitted.volumeThreshold;
}

Expand Down
3 changes: 2 additions & 1 deletion src/classes/HiFiMixerSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1179,7 +1179,8 @@ export class HiFiMixerSession {
}
}

if (typeof (currentHifiAudioAPIData.volumeThreshold) === "number") {
if (typeof (currentHifiAudioAPIData.volumeThreshold) === "number" ||
currentHifiAudioAPIData.volumeThreshold === null) {
dataForMixer["T"] = currentHifiAudioAPIData.volumeThreshold;
}

Expand Down