MCPcopy Create free account
hub / github.com/ValveSoftware/steam-audio / apply

Method apply

core/src/core/ambisonics_decode_effect.cpp:69–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67}
68
69AudioEffectState AmbisonicsDecodeEffect::apply(const AmbisonicsDecodeEffectParams& params,
70 const AudioBuffer& in,
71 AudioBuffer& out)
72{
73 AmbisonicsRotateEffectParams rotateParams{};
74 rotateParams.orientation = params.orientation;
75 rotateParams.order = params.order;
76
77 mRotateEffect->apply(rotateParams, in, mRotated);
78
79 auto binaural = (params.binaural && mSpeakerLayout.type == SpeakerLayoutType::Stereo && params.hrtf && mBinauralEffect);
80
81 if (binaural && !mPrevBinaural)
82 {
83 mPanningEffect->reset();
84 }
85 else if (!binaural && mPrevBinaural && mBinauralEffect)
86 {
87 mBinauralEffect->reset();
88 }
89
90 AudioEffectState effectState = AudioEffectState::TailComplete;
91
92 if (binaural)
93 {
94 AmbisonicsBinauralEffectParams binauralParams{};
95 binauralParams.hrtf = params.hrtf;
96 binauralParams.order = params.order;
97
98 effectState = mBinauralEffect->apply(binauralParams, mRotated, out);
99 }
100 else
101 {
102 AmbisonicsPanningEffectParams panningParams{};
103 panningParams.order = params.order;
104
105 effectState = mPanningEffect->apply(panningParams, mRotated, out);
106 }
107
108 mPrevBinaural = binaural;
109
110 return effectState;
111}
112
113AudioEffectState AmbisonicsDecodeEffect::tail(AudioBuffer& out)
114{

Callers

nothing calls this directly

Calls 1

resetMethod · 0.45

Tested by

no test coverage detected