Wwise SDK 2022.1.7
_ak_reverb_estimation_8h_source
Version
menu_open
link
Wwise SDK 2022.1.7
|
AkReverbEstimation.h
Go to the documentation of this file.
44 /// These functions can be used to estimate the reverb parameters of a physical environment, using its volume and surface area
47 /// This is used to estimate the line of best fit through the absorption values of an Acoustic Texture.
57 float meanY = (texture.fAbsorptionLow + texture.fAbsorptionMidLow + texture.fAbsorptionMidHigh + texture.fAbsorptionHigh) / (float)N;
58 float absorptions[4] = { texture.fAbsorptionLow, texture.fAbsorptionMidLow, texture.fAbsorptionMidHigh, texture.fAbsorptionHigh };
75 /// Calculate average absorption values using each of the textures in in_textures, weighted by their corresponding surface area.
76 void GetAverageAbsorptionValues(AkAcousticTexture* in_textures, float* in_surfaceAreas, int in_numTextures, AkAcousticTexture& out_average)
103 /// Estimate the time taken (in seconds) for the sound reverberation in a physical environment to decay by 60 dB.
104 /// This is estimated using the Sabine equation. The T60 decay time can be used to drive the decay parameter of a reverb effect.
106 AkReal32 in_volumeCubicMeters, ///< The volume (in cubic meters) of the physical environment. 0 volume or negative volume will give a decay estimate of 0.
107 AkReal32 in_surfaceAreaSquaredMeters, ///< The surface area (in squared meters) of the physical environment. Must be >= AK_SA_MIN_ENVIRONMENT_SURFACE_AREA
108 AkReal32 in_environmentAverageAbsorption, ///< The average absorption amount of the surfaces in the environment. Must be between AK_SA_MIN_ENVIRONMENT_ABSORPTION and 1.
109 AkReal32& out_decayEstimate ///< Returns the time taken (in seconds) for the reverberation to decay bu 60 dB.
119 AKASSERT(false && "AK::SpatialAudio::ReverbEstimation::EstimateT60Decay: Invalid surface area. in_SurfaceAreaSquaredMeters Must be >= AK_SA_MIN_ENVIRONMENT_SURFACE_AREA");
122 if (in_environmentAverageAbsorption < AK_SA_MIN_ENVIRONMENT_ABSORPTION || in_environmentAverageAbsorption > 1.0f)
124 AKASSERT(false && "AK::SpatialAudio::ReverbEstimation::EstimateT60Decay: Invalid absorption value. in_EnvironmentAverageAbsorption Must be between AK_SA_MIN_ENVIRONMENT_ABSORPTION and 1");
128 out_decayEstimate = (0.161f * in_volumeCubicMeters) / (in_surfaceAreaSquaredMeters * in_environmentAverageAbsorption);
135 AkVector in_environmentExtentMeters, ///< Defines the dimensions of the environment (in meters) relative to the center; all components must be positive numbers.
136 AkReal32& out_timeToFirstReflectionMs, ///< Returns the time taken (in milliseconds) for the first reflection to reach the listener.
137 AkReal32 in_speedOfSound = 343.0f ///< Defaults to 343.0 - the speed of sound in dry air. Must be > 0.
142 AKASSERT(false && "AK::SpatialAudio::ReverbEstimation::EstimateTimeToFirstReflection: Invalid speed of sound. in_speedOfSound must be greater than 0.");
145 if (in_environmentExtentMeters.X < 0.0f || in_environmentExtentMeters.Y < 0.0f || in_environmentExtentMeters.Z < 0.0f)
147 AKASSERT(false && "AK::SpatialAudio::ReverbEstimation::EstimateTimeToFirstReflection: Invalid extent. All components must be positive numbers.");
150 const float minDimension = AkMin(AkMin(in_environmentExtentMeters.X, in_environmentExtentMeters.Y), in_environmentExtentMeters.Z);
155 /// Estimate the high frequency damping from a collection of AkAcousticTextures and corresponding surface areas.
156 /// The high frequency damping is a measure of how much high frequencies are dampened compared to low frequencies. > 0 indicates more high frequency damping than low frequency damping. < 0 indicates more low frequency damping than high frequency damping. 0 indicates uniform damping.
157 /// The average absorption values are calculated using each of the textures in the collection, weighted by their corresponding surface area.
158 /// The HFDamping is then calculated as the line-of-best-fit through the average absorption values.
160 AkAcousticTexture* in_textures, ///< A collection of AkAcousticTexture structs from which to calculate the average high frequency damping.
162 int in_numTextures, ///< The number of textures in in_textures (and the number of surface area values in in_surfaceAreas).
163 AkReal32& out_hfDamping ///< Returns the high frequency damping value. > 0 indicates more high frequency damping than low frequency damping. < 0 indicates more low frequency damping than high frequency damping. 0 indicates uniform damping.
172 GetAverageAbsorptionValues(in_textures, in_surfaceAreas, in_numTextures, averageAbsorptionValues);
AKSOUNDENGINE_API AKRESULT EstimateHFDamping(AkAcousticTexture *in_textures, float *in_surfaceAreas, int in_numTextures, AkReal32 &out_hfDamping)
Definition: AkReverbEstimation.h:159
Definition: AkVirtualAcoustics.h:33
AkReal32 fAbsorptionMidHigh
Definition: AkVirtualAcoustics.h:68
AKSOUNDENGINE_API AKRESULT EstimateT60Decay(AkReal32 in_volumeCubicMeters, AkReal32 in_surfaceAreaSquaredMeters, AkReal32 in_environmentAverageAbsorption, AkReal32 &out_decayEstimate)
Definition: AkReverbEstimation.h:105
AKSOUNDENGINE_API AKRESULT EstimateTimeToFirstReflection(AkVector in_environmentExtentMeters, AkReal32 &out_timeToFirstReflectionMs, AkReal32 in_speedOfSound=343.0f)
Definition: AkReverbEstimation.h:134
#define AK_SA_MIN_ENVIRONMENT_SURFACE_AREA
Definition: AkSpatialAudioTypes.h:50
float CalculateSlope(const AkAcousticTexture &texture)
Definition: AkReverbEstimation.h:50
void GetAverageAbsorptionValues(AkAcousticTexture *in_textures, float *in_surfaceAreas, int in_numTextures, AkAcousticTexture &out_average)
Calculate average absorption values using each of the textures in in_textures, weighted by their corr...
Definition: AkReverbEstimation.h:76
3D vector for some operations in 3D space. Typically intended only for localized calculations due to ...
Definition: AkTypes.h:425
Was this page helpful?
Need Support?
Questions? Problems? Need more info? Contact us, and we can help!
Visit our Support pageTell us about your project. We're here to help.
Register your project and we'll help you get started with no strings attached!
Get started with Wwise