Mute left / right when using Superpowered sdk

I successfully integrated the heavy duty CrossExample , and now I need to apply the sound without sound right / left, and I checked

SuperpoweredMixer.h , SuperpoweredSimple.h

these files, but you cannot find the appropriate methods for applying this effect,

are there any other ways to do this?

+4
source share
1 answer

Just just the zero of each even or odd pattern, with some simple ramp when it turns on or off to prevent “clicks”.

Superpowered . SuperpoweredStereoMixer, .

bool Tempo::process(short int *output, unsigned int numberOfSamples) {
    bool silence = !playerA->process(stereoBuffer, false, numberOfSamples, volA);
    echo->process(stereoBuffer, stereoBuffer, numberOfSamples);
    reverb->process(stereoBuffer, stereoBuffer, numberOfSamples);

    float *mixerInputs[4] = {stereoBuffer, NULL, NULL, NULL};

    float *mixerOutputs[2] = {stereoBuffer, NULL};

    float mixerInputLevels[8] = {1.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f};

    float mixerOutputLevels[2] = {left, right};

    mixer->process(mixerInputs, mixerOutputs, mixerInputLevels, mixerOutputLevels, NULL, NULL,
                   numberOfSamples);

    if (!silence) {
        SuperpoweredFloatToShortInt(mixerOutputs[0], output, numberOfSamples);
    }
    return !silence;
}
+5

Source: https://habr.com/ru/post/1655207/


All Articles