112 if (in_volumeCubicMeters
114 out_decayEstimate = 0.0f;
117 if (in_surfaceAreaSquaredMeters AK_SA_MIN_ENVIRONMENT_SURFACE_AREA)
119 AKASSERT(
false &&
"AK::SpatialAudio::ReverbEstimation::EstimateT60Decay: Invalid surface area. in_SurfaceAreaSquaredMeters Must be >= AK_SA_MIN_ENVIRONMENT_SURFACE_AREA");
122 if (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,
136 AkReal32& out_timeToFirstReflectionMs,
140 if (in_speedOfSound
142 AKASSERT(
false &&
"AK::SpatialAudio::ReverbEstimation::EstimateTimeToFirstReflection: Invalid speed of sound. in_speedOfSound must be greater than 0.");
145 if (in_environmentExtentMeters.
X Y Z
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);
151 out_timeToFirstReflectionMs = (minDimension / in_speedOfSound) * 1000.0f;
162 float* in_surfaceAreas,
166 if (in_textures ==
nullptr || in_surfaceAreas ==
nullptr || in_numTextures == 0)
@ AK_Fail
The operation failed.
#define AK_EXTERNAPIFUNC(_type, _name)
AKRESULT
Standard function call result.
AKSOUNDENGINE_API AkReal32 EstimateHFDamping(AkAcousticTexture *in_textures, float *in_surfaceAreas, int in_numTextures)
AkReal32 fAbsorptionMidHigh
AKSOUNDENGINE_API AKRESULT EstimateT60Decay(AkReal32 in_volumeCubicMeters, AkReal32 in_surfaceAreaSquaredMeters, AkReal32 in_environmentAverageAbsorption, AkReal32 &out_decayEstimate)
float AkReal32
32-bit floating point
@ AK_Success
The operation was successful.
AKSOUNDENGINE_API AKRESULT EstimateTimeToFirstReflection(AkVector in_environmentExtentMeters, AkReal32 &out_timeToFirstReflectionMs, AkReal32 in_speedOfSound=343.0f)
#define AK_SA_MIN_ENVIRONMENT_SURFACE_AREA
float CalculateSlope(const AkAcousticTexture &texture)
#define AKASSERT(Condition)
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...
AkReal32 fAbsorptionMidLow
3D vector for some operations in 3D space. Typically intended only for localized calculations due to ...