Wwise SDK 2021.1.14
_ak_reverb_estimation_8h_source
版本
menu_open
link
Wwise SDK 2021.1.14
|
AkReverbEstimation.h
浏览该文件的文档.
45 /// These functions can be used to estimate the reverb parameters of a physical environment, using its volume and surface area
48 /// This is used to estimate the line of best fit through the absorption values of an Acoustic Texture.
58 float meanY = (texture.fAbsorptionLow + texture.fAbsorptionMidLow + texture.fAbsorptionMidHigh + texture.fAbsorptionHigh) / (float)N;
59 float absorptions[4] = { texture.fAbsorptionLow, texture.fAbsorptionMidLow, texture.fAbsorptionMidHigh, texture.fAbsorptionHigh };
76 /// Calculate average absorption values using each of the textures in in_textures, weighted by their corresponding surface area.
77 void GetAverageAbsorptionValues(AkAcousticTexture* in_textures, float* in_surfaceAreas, int in_numTextures, AkAcousticTexture& out_average)
102 /// Estimate the time taken (in seconds) for the sound reverberation in a physical environment to decay by 60 dB.
103 /// This is estimated using the Sabine equation. The T60 decay time can be used to drive the decay parameter of a reverb effect.
105 AkReal32 in_volumeCubicMeters, ///< The volume (in cubic meters) of the physical environment. 0 volume or negative volume will give a decay estimate of 0.
106 AkReal32 in_surfaceAreaSquaredMeters, ///< The surface area (in squared meters) of the physical environment. Must be >= AK_SA_MIN_ENVIRONMENT_SURFACE_AREA
107 AkReal32 in_environmentAverageAbsorption, ///< The average absorption amount of the surfaces in the environment. Must be between AK_SA_MIN_ENVIRONMENT_ABSORPTION and 1.
108 AkReal32& out_decayEstimate ///< Returns the time taken (in seconds) for the reverberation to decay bu 60 dB.
118 AKASSERT(false && "AK::SpatialAudio::ReverbEstimation::EstimateT60Decay: Invalid surface area. in_SurfaceAreaSquaredMeters Must be >= AK_SA_MIN_ENVIRONMENT_SURFACE_AREA");
121 if (in_environmentAverageAbsorption < AK_SA_MIN_ENVIRONMENT_ABSORPTION || in_environmentAverageAbsorption > 1.0f)
123 AKASSERT(false && "AK::SpatialAudio::ReverbEstimation::EstimateT60Decay: Invalid absorption value. in_EnvironmentAverageAbsorption Must be between AK_SA_MIN_ENVIRONMENT_ABSORPTION and 1");
127 out_decayEstimate = (0.161f * in_volumeCubicMeters) / (in_surfaceAreaSquaredMeters * in_environmentAverageAbsorption);
134 AkVector in_environmentExtentMeters, ///< Defines the dimensions of the environment (in meters) relative to the center; all components must be positive numbers.
135 AkReal32& out_timeToFirstReflectionMs, ///< Returns the time taken (in milliseconds) for the first reflection to reach the listener.
136 AkReal32 in_speedOfSound = 343.0f ///< Defaults to 343.0 - the speed of sound in dry air. Must be > 0.
141 AKASSERT(false && "AK::SpatialAudio::ReverbEstimation::EstimateTimeToFirstReflection: Invalid speed of sound. in_speedOfSound must be greater than 0.");
144 if (in_environmentExtentMeters.X < 0.0f || in_environmentExtentMeters.Y < 0.0f || in_environmentExtentMeters.Z < 0.0f)
146 AKASSERT(false && "AK::SpatialAudio::ReverbEstimation::EstimateTimeToFirstReflection: Invalid extent. All components must be positive numbers.");
149 const float minDimension = AkMin(AkMin(in_environmentExtentMeters.X, in_environmentExtentMeters.Y), in_environmentExtentMeters.Z);
154 /// Estimate the high frequency damping from a collection of AkAcousticTextures and corresponding surface areas.
155 /// 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.
156 /// The average absorption values are calculated using each of the textures in the collection, weighted by their corresponding surface area.
157 /// The HFDamping is then calculated as the line-of-best-fit through the average absorption values.
159 AkAcousticTexture* in_textures, ///< A collection of AkAcousticTexture structs from which to calculate the average high frequency damping.
161 int in_numTextures, ///< The number of textures in in_textures (and the number of surface area values in in_surfaceAreas).
162 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.
171 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:158
Definition: AkVirtualAcoustics.h:34
AkReal32 fAbsorptionMidHigh
Definition: AkVirtualAcoustics.h:69
AKSOUNDENGINE_API AKRESULT EstimateT60Decay(AkReal32 in_volumeCubicMeters, AkReal32 in_surfaceAreaSquaredMeters, AkReal32 in_environmentAverageAbsorption, AkReal32 &out_decayEstimate)
Definition: AkReverbEstimation.h:104
AKSOUNDENGINE_API AKRESULT EstimateTimeToFirstReflection(AkVector in_environmentExtentMeters, AkReal32 &out_timeToFirstReflectionMs, AkReal32 in_speedOfSound=343.0f)
Definition: AkReverbEstimation.h:133
#define AK_SA_MIN_ENVIRONMENT_SURFACE_AREA
Definition: AkSpatialAudioTypes.h:55
float CalculateSlope(const AkAcousticTexture &texture)
Definition: AkReverbEstimation.h:51
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:77