Not logged inOpenClonk Forum
Up Topic General / Help and Questions / Manipulating a sound's volume without breaking the loop
- - By Andriel Date 2013-04-01 22:25
Hi,
I made a millwheel loop for the windmill and the windgenerator. Now as the wheel's turning speed varies, I want the sound volume to vary accordingly. The problem is, when I start the loop like this for example:
Sound("millwheel_loop", false, 50, nil, 1);
and then want to change the volume to 100:
Sound("millwheel_loop", false, 100, nil, 1);
the function returns false and nothing happens. So is there a trick to do it or is this not possible? Otherwise I would need to have multiple sounds.
Reply
Parent - - By Zapper [de] Date 2013-04-01 22:29
What happens if you stop the sound and re-play it? (With the loop parameter as 0 or -1)
Parent - By Andriel Date 2013-04-01 22:48
Well, then the sound stops and countinues. So there's a gap that sounds strange.
Reply
Parent - - By Sven2 [de] Date 2013-04-02 00:19
Isn't there a function SetSoundLevel or similar?
Parent - By Andriel Date 2013-04-02 09:27
Unfortunately not. :(
There's only MusicLevel().
Reply
Parent - - By B_E [de] Date 2013-04-02 10:55 Edited 2013-04-02 11:00
SoundLevel was removed a long time ago, since somebody seems to have thought that Sound offers the same functionality (it does not, there is a difference between same sounds on a single object with Sound()).
Parent - - By Sven2 [de] Date 2013-04-02 12:02
Well, you could open a feature request to implement a function like SetSoundVolume in the bugtracker and assign it to me then. It would be relatively trivial to implement in the engine.
Parent - By Andriel Date 2013-04-06 09:20
Is it possible to have something to set the volume for all sounds? Something like SoundVolume(iVolume, iPlayer)? (And ResetSoundLevel())
I found a nice underwater-sound and that together with lowering the sound volume would make up a really cool atmosphere for diving.
Reply
Up Topic General / Help and Questions / Manipulating a sound's volume without breaking the loop

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill