Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 3 of 3

Thread: Gain Structure of the Mixer

  1. #1

    Gain Structure of the Mixer

    Is there a structure as to how to add gain 1dB at a time. So far it has been a guessing game for me. Any positive gain I add cannot exceed a value of 2 even though the documentation states that any value between 1 and 32,767 is a positive gain and anything between 0 and 1 attenuates the signal. Is there something I can read that shows an algorithm to calculate + and - 1dB?

    code:

    mixer1.gain(0, 1.04); // My ears tell me that it is boosting channel 1 of the mixer by at least 9dB
    mixer1.gain(1, 0.02); // Attenuating channel 2 of the mixer by a lot.....

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    27,659
    Maybe something like this?

    mixer1.gain(0, powf(10.0f, dB / 20.0f));

  3. #3
    I will try it tomorrow! Thanks for the tip, I will update you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •