-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Remove audio-params component #4562
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is a work-in-progress commit. Hubs "works", but some things need to be fixed or cleaned up: - Gain is not properly applied. This will happen in a followup commit. - The audio params component keeps a separate copy of the "source type" state. - Audio Zones need to be tested. - The audio settings system should loop over all audios when the settings change. (Perhaps this system can just go away.) - A bunch of calls to `setAttribute("audio-params", { ... })` should eventually disappear, but not yet.
Some audio layers do not want to affect every possible audio parameter, so we do not require them to. - // TODO: The DEBUG PANEL only wants to set a few settings at a time - // TODO: Perhaps AUDIO ZONEs should be allowed to affect only a few settings at a time
Obviously, we are removing this component. But even if we were not, having multiple of these components on the same entity would absolutely break things.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR removes the
audio-params
aframe component and introduces a simple contract for handling audio nodes and audio settings.The contract is:
THREE.Audio
is created, we put it inAPP.audios
and we callupdateAudioSettings
.APP.sceneOverrides
,APP.zoneOverrides
, etc). When state is added or removed from these collections, we callupdateAudioSettings
.The
updateAudioSettings
function reduces over the collections to determine what the audio settings should be and then applies them. When reviewing this PR, I recommend that you start by readingupdateAudioSettings
: https://github.com/mozilla/hubs/blob/audio-refactor-v1/src/update-audio-settings.jsThis fixes a few problems:
gain
of an audio node. Then, the user might dismiss a linked copy of that node (vialinked-media
) and reset thegain
to 0.5. The effect from the zone is overwritten (which is not desired). This type of problem is repeated at every "layer".audio-params
component. This meant we had a bunch of book-keeping code to keep data in sync. There were subtle bugs in that book-keeping code that meant the two diverged. This is fixed by getting rid of the indirection and second copies of the "same" data.PositionalAudio
to a regularAudio
). Although the code paths that handle this kind of replacement need further investigation, it is easy to tell what should happen in these cases: The node should be replaced and the associated settings should be applied to the new node.The
AudioNormalization
code is no longer being used and should be re-introduced in a followup PR.┆Issue is synchronized with this Jira Task