Frictional Games Forum (read-only)
Volume change during speech - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Volume change during speech (/thread-16962.html)



Volume change during speech - lllDash - 07-14-2012

This is not a big problem but i was just curious. Can one lower the music volume when a note is read out loud? In Dark Descent all of Daniel's journals play different music. but I want to keep the same music but have the volume drop just a bit.


RE: Volume change during speech - Obliviator27 - 07-14-2012

The PlayMusic function has a volume argument.


RE: Volume change during speech - lllDash - 07-16-2012

Playmusic doesn't allow me to change volume of music thats already playing, also, I need the volume to go back to 100% after the player reads a note. I am not aware of a function that does that.

If nobody knows, its no big deal. I was just wondering. Thanks for the reply.


RE: Volume change during speech - Acies - 07-16-2012

PlayMusic(string& asMusicFile, bool abLoop, float afVolume, float afFadeTime, int alPrio, bool abResume);

I believe the "Bool abResume" set to true will allow you to change the volume while having the music playing.

Hopefully.


RE: Volume change during speech - lllDash - 07-16-2012

(07-16-2012, 10:32 AM)Acies Wrote: PlayMusic(string& asMusicFile, bool abLoop, float afVolume, float afFadeTime, int alPrio, bool abResume);

I believe the "Bool abResume" set to true will allow you to change the volume while having the music playing.

Hopefully.
Holy cow! I didn't notice that before. I'll play around with it and see if it works. Thanks.


RE: Volume change during speech - lllDash - 07-16-2012

This seems to work:


void notevolume(string &in item)
{
PlayMusic("04_amb.ogg", true, 0.7, 0.5, 2, true);
AddTimer("", 0.1f, "musiccomeback");
}
void musiccomeback(string &in asTimer)
{
PlayMusic("04_amb.ogg", true, 1, 0.5, 3, true);
}


The only problem is that the music's priority increases and that may mess up other musical cues in the level. Sure, I could add "StopMusic" but that would have a split second of no music even if fade is set to 0.