-1

I have a 2-part question. An incomplete version of my audioProcessing callback is below to provide context.

1) For SuperpoweredStereoMixer->process, the documentation states that the "inputMeters" and "outputMeters" parameters "Returns the maximum values for metering." and that the SuperpoweredPeak function "Returns the peak value." Are the Peak function and the mixer's meter values the same thing? I assume so, I just want to confirm.

2) When I increase or decrease the input volumes in the self->inputLevelsA, I can see the meter values returned in self->outputMeters increase/decrease as expected. However, I'm not seeing the values increase/decrease in self->inputMetersA. In fact when I decrease the volumes in inputLevelsA to 0.0f I do not see the input meter values decrease at all. Is SuperpoweredStereoMixer->process returning the input meter values before the input volume levels are applied to the signal or after?

Thanks!

static bool audioProcessing(void *clientdata, float **inputBuffers, unsigned int inputChannels, float **outputBuffers, unsigned int outputChannels, unsigned int numberOfSamples, unsigned int samplerate, uint64_t hostTime) {
    __unsafe_unretained SuperpoweredFrequencies *self = (__bridge SuperpoweredFrequencies *)clientdata;
  hasAudio1 = self->player1->process(self->musicInterleavedBuffer1, false, numberOfSamples, 1.0f);
    hasAudio2 = self->player2->process(self->musicInterleavedBuffer2, false, numberOfSamples, 1.0f);

    SuperpoweredInterleave(inputBuffers[0], inputBuffers[1], self->microphoneInterleavedBuffer, numberOfSamples);
self->inputsA[0] = self->musicInterleavedBuffer1; 
    self->inputsA[1] = self->musicInterleavedBuffer2; 
    self->inputsA[2] = self->microphoneInterleavedBuffer;
    self->inputsA[3] = NULL;
    self->outputsA[0] = self->outputInterleavedBufferA;
    self->outputsA[1] = NULL;
    self->stereoMixerA->process(self->inputsA, self->outputsA, self->inputLevelsA, self->outputLevelsA, self->inputMetersA, self->outputMeters, numberOfSamples);


SuperpoweredDeInterleave(self->outputsA[0], outputBuffers[0], outputBuffers[1], numberOfSamples);
hasAudio = hasAudio1 || hasAudio2 || micHasAudio;
    return hasAudio;
}
Sean
  • 868
  • 9
  • 22

1 Answers1

0

1) Yes, SuperpoweredPeak returns with the same value. 2) Yes, the inputMeters will measure the loudness before mixing. Outputmeters measure the output's loudness.

Gabor Szanto
  • 1,329
  • 8
  • 12
  • Thanks. Why are the inputMeters measured prior to mixing? I'm trying to build an audio-level meter for the input and want the user to see the changes to input loudness after mixing as the input level changes. It seems like I would need to use something like SuperpoweredVolumeAdd followed by SuperpoweredPeak prior to sending to the mixer. At that point, however, it doesn't seem there would be a point to using the Mixer's input volume level at all. That would just be set to 1.0f. It would be nice if the Mixer could give you the input values before and after mixing. – Sean Jul 09 '19 at 13:59
  • Most use-cases need the input meters prior to mixing, such as DJ mixer applications. You can easily get the input meter values after mixing by multiplying the inputMeter values with the individual input gain values and the output gain values (because gain is just a multiplication). – Gabor Szanto Jul 13 '19 at 10:00