Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Can't change volume level #1

Open
kostosspb opened this issue May 6, 2018 · 1 comment
Open

Can't change volume level #1

kostosspb opened this issue May 6, 2018 · 1 comment

Comments

@kostosspb
Copy link

kostosspb commented May 6, 2018

Hello, Anton!
Thanks for good project.
I want to add volume regulation, but it isn't work.
In loop section I'm write:

if(M5.BtnA.wasPressed())
  {
       volume_down();
       m5.update();
  }

Where I'm wrong?

@mpmarks
Copy link

mpmarks commented Apr 6, 2020

The gain has an argument that is a float fraction. So try something like this:
void volume_up()
{
gain++;
if (gain >=100) gain = 100;
out->SetGain(gain/100.0);
}

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants