Jump to content
Sign in to follow this  
Sky999

Why isn't this custom music script working?

Recommended Posts

I've never been able to get custom music working for ARMA2, but for my current campaign I'm working on it's crucial that I do.

1. I have an .ogg file called 'MiriamMakeba.ogg'.

2. I have made a new folder called 'sounds' in the mission 'Home_Sweet_Home'.

3. MiriamMakeba.ogg has been placed in the sounds folder.

I have a 'description.ext' file and inside I have this script:

class CfgSounds

{

// List of sounds (.ogg files without the .ogg extension)

sounds[] = {MiriamMakeba.ogg};

// Definition for each sound

class song

{

name = "MiriamMakeba.ogg"; // Name for mission editor

sound[] = {\sound\MiriamMakeba.ogg, 1, 1.0};

titles[] = {};

};

};

4. I have a trigger set to 'Civilian' 'Present' and in the 'OnAct' box I have this:

playSound "MiriamMakeba.ogg"

I load in-game and get the message:

Sound MiriamMakeba.ogg not found

Share this post


Link to post
Share on other sites

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

playSound "sound1";

I use all lowercase in sound names (I think I read that I should somewhere). There were also a few errors in your original... so hopefully mine should work for you. Just remember rename you miriammakeba.ogg to all lowercase...

Good luck.

Share this post


Link to post
Share on other sites
Sound song1 not found

I copy and pasted the new script you sent me to the description.ext Mosh, then I changed the sound files to 'miriammakeba.ogg'.

Have I missed anything out?

EDIT

Now I'm not getting the message, but I'm also not having any sound play?

I'm starting to think it's a problem with the file, I used Audacity to convert it to .ogg, so I don't see why it would be wrong. I never understand why everyone else seems to be able to do these things yet they refuse to work for me...

Edited by Sky999

Share this post


Link to post
Share on other sites
I copy and pasted the new script you sent me to the description.ext Mosh, then I changed the sound files to 'miriammakeba.ogg'.

Have I missed anything out?

Did you reload the mission in the editor? For changes to description.ext you need to reload or save the mission.

http://www.moshland.com/temp/TEST_description.zip

Share this post


Link to post
Share on other sites
Did you reload the mission in the editor? For changes to description.ext you need to reload or save the mission.

http://www.moshland.com/temp/TEST_description.zip

Ahhh, now I'm comparing mine to yours, and while your file is 31.5kb, mine is a gigantic 337kb, could this be why the sound isn't playing?

Share this post


Link to post
Share on other sites
Ahhh, now I'm comparing mine to yours, and while your file is 31.5kb, mine is a gigantic 337kb, could this be why the sound isn't playing?

I just used a small sound file and named it what you named yours. You can just copy your sound over it in sound folder.

Edit - according to the wiki... http://community.bistudio.com/wiki/description.ext

There are three types of sound that can be specified:

  1. General sounds that can be used for dialog, voiceovers in the briefing etc. These sounds are actioned in a mission by using the commands: say, playSound
  2. Dialog where one unit talks over the radio, for example using the command sideRadio
  3. Music using the command playMusic

I use playSound mostly and playMusic for intro/outro... although the 2 seem to be pretty much the same thing. Edited by Mosh
more info

Share this post


Link to post
Share on other sites

Two things I haven't tried.

1. Changing the size of the file, but it is a two minute song.

2. Doing the changes, then restarting ARMA2 and seeing If it works.

Anyway thanks for your help, perhaps these screen shots might reveal something.

Mission1.jpg

Mission2.jpg

Mission3.jpg

Share this post


Link to post
Share on other sites

After reading this http://ofp.toadlife.net/downloads/tutorials/tutorial_sound/tutorial_sound.html

I noticed this

Music : Up to 44100 Khz, 16-bit, Stereo. Any length supported.

Speech : 22050-44100 Khz, 16-bit, Mono. Any length supported ?

Radio : 11025-44100 Khz, 16-bit, Mono. Final sound files must not exceed a certain length. I suggest using 11025 Khz since you will notice little difference in quality with 44100 Khz anyway.

I'm guessing that's the difference, you need playMusic since it's 16 bit stereo .ogg (I always use mono).

So either record it in mono, or maybe try using playMusic

class CfgMusic
{
tracks[]={};
class song1
{
 name = "song1";
 sound[] = {"sound\miriammakeba.ogg", db+0, 1.0};
};
}:

with

PlayMusic "song1";

Didn't mean to run you in circles, I should have asked about the .ogg earlier...

Share this post


Link to post
Share on other sites
After reading this http://ofp.toadlife.net/downloads/tutorials/tutorial_sound/tutorial_sound.html

I noticed this

I'm guessing that's the difference, you need playMusic since it's 16 bit stereo .ogg (I always use mono).

So either record it in mono, or maybe try using playMusic

class CfgMusic
{
tracks[]={};
class song1
{
 name = "song1";
 sound[] = {"sound\miriammakeba.ogg", db+0, 1.0};
};
}:

with

PlayMusic "song1";

Didn't mean to run you in circles, I should have asked about the .ogg earlier...

No it's fine, thanks for the help, I'll test it when I get back from work tomorrow.

Edited by Sky999

Share this post


Link to post
Share on other sites

Well the new script for 'Playmusic' gives me a CTD and this error, so that's out.

Mission4.jpg

I'll try converting it to mono.

EDIT

It already seems to be recorded in mono...

Edited by Sky999

Share this post


Link to post
Share on other sites

Im an idiot... sorry but a typo on my part... last : should be a ;

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

playMusic "song1";

Sorry... still learning this stuff myself. ;)

Share this post


Link to post
Share on other sites
Im an idiot... sorry but a typo on my part... last : should be a ;

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

playMusic "song1";

Sorry... still learning this stuff myself. ;)

No worries, you did a lot better than I ever could.

It works now, but I still get a

sound sound 1 not found
error, but then the song does play. It's strange that it says that, can't think of why.

Thanks for the help.

Share this post


Link to post
Share on other sites

I don't suppose you know a way to stop this message popping up before the sound plays?

sound sound 1 not found

The sound does play, but you can imagine that it takes away the immersion the player has the game freeze to tell him that.

Share this post


Link to post
Share on other sites

Do you have something telling it to play sound 1?

Do you accidentally have it somehow telling it to play the old sound still?

If you are using spaces in sound files, I don't think they work. Use an underscore.

Share this post


Link to post
Share on other sites
Do you have something telling it to play sound 1?

Do you accidentally have it somehow telling it to play the old sound still?

If you are using spaces in sound files, I don't think they work. Use an underscore.

Well the description.ext is still just this:

class CfgMusic

{

tracks[]={};

class song1

{

name = "song1";

sound[] = {"sound\miriammakeba.ogg", db+0, 1.0};

};

};

I just have a little trigger along a road set to Civilian Present and this is in the onAct box:

playMusic "song1";

Share this post


Link to post
Share on other sites

I seem to have this function working ok but been trying it on a dedicated server and don't want them to run more than once if a new player joins server or another player respawns. I placed this "if (!isServer) exitwith {};" in the trigger but it does not seem to play the sound clip at all when trigger activated. When I did not place that on the trigger it worked all could hear clip but when someone else joined the server and triggered it again they were the only one to hear it the rest of us because we had already heard it once could not. These triggered sound clips are all about timing so don't need them playing at wrong time for new players hopefully someone has an idea thanks.

Share this post


Link to post
Share on other sites

This is the code I use for my SP missions and works each and every time:

//Music//
class CfgMusic
{
// List of tracks (.ogg files without the .ogg extension)
tracks[] = {15, 04, BattleDrum, AsianDrums, Taiko, Tatakai, Strings};

// Definition for each sound
class loudtaiko
{
	name = "15"; // Name for mission editor
	sound[] = {\music\15.ogg, db + 10, 1.0};
	titles[] = {0, ""};
};
class 04
{
	name = "04"; // Name for mission editor
	sound[] = {\music\04.ogg, db + 20, 1.0};
	titles[] = {0, ""};
};
class BattleDrum
{
	name = "BattleDrum"; // Name for mission editor
	sound[] = {\music\BattleDrum.ogg, db + 10, 1.0};
	titles[] = {0, ""};
};
class AsianDrums
{
	name = "AsianDrums"; // Name for mission editor
	sound[] = {\music\AsianDrums.ogg, db + 10, 1.0};
	titles[] = {0, ""};
};
class Taiko
{
	name = "Taiko"; // Name for mission editor
	sound[] = {\music\Taiko.ogg, db + 10, 1.0};
	titles[] = {0, ""};
};
class Tatakai
{
	name = "Tatakai"; // Name for mission editor
	sound[] = {\music\Tatakai.ogg, db + 10, 1.0};
	titles[] = {0, ""};
};
class Strings
{
	name = "Strings"; // Name for mission editor
	sound[] = {\music\Strings.ogg, db + 10, 1.0};
	titles[] = {0, ""};
};
};

Try to copy and paste this and replace your songs with mine.

I also notice your thread says MUSIC and not SOUNDS.

You've been trying to do CfgSounds and not CfgMusic.

When you place your Trigger down, you should be able to see your tracks in EFFECTS--->TRACKS then you'll notice your music way way down on the bottom when you scroll down.

Good luck!

Edited by Kommiekat

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  

×