mmeowwcat
Junior Member
Posts: 7
Threads: 2
Joined: Sep 2013
Reputation:
0
|
How to Mute Sound While Note Narration is Playing?
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
(This post was last modified: 09-14-2013, 07:28 PM by mmeowwcat.)
|
|
09-13-2013, 11:02 PM |
|
Rapture
Posting Freak
Posts: 1,078
Threads: 79
Joined: May 2011
Reputation:
30
|
RE: How to Mute Sound While Note Narration is Playing?
Would this be what your looking for?
FadeGlobalSoundVolume(float afDestVolume, float afTime);
|
|
09-14-2013, 01:14 AM |
|
mmeowwcat
Junior Member
Posts: 7
Threads: 2
Joined: Sep 2013
Reputation:
0
|
RE: How to Mute Sound While Note Narration is Playing?
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.
(This post was last modified: 09-14-2013, 02:53 AM by mmeowwcat.)
|
|
09-14-2013, 02:44 AM |
|
Rapture
Posting Freak
Posts: 1,078
Threads: 79
Joined: May 2011
Reputation:
30
|
RE: How to Mute Sound While Note Narration is Playing?
This will stop the music, but I'm not sure if it will resume where it last played off if you want this.
StopMusic(float afFadeTime, int alPrio);
|
|
09-14-2013, 03:11 AM |
|
mmeowwcat
Junior Member
Posts: 7
Threads: 2
Joined: Sep 2013
Reputation:
0
|
RE: How to Mute Sound While Note Narration is Playing?
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.
|
|
09-14-2013, 03:51 AM |
|
Rapture
Posting Freak
Posts: 1,078
Threads: 79
Joined: May 2011
Reputation:
30
|
RE: How to Mute Sound While Note Narration is Playing?
Your using,
void PlayMusic(string& asMusicFile, bool abLoop, float afVolume, float afFadeTime, int alPrio, bool abResume);
asMusicFile - the music to play + extension .ogg
abLoop - determines whether a music track should loop
afVolume - volume of the music
afFadeTime - time in seconds until music reaches full volume
alPrio - priority of the music. Note that only the music with the highest priority can be heard! 0 - lowest, 1 - higher, etc.
abResume - if true, playback will be continued from where the track stopped after the call to StopMusic(); if false, the track will be restarted.
right?
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.
|
|
09-14-2013, 05:04 PM |
|
mmeowwcat
Junior Member
Posts: 7
Threads: 2
Joined: Sep 2013
Reputation:
0
|
RE: How to Mute Sound While Note Narration is Playing?
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 StopMusic(float afFadeTime, int alPrio);
and set the alPrio to 0, the same as the ambience, but to no avail. I also tried FadeGlobalSoundVolume(float afDestVolume, float afTime);
but that didn't work either.
|
|
09-14-2013, 06:44 PM |
|
Rapture
Posting Freak
Posts: 1,078
Threads: 79
Joined: May 2011
Reputation:
30
|
RE: How to Mute Sound While Note Narration is Playing?
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.
|
|
09-14-2013, 06:56 PM |
|
mmeowwcat
Junior Member
Posts: 7
Threads: 2
Joined: Sep 2013
Reputation:
0
|
RE: How to Mute Sound While Note Narration is Playing?
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.
|
|
09-14-2013, 07:28 PM |
|
|