How to Mute Sound While Note Narration is Playing? - 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: How to Mute Sound While Note Narration is Playing? (/thread-23128.html) |
How to Mute Sound While Note Narration is Playing? - mmeowwcat - 09-13-2013 Hello, this is my first post on this forum, and I am extremely new at scripting. I have figured out the extra_english.lang file fairly well, and I have a couple functions under my belt, (displaying messages, locked doors/keys). Anyways, I was wondering what I would do in my script file if I have music playing (AlPrio priority is 0) and want to mute it momentarily to let the narration of my note play uninterrupted. Thanks to anybody willing to help me out. Regards, mmeowwcat RE: How to Mute Sound While Note Narration is Playing? - Rapture - 09-14-2013 Would this be what your looking for? Code: FadeGlobalSoundVolume(float afDestVolume, float afTime); RE: How to Mute Sound While Note Narration is Playing? - mmeowwcat - 09-14-2013 I don't think that's right. I tried putting it in a function that was called when I picked up the note, and sound effects stopped, but the music didn't. Also, after I put the note down, I could no longer hear doors moving. Thanks for taking time out of your day to try to help me out though. RE: How to Mute Sound While Note Narration is Playing? - Rapture - 09-14-2013 This will stop the music, but I'm not sure if it will resume where it last played off if you want this. Code: StopMusic(float afFadeTime, int alPrio); RE: How to Mute Sound While Note Narration is Playing? - mmeowwcat - 09-14-2013 Ok, I managed to get that working from the code you provided, now the only question is, say the player closes the note before the narration(I just slipped a music file in its place) finishes. The sound of the note still plays until it's finished. Would you have any ideas about that? Thanks. RE: How to Mute Sound While Note Narration is Playing? - Rapture - 09-14-2013 Your using, Code: void PlayMusic(string& asMusicFile, bool abLoop, float afVolume, float afFadeTime, int alPrio, bool abResume); I'm looking at "01_old_archives.map" and it's .hps file, and all I see for the Note CallbackFunc in the LevelEditor is the "PlayMusic". If you copy it out and change the "asMusicFile" to your "YourText.ogg" file, I'm assuming it should work fine. Tried it out in-game also, it played music and resumed back to the previous one when the Note ended. RE: How to Mute Sound While Note Narration is Playing? - mmeowwcat - 09-14-2013 Hmm, I looked into that levels .hps and .map files, and I saw what you meant. I copied the function, pasted it into my .hps file, and changed the name and the sound. Now, It will play the narration music and stop as it is needed, but the background ambient music is still playing while I read the note! I tried Code: StopMusic(float afFadeTime, int alPrio); Code: FadeGlobalSoundVolume(float afDestVolume, float afTime); RE: How to Mute Sound While Note Narration is Playing? - Rapture - 09-14-2013 Have you changed the "asMusicFile - the music to play + extension .ogg"? By ambient music, do you mean the music or the sounds placed in the level? And how bad is it? If it's only noticeable if you pay attention, I don't think it's really a big deal. RE: How to Mute Sound While Note Narration is Playing? - mmeowwcat - 09-14-2013 Perhaps you're right on that. Maybe if I just lower the ambient volume, and increase the narration volume, nobody would even notice. Thanks for all your help. |