Support volume on each input channel
Call stub->SetGain(float) to set an input's volume before mixing.
This commit is contained in:
1 parent
ca50839712
commit
3c7ffbe0b3
2 files changed
+7
-2
No files matched your search
@@ -25,6 +25,7 @@ AudioOutputMixerStub::AudioOutputMixerStub(AudioOutputMixer *sink, int id) : Aud
|
||||
{
|
||||
this->id = id;
|
||||
this->parent = sink;
|
||||
SetGain(1.0);
|
||||
}
|
||||
|
||||
AudioOutputMixerStub::~AudioOutputMixerStub()
|
||||
@@ -54,8 +55,10 @@ bool AudioOutputMixerStub::begin()
|
||||
|
||||
bool AudioOutputMixerStub::ConsumeSample(int16_t sample[2])
|
||||
{
|
||||
// int16_t amp[2] = { Amplify(sample[LEFTCHANNEL]), Amplify(sample[RIGHTCHANNEL]) };
|
||||
return parent->ConsumeSample(sample, id);
|
||||
int16_t amp[2];
|
||||
amp[LEFTCHANNEL] = Amplify(sample[LEFTCHANNEL]);
|
||||
amp[RIGHTCHANNEL] = Amplify(sample[RIGHTCHANNEL]);
|
||||
return parent->ConsumeSample(amp, id);
|
||||
}
|
||||
|
||||
bool AudioOutputMixerStub::stop()
|
||||
|
||||
Reference in new issue
Block a user