Wwise SDK
Version
menu
|
Wwise SDK 2024.1.10
|
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 };
61 for (int i = 0; i
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)
84 for (int textureIndex = 0; textureIndex
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.
112 if (in_volumeCubicMeters
119 AKASSERT(false && "AK::SpatialAudio::ReverbEstimation::EstimateT60Decay: Invalid surface area. in_SurfaceAreaSquaredMeters Must be >= AK_SA_MIN_ENVIRONMENT_SURFACE_AREA");
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);
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);
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.
157 /// The value is comprised between -1 and 1. A value > 0 indicates more high frequency damping than low frequency damping.
158 /// The average absorption values are calculated using each of the textures in the collection, weighted by their corresponding surface area.
159 /// The HFDamping is then calculated as the line-of-best-fit through the average absorption values.
171 GetAverageAbsorptionValues(in_textures, in_surfaceAreas, in_numTextures, averageAbsorptionValues);
172 return CalculateSlope(averageAbsorptionValues) * 2.f; // Multiply by 2 so that the Hf Damping value is between -1 and 1.
Definition: AkVirtualAcoustics.h:33
AKSOUNDENGINE_API AkReal32 EstimateHFDamping(AkAcousticTexture *in_textures, float *in_surfaceAreas, int in_numTextures)
Definition: AkReverbEstimation.h:160
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:51
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:369
Cette page a-t-elle été utile ?
Besoin d'aide ?
Des questions ? Des problèmes ? Besoin de plus d'informations ? Contactez-nous, nous pouvons vous aider !
Visitez notre page d'AideDécrivez-nous de votre projet. Nous sommes là pour vous aider.
Enregistrez votre projet et nous vous aiderons à démarrer sans aucune obligation !
Partir du bon pied avec Wwise