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

Add support for nested AudioMixers #4915

Open
wants to merge 36 commits into
base: master
Choose a base branch
from
Open

Conversation

nekodex
Copy link
Contributor

@nekodex nekodex commented Nov 26, 2021

This functionality is a pre-requisite for applying processing to groupings of audio channels in Lazer, and affords the ability to chain mixers with different processing/effects.

Utilising this capability, a GlobalMixer has been added (which TrackMixer and SampleMixer are now routed into). This will allow for monitoring of the final summed audio output and for any final audio processing to happen just prior to output.

Copy link
Collaborator

@bdach bdach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aside from the CI failure:

osu.Framework/Audio/Mixing/IAudioMixer.cs Outdated Show resolved Hide resolved
osu.Framework/Audio/Mixing/AudioMixer.cs Outdated Show resolved Hide resolved
osu.Framework/Audio/Mixing/Bass/BassAudioMixer.cs Outdated Show resolved Hide resolved
osu.Framework/Audio/AudioManager.cs Outdated Show resolved Hide resolved
Copy link
Member

@peppy peppy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few things I noticed from the diff of new changes.

@@ -96,9 +79,13 @@ protected void Remove(IAudioChannel channel, bool moveToParent)

#region IAudioChannel

public AudioMixer? Mixer { get; }
public virtual AudioMixer? Mixer { get; set; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see that this naming is used to match the IAudioChannel interface, but mixer.Mixer = parent reads pretty weird.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean the part where it's named Mixer? If so, I tend to agree but not sure of a better name... OutputTarget maybe? but then if it's of type AudioMixer, that's also weird, so...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. Not sure on a solution yet.

Copy link
Member

@frenzibyte frenzibyte Dec 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about calling it Parent/ParentMixer and explicitly implement IAudioChannel.Mixer to it:

public AudioMixer? Parent { get; set; }

AudioMixer? IAudioChannel.Mixer => Parent;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was going to suggest that but for some reason I thought it wouldn't work. I think it's an amicable solution.

osu.Framework/Audio/Mixing/AudioMixer.cs Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants