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

Method apply

core/src/core/api_ambisonics_decode_effect.cpp:105–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103}
104
105IPLAudioEffectState CAmbisonicsDecodeEffect::apply(IPLAmbisonicsDecodeEffectParams* params,
106 IPLAudioBuffer* in,
107 IPLAudioBuffer* out)
108{
109 auto _effect = mHandle.get();
110 if (!_effect)
111 return IPL_AUDIOEFFECTSTATE_TAILCOMPLETE;
112
113 auto _hrtf = (params->hrtf) ? reinterpret_cast<CHRTF*>(params->hrtf)->mHandle.get() : nullptr;
114 if (params->binaural && !_hrtf)
115 return IPL_AUDIOEFFECTSTATE_TAILCOMPLETE;
116
117 AudioBuffer _in(in->numChannels, in->numSamples, in->data);
118 AudioBuffer _out(out->numChannels, out->numSamples, out->data);
119
120 AmbisonicsDecodeEffectParams _params{};
121 _params.order = params->order;
122 _params.orientation = reinterpret_cast<const CoordinateSpace3f*>(&params->orientation);
123 _params.binaural = (params->binaural == IPL_TRUE);
124 _params.hrtf = _hrtf.get();
125
126 return static_cast<IPLAudioEffectState>(_effect->apply(_params, _in, _out));
127}
128
129
130// --------------------------------------------------------------------------------------------------------------------

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected