|
|
|
|
|
|
|
|
{ |
|
|
{ |
|
|
public: |
|
|
public: |
|
|
AudioMixer4(void) : AudioStream(4, inputQueueArray) { |
|
|
AudioMixer4(void) : AudioStream(4, inputQueueArray) { |
|
|
//for (int i=0; i<4; i++) gain(i, 1.0f); |
|
|
|
|
|
for (int i=0; i<4; i++) multiplier[i] = 65536; |
|
|
for (int i=0; i<4; i++) multiplier[i] = 65536; |
|
|
} |
|
|
} |
|
|
virtual void update(void); |
|
|
virtual void update(void); |
|
|
/* |
|
|
|
|
|
void gain(unsigned int channel, float gain) { |
|
|
void gain(unsigned int channel, float gain) { |
|
|
if (channel >= 4) return; |
|
|
if (channel >= 4) return; |
|
|
if (gain > 32767.0f) gain = 32767.0f; |
|
|
if (gain > 32767.0f) gain = 32767.0f; |
|
|
else if (gain < 0.0f) gain = 0.0f; |
|
|
else if (gain < 0.0f) gain = 0.0f; |
|
|
multiplier[channel] = gain * 65536.0f; // TODO: proper roundoff? |
|
|
multiplier[channel] = gain * 65536.0f; // TODO: proper roundoff? |
|
|
} |
|
|
} |
|
|
*/ |
|
|
|
|
|
private: |
|
|
private: |
|
|
int32_t multiplier[4]; |
|
|
int32_t multiplier[4]; |
|
|
audio_block_t *inputQueueArray[4]; |
|
|
audio_block_t *inputQueueArray[4]; |