void mixAudioBufferChannelsLogrithmicDRC(AudioBuffer &audioBuffer, std::vector<float> &channelLevels, AudioBuffer &mixBuffer, float threshold) { if(audioBuffer.getChannels() == 0) return; AudioFormat format=audioBuffer.getFormat(); unsigned int samples=audioBuffer.getSamples(); switch(format) { case AudioFormat::UInt8: case AudioFormat::UInt8P: mixChannelsLogrithmicDRC<uint8_t>((uint8_t *)audioBuffer.getBuffer(), channelLevels, (uint8_t *)mixBuffer.getBuffer(), samples, threshold); break; case AudioFormat::Int16: case AudioFormat::Int16P: mixChannelsLogrithmicDRC<int16_t>((int16_t *)audioBuffer.getBuffer(), channelLevels, (int16_t *)mixBuffer.getBuffer(), samples, threshold); break; case AudioFormat::Int32: case AudioFormat::Int32P: mixChannelsLogrithmicDRC<int32_t>((int32_t *)audioBuffer.getBuffer(), channelLevels, (int32_t *)mixBuffer.getBuffer(), samples, threshold); break; case AudioFormat::Float: case AudioFormat::FloatP: mixChannelsLogrithmicDRC<float>((float *)audioBuffer.getBuffer(), channelLevels, (float *)mixBuffer.getBuffer(), samples, threshold); break; case AudioFormat::Double: case AudioFormat::DoubleP: mixChannelsLogrithmicDRC<double>((double *)audioBuffer.getBuffer(), channelLevels, (double *)mixBuffer.getBuffer(), samples, threshold); break; } }
void callMixAudioBufferLogrithmicDRC(std::vector<AudioBuffer> const &audioBuffers, AudioBuffer &mixBuffer, unsigned int samples, float threshold) { std::vector<_Type *> buffers(audioBuffers.size()); for(size_t i=0; i<audioBuffers.size(); ++i) buffers[i]=(_Type *)audioBuffers[i].getBuffer(); mixLogrithmicDRC<_Type>(buffers, (_Type *)mixBuffer.getBuffer(), samples, threshold); }
void callMixLinearAttenuation(std::vector<AudioBuffer> const &audioBuffers, AudioBuffer &mixBuffer, unsigned int samples) { std::vector<_Type *> buffers(audioBuffers.size()); for(size_t i=0; i<audioBuffers.size(); ++i) buffers[i]=(_Type *)audioBuffers[i].getBuffer(); mixLinearAttenuation<_Type>(buffers, (_Type *)mixBuffer.getBuffer(), samples); }