-
-
Notifications
You must be signed in to change notification settings - Fork 310
adjust volume #767
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adjust volume #767
Conversation
|
Thanks for this. I'm not a fan of the current plugin API where |
| _currentStream!.$2 == Sound.capture)) { | ||
| await _pool.stop(_currentStream!.$1); | ||
| } | ||
| await _pool.setVolume(soundId: soundId, volume: volume); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Play should have the lowest latency possible since we're playing short sounds very fast during game or replay.
So volume should not be set here.
Instead keep a reference to masterVolume in SoundService and have a setVolume method which loops over all loaded sound to change their volume one by one.
If needed at some point we could even tune the volume of each sound individually.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated the implementation now, hopefully it's what you were looking for.
| themeMode: ThemeMode.system, | ||
| isSoundEnabled: true, | ||
| soundTheme: SoundTheme.standard, | ||
| volume: 0.5, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you tested that the 0.5 default? How does it compare with the current null default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't tell them apart, so it should be about the same.
| return Column( | ||
| mainAxisSize: MainAxisSize.min, | ||
| children: [ | ||
| NonLinearSlider( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you could use flutter's Slider.adaptive instead since that one is linear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
|
It doesn't work on the iOS simulator, I still don't know why. Will investigate later. |
|
I found a problem in the |
|
Will it fix the iOS simulator issue, or is that another matter? I haven't been able to work on it, since I don't have an apple device. |
|
Yes it will fix it. It’s not just a simulator issue but a general issue on iOS. |
close #749

