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
how to add music when I start my CS?
Demondays1 Offline
Member

Posts: 57
Threads: 7
Joined: Jun 2012
Reputation: 0
#1
how to add music when I start my CS?

I was wondering, I tried looking at the scripts but I am just not doing it correctly?

This is what I have:


void OnStart()
{
StopMusic(60, 1);
PlayMusic("brandon2.ogg", false, 1, 0, 10, false);

}

And yes, I do have my brandon2.ogg in the music folder.


What StopMusic does:

afFadeTime - time in seconds until music stops
alPrio - the priority of the music that should stop


What PlayMusic does:

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 - highest, 1 - lower, etc

Intel HD Lag fix: tiny.cc/pyv1gw
(This post was last modified: 06-14-2012, 04:20 AM by Demondays1.)
06-14-2012, 04:19 AM
Find
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#2
RE: how to add music when I start my CS?

Int alPrio is so way too high. try replacing the 10 with a 0 or 1. The lower the number, the higher the priority, meaning it has a higher priority to be played (ie if you have other sounds with a higher priority, they will play instead of your music.)

Hope that helps Big Grin

I rate it 3 memes.
06-14-2012, 04:25 AM
Find
Demondays1 Offline
Member

Posts: 57
Threads: 7
Joined: Jun 2012
Reputation: 0
#3
RE: how to add music when I start my CS?

(06-14-2012, 04:25 AM)andyrockin123 Wrote: Int alPrio is so way too high. try replacing the 10 with a 0 or 1. The lower the number, the higher the priority, meaning it has a higher priority to be played (ie if you have other sounds with a higher priority, they will play instead of your music.)

Hope that helps Big Grin
Changed it a bit, here is how it is:



void OnStart()
{
PlayMusic("brandon2.ogg", false, 0.5f, 0.5f, 0, false);
}


////////////////////////////
// Run when leaving map
void OnLeave()
{
StopMusic(5.0f, 0);
}

I have the .ogg and .snt still not working.

Intel HD Lag fix: tiny.cc/pyv1gw
(This post was last modified: 06-14-2012, 04:33 AM by Demondays1.)
06-14-2012, 04:29 AM
Find
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#4
RE: how to add music when I start my CS?

hmm, what software did you use to make/convert your .ogg? (also, .snt is not necessary for the playmusic function)

I rate it 3 memes.
06-14-2012, 05:01 AM
Find
Demondays1 Offline
Member

Posts: 57
Threads: 7
Joined: Jun 2012
Reputation: 0
#5
RE: how to add music when I start my CS?

(06-14-2012, 05:01 AM)andyrockin123 Wrote: hmm, what software did you use to make/convert your .ogg? (also, .snt is not necessary for the playmusic function)
I didnt convert it, I just changed the .Mp3 extension to .Ogg

Intel HD Lag fix: tiny.cc/pyv1gw
06-14-2012, 06:56 AM
Find
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#6
RE: how to add music when I start my CS?

As in renaming it? That seems to be the problem right there. Sadly, simply renaming it won't work; personally, I use Audacity, a free sound editor:

http://audacity.sourceforge.net/


Simply open the program then drag & drop your original mp3 file into it. Next, click file > export. Before choosing where to save it, make sure you have "Save as type:" set to "Ogg Vorbis Files". After letting it export properly, you will have a fully functional .ogg to use in Amnesia. If you have any further questions, feel free to ask or pm me.

Hope that helped Tongue

I rate it 3 memes.
06-14-2012, 07:55 AM
Find




Users browsing this thread: 1 Guest(s)