#include "AudioArray.h"
+#include <wtf/OwnPtr.h>
+#include <wtf/PassOwnPtr.h>
+
namespace WebCore {
class DynamicsCompressorKernel {
public:
- DynamicsCompressorKernel(float sampleRate);
+ DynamicsCompressorKernel(float sampleRate, unsigned numberOfChannels);
+
+ void setNumberOfChannels(unsigned);
// Performs stereo-linked compression.
- void process(const float *sourceL,
- float *destinationL,
- const float *sourceR,
- float *destinationR,
+ void process(float* sourceChannels[],
+ float* destinationChannels[],
+ unsigned numberOfChannels,
unsigned framesToProcess,
float dbThreshold,
protected:
float m_sampleRate;
-
+
float m_detectorAverage;
float m_compressorGain;
unsigned m_lastPreDelayFrames;
void setPreDelayTime(float);
- AudioFloatArray m_preDelayBufferL;
- AudioFloatArray m_preDelayBufferR;
+ Vector<OwnPtr<AudioFloatArray> > m_preDelayBuffers;
int m_preDelayReadIndex;
int m_preDelayWriteIndex;