Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Volume change during speech
lllDash Offline
Member

Posts: 108
Threads: 12
Joined: Apr 2012
Reputation: 3
#1
Volume change during speech

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.
(This post was last modified: 07-14-2012, 02:42 PM by lllDash.)
07-14-2012, 02:40 PM
Find
Obliviator27 Offline
Posting Freak

Posts: 792
Threads: 10
Joined: Jul 2011
Reputation: 66
#2
RE: Volume change during speech

The PlayMusic function has a volume argument.

07-14-2012, 08:34 PM
Find
lllDash Offline
Member

Posts: 108
Threads: 12
Joined: Apr 2012
Reputation: 3
#3
RE: Volume change during speech

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.
07-16-2012, 10:11 AM
Find
Acies Offline
Posting Freak

Posts: 1,643
Threads: 60
Joined: Feb 2011
Reputation: 73
#4
RE: Volume change during speech

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.

[Image: mZiYnxe.png]


07-16-2012, 10:32 AM
Find
lllDash Offline
Member

Posts: 108
Threads: 12
Joined: Apr 2012
Reputation: 3
#5
RE: Volume change during speech

(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.
07-16-2012, 10:55 AM
Find
lllDash Offline
Member

Posts: 108
Threads: 12
Joined: Apr 2012
Reputation: 3
#6
RE: Volume change during speech

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.
07-16-2012, 02:14 PM
Find




Users browsing this thread: 1 Guest(s)