Skip to content

Conversation

@Mauritz8
Copy link
Contributor

@Mauritz8 Mauritz8 commented Jun 10, 2024

close #749
Screenshot from 2024-06-10 15-05-13
image

@veloce
Copy link
Contributor

veloce commented Jun 12, 2024

Thanks for this. I'm not a fan of the current plugin API where setVolume is done each time before play; I'd try to change that firs

_currentStream!.$2 == Sound.capture)) {
await _pool.stop(_currentStream!.$1);
}
await _pool.setVolume(soundId: soundId, volume: volume);
Copy link
Contributor

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.

Copy link
Contributor Author

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,
Copy link
Contributor

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?

Copy link
Contributor Author

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(
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@veloce
Copy link
Contributor

veloce commented Jun 14, 2024

It doesn't work on the iOS simulator, I still don't know why. Will investigate later.

@veloce
Copy link
Contributor

veloce commented Jul 15, 2024

I found a problem in the soundpool package. I've started to work on a new sound package that will replace it.

@Mauritz8
Copy link
Contributor Author

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.

@veloce
Copy link
Contributor

veloce commented Jul 17, 2024

Yes it will fix it. It’s not just a simulator issue but a general issue on iOS.

@veloce veloce merged commit aa141fd into lichess-org:main Jul 27, 2024
@Mauritz8 Mauritz8 deleted the mauritz/749 branch July 27, 2024 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sound isn't loud enough

2 participants