Music bug or doin it rong?

Music bug or doin it rong?

Discuss sound effects, game music, and the creation thereof.

Moderator: Moderators

Post Reply
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Music bug or doin it rong?

Post by smoth »

So in the music widget

the command set snd_volmusic

say I set it to 50%.

when a new track plays the max volume will be set to be 50%, even if I set it to 100%. Not until another tracks starts will the max volume be able to be 100% so take this example.

Song is playing, it is too loud for me at that time. I set the volume level to 50. NOW the next song comes on, I like this song and I want it full volume so I set the volume to 100%. it will not go up. I can make it lower but not louder. Now if I set it to 100% and an 3rd song plays, that song will have the full volume range.

set snd_volmaster affects all volumes but can be raised or lowered with no issue. is there a nother snd_*music* I am missing here?
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: Music bug or doin it rong?

Post by jK »

smoth wrote:I set the volume level to 50.
How?
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Music bug or doin it rong?

Post by smoth »

smoth wrote:the command set snd_volmusic
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: Music bug or doin it rong?

Post by jK »

k you found a bug
User avatar
SinbadEV
Posts: 6475
Joined: 02 May 2005, 03:56

Re: Music bug or doin it rong?

Post by SinbadEV »

I'm nothing and nobody and couldn't even figure out how to search the codebase but maybe snd_volmusic is supposed to be a float between 0.0 and 1.0 so when you set it to 50 or 100 it just interprets it as "max"... maybe you need to set it to 0.5 ?

edit: but based on that other post I'm probably wrong.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Music bug or doin it rong?

Post by smoth »

you don't have to be familiar to download gundam and play with the music widget :\

JK: so matis is calling eh? :P
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Music bug or doin it rong?

Post by hoijui »

The bug is here:
https://github.com/spring/spring/blob/m ... e.cpp#L283

you already fixed it, jk? if not, i can do it...
just asking cause i did most sound stuff recently, and you did not say whether you fixed it yet/will fix it.
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: Music bug or doin it rong?

Post by jK »

Would be grateful when you fix it.

I workaround it in MusicChannel::SetVolume():
instead of

Code: Select all

current->SetVolume(newvolume);
I send the changed scale

Code: Select all

const float scaleVol = newvolume / std::min(0.0001f, volume);
current->SetVolume(scaleVol);
But I assume this bug is in all other SoundChannels, too. Also this workaround doesn't work when you set the volume to zero.
So the best fix would be to pass an additional argument to SoundSource::Play() & SoundSource::PlayStream, so the volume scaling is done in SoundSource and not in SoundChannel (-> split SoundSource volume from SoundChannel volume).
Post Reply

Return to “Sound Effects & Music”