Experimental support for LtRt surround matrixing

This commit is contained in:
Jack Andersen
2017-09-27 17:11:40 -10:00
parent 71b8893dde
commit 0b35c584f6
10 changed files with 554 additions and 40 deletions

View File

@@ -2,6 +2,8 @@
#define BOO_AUDIOVOICEENGINE_HPP
#include "boo/audiodev/IAudioVoiceEngine.hpp"
#include "LtRtProcessing.hpp"
#include "Common.hpp"
#include "AudioVoice.hpp"
#include "AudioSubmix.hpp"
#include <functional>
@@ -9,17 +11,6 @@
namespace boo
{
/** Pertinent information from audio backend about optimal mixed-audio representation */
struct AudioVoiceEngineMixInfo
{
double m_sampleRate;
soxr_datatype_t m_sampleFormat;
unsigned m_bitsPerSample;
AudioChannelSet m_channels;
ChannelMap m_channelMap;
size_t m_periodFrames;
};
/** Base class for managing mixing and sample-rate-conversion amongst active voices */
class BaseAudioVoiceEngine : public IAudioVoiceEngine
{
@@ -44,6 +35,12 @@ protected:
std::vector<int32_t> m_scratch32Post;
std::vector<float> m_scratchFltPost;
/* LtRt processing if enabled */
std::unique_ptr<LtRtProcessing> m_ltRtProcessing;
std::vector<int16_t> m_ltRtIn16;
std::vector<int32_t> m_ltRtIn32;
std::vector<float> m_ltRtInFlt;
AudioSubmix m_mainSubmix;
std::list<AudioSubmix*> m_linearizedSubmixes;
bool m_submixesDirty = true;
@@ -71,8 +68,10 @@ public:
void setCallbackInterface(IAudioVoiceEngineCallback* cb);
void setVolume(float vol);
bool enableLtRt(bool enable);
const AudioVoiceEngineMixInfo& mixInfo() const;
AudioChannelSet getAvailableSet() {return m_mixInfo.m_channels;}
const AudioVoiceEngineMixInfo& clientMixInfo() const;
AudioChannelSet getAvailableSet() {return clientMixInfo().m_channels;}
void pumpAndMixVoices() {}
size_t get5MsFrames() const {return m_5msFrames;}
};