#include <loudness.hpp>
- Parameters
-
samplesPerSecond | How many loudness values per second of audio to compute. |
sampleRate | the sample rate of the sound buffer |
chans | channel layout of the buffer |
type | sample type of the buffer |
void MWSound::Sound_Loudness::analyzeLoudness |
( |
const std::vector< char > & |
data | ) |
|
Analyzes the energy (closely related to loudness) of a sound buffer. The buffer will be divided into segments according to valuesPerSecond, and for each segment a loudness value in the range of [0,1] will be computed. The computed values are then added to the mSamples vector. This method should be called continuously with chunks of audio until the whole audio file is processed. If the size of data does not exactly fit a number of loudness samples, the remainder will be kept in the mQueue and used in the next call to analyzeLoudness.
- Parameters
-
data | the sound buffer to analyze, containing raw samples |
float MWSound::Sound_Loudness::getLoudnessAtTime |
( |
float |
sec | ) |
const |
Get loudness at a particular time. Before calling this, the stream has to be analyzed up to that point in time (see analyzeLoudness()).
std::deque<char> MWSound::Sound_Loudness::mQueue |
|
private |
int MWSound::Sound_Loudness::mSampleRate |
|
private |
std::vector<float> MWSound::Sound_Loudness::mSamples |
|
private |
float MWSound::Sound_Loudness::mSamplesPerSec |
|
private |
The documentation for this class was generated from the following files:
- /home/travis/build/OpenMW/openmw/apps/openmw/mwsound/loudness.hpp
- /home/travis/build/OpenMW/openmw/apps/openmw/mwsound/loudness.cpp