Jump to content
Sign in to follow this  
Rozo

Custom Sound Files

Recommended Posts

Afther reading 112 pages looking for an topic which can help me to add custom sound files to the mission i only found this post:

http://forums.bistudio.com/showthread.php?t=73361

I have no clue how the code works that he put in the script:

};


    class intro1
    {
         name = "intro1";
         sound[] = {\music\intro1.ogg, 1.0,1.0};
         titles[] = 
         {
         };

What i have now is an Ogg vorbis sound file named Damnation in an folder called "sound" in my missions folder.

Back in Arma 1 i could select this sound file under the trigger effects, this doesn't seems to work in arma 2, Can someone explane me the code above or an other methode to make this work?

PS: I do not know how to make an intro.

Share this post


Link to post
Share on other sites

If this is really the code you use in your script it cannot work. Apart from some syntax errors your sound file is located in a folder "Sound", as you said, in the example the soundfile is in a folder "music".

Try this example:

class CfgSounds
{
  sounds[] = {};   
  class intro1
  {
     name = "intro";
     sound[] = {"\sound\intro1.ogg", 1, 1};
     titles[] = {};
 };
};

Explanation (as good as I can):

Declare a section class CfgSound { ... class content ... } so that the engine knows there are your custom sounds defined.

Then define for every sound its own subclass, here we only have one class, called intro1.

The class intro1 now contains all the needed information:

- the name (used to access the sound ingame via the "say" command)

- the location (here: "\sound\intro1.ogg")

- cannot tell you for what the "titles[]" statement is good for atm.

Share this post


Link to post
Share on other sites

Thank you for the fast response, should i put the code in an description file or sqf?

Share this post


Link to post
Share on other sites

Got it all working, Thanks for your help mates.

Share this post


Link to post
Share on other sites

can someone please help with a strange Problem I have with adding an own musictrack?

I´ve used the code given above by Bon. I put it right into my description.ext and just changed the name of the soundfile. The only result I have is a CTD with following errormessage:

screenshot

Share this post


Link to post
Share on other sites

This works for me (class CfgMusic instead of CfgSounds):

class CfgMusic
{
tracks[]={};
class Customtune1
{
	name = "Customtune1";
	sound[] = {"\sounds\Custom_SoundTrack.ogg", db+0, 1.0};
};
};

After resaving the mission, the tracklist (when placing a trigger) should show up with the new entry.

The error message tells me that some class member is already defined. Check if CfgSounds are defined elsewhere in your description.ext. I'm a bit confused what you are trying to do: Add a stereo sound track (CfgMusic), or a mono sound (CfgSound) that can have a spatial location (radio on a table i.e.).

Edited by CarlGustaffa

Share this post


Link to post
Share on other sites
The error message tells me that some class member is already defined. Check if CfgSounds are defined elsewhere in your description.ext. I'm a bit confused what you are trying to do: Add a stereo sound track (CfgMusic), or a mono sound (CfgSound) that can have a spatial location (radio on a table i.e.).

Thanks for replying.

No this is just the first custom sound for my Mission and it is the old known "Bing" sound when a hint appears. Nothings more. I dont believe that it is stereo sound though....but I´ll gonna try...thanks. I´ll report back whether it has worked

Share this post


Link to post
Share on other sites

OK...fixed everything. It works all well now...thank you

regards

Memphis

Edited by MemphisBelle

Share this post


Link to post
Share on other sites

Gonna hijack this thread so I dont have to creat a new one...

Having trouble with my script, just trying to add a custom sound to a civilian.

My ext file:

class CfgSounds

{

sounds[] = {M9gun,Urfault};

class M9gun

{

name = "m9gun";

sound[] = {"m9_single1.wss", 2, 1};

titles[] = {};

};

class Urfault

{

name = "urfault";

sound[] = {"ur_fault.ogg", 2,1};

titles[] = {};

};

};

And on a trigger a script with this: Panic say ["Urfault",5]; (Panic is the name of the civilian and is spelled with a large P ingame)

The M9 sound plays fine (did undpo the gun sound since I didnt find a way to play it lol) but for some reason it wont find my ur_fault.ogg file (get the error message cant find sound Urfault). It is correctly spelled sine the name is CTRL + C and CTRL + Ved in into the ext file. For now the sound files are in the main mission folder since Im just playing around to learn the scripting part...

any ideas why this aint working?? and thanks in advance ;)

P.S, just adding another question while Im at it...

This option to say thats called maxTitlesDistance... how big is one titles? So I know what to gun for?

*Another edit*

http://community.bistudio.com/wiki/Multiplayer_Custom_Sounds_Tutorial all specs is according to this page, using Audacity to record and export.

Edited by henriksultan
adding some extra info :p

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×