Music volume during speech

Started by Nixxon, Sun 12/04/2015 08:01:26

Previous topic - Next topic

Nixxon

Hey Guys,

When I have dialog speech playing the music volume is 0, I would just like it to be faint instead of non existent.

Searched the forums and found this command - speech_music_drop

Ctrl-F in the global script and can't find it or anything that relates to this function.

Just wondering how I would achieve this?

Many thanks.

Snarky

In AGS 3.2 and up, it's now Game.SetAudioTypeSpeechVolumeDrop() (listed in the manual under Multimedia functions).

There's a default drop set in the properties for the different AudioTypes (VolumeReductionWhileSpeechPlaying), and you can change it there or in the script using this function. The volume drop is an absolute, so if the initial music volume is 50 and the drop is 40, it will play at volume 10, but if you change the music volume to 40 it won't play at all during speech (you can avoid this by scaling the drop proportionally when you change the music volume).

Nixxon

That's awesome sauce friend.

However, In searching the global script for this I am still unable to find where I can configure the settings.

Crimson Wizard

Quote from: Nixxon on Sun 12/04/2015 11:40:02
However, In searching the global script for this I am still unable to find where I can configure the settings.

The global script is something that you write. Its initial contents are coming from template, but in 99% it does not have everything you need.
Just put extra line in the game_start:
Code: ags

function game_start()
{
    // whichever code was here before ..........

    Game.SetAudioTypeSpeechVolumeDrop(eAudioTypeMusic, 30);
}

Snarky

If you just want to set a different value that will be used throughout the game, you don't have to write any code at all, you can simply change it in the properties for the "Music" AudioType.

Nixxon

That's brilliant, All working now

Thanks a ton.

SMF spam blocked by CleanTalk