Skip to content
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

Unexpected default play volume on buses #381

Open
Cameramorphic opened this issue Dec 13, 2024 · 0 comments
Open

Unexpected default play volume on buses #381

Cameramorphic opened this issue Dec 13, 2024 · 0 comments

Comments

@Cameramorphic
Copy link

Expected behavior:

When setting a default volume on a SoLoud::AudioSource I'd expect it to be used (as documented) when creating an instance by calling myBus.play(mySound).

Actual behavior:

It always plays with volume 1.0f in the bus. When playing in root with soloud.play(mySound) it works as expected.

Steps to reproduce the problem:

SoLoud::Wav sfx;
sfx.load("my_sfx.wav");
sfx.setVolume(0.2f);

soloud.play(sfx); // plays at volume 0.2 (as expected)
sfxBus.play(sfx); // plays at volume 1.0
// to force expected behaviour e.g.:
sfxBus.play(sfx, -1);
sfxBus.play(sfx, sfx.mVolume);

Steps to fix the problem:

The issue is probably just the parameter defaults in the soloud_bus.h header, where play, playClocked, play3d and play3dClocked default to aVolume = 1.0f.
In the soloud.h header, play, playClocked and playBackground default to aVolume = -1.0f, but interestingly play3d and play3dClocked also default to aVolume = 1.0f.
Is this intended behaviour or a bug?

SoLoud version: 20200207

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

No branches or pull requests

1 participant