Jump to content
Sign in to follow this  
keat

PlaySound not working.

Recommended Posts

I've gone though numerous tutorials on how to insert your own sounds into a mission but so far I've gotten nowhere.

I place the .ogg sound file into a folder called "sound" in the mission folder and define it in description.ext but whenever I try to use it ingame it says the sound is not found. I'm on the Operation Arrowhead version and I only use Ace 2.

Any ideas? Any known glitches or errors?

Share this post


Link to post
Share on other sites

This goes in the description.ext. Just change the file name and its ok. Then you just have to use playSound "sound_1";

class CfgSounds

{

sounds[] = {};

class sound_1

{

name = "sound_1";

sound[] = {"sounds\sound_1.ogg", db+15, 1.0};

titles[] = {};

};

};

Share this post


Link to post
Share on other sites

I have the exact same problem, tried even different converters.

One of the free converters displays a bitrate error, but I tried it with many different sounds.

I have pretty much given up on custom sounds...

__

created a.wav with audacity, used a free converter to .ogg, placed the .ogg in the mission sound folder and added the sound in the trigger, used the code mentioned above in the .ext and still it can't find the sound.

Share this post


Link to post
Share on other sites

I kind of figured it out.

I ran ArmA without ACE and the sounds worked. I don't really see why it wouldn't work with it. Considering it's a big mod and it could have been fixed in one of the updates.

I'd still like to know how to use it with ACE configured though.

Share this post


Link to post
Share on other sites

I'm not on ACE with OA yet, but I never had any particular sound problems that I could blame on ACE with A2. Maybe the class sound_1 is used somewhere else or in ACE, but I doubt it. Try a better more descriptive name than sound_1 without ACE, and when that works, try it again with ACE. Shouldn't be a problem, but the world can be strange sometimes...

Oh, that was probably not your own, just an example, hehe :)

Without description.ext it's hard to spot any errors for you. And be sure to save mission each time description.ext is updated or changes won't be updated in the preview.

Edited by CarlGustaffa

Share this post


Link to post
Share on other sites

Remember, updates to description.ext won't reflect in the editor till you Save or freshly Load the mission again.

It's possible it worked without ACE, since that was the first time after making the change the description.ext was read properly.

Share this post


Link to post
Share on other sites

Well, the problem came back. It's not working anymore, even though it's still working on the mission I used to test the command. I'm probably making a mistake in the description.ext file when I try to use the command. And yes, I have tried exiting the mission and going back in. Even restarting the application.

So here's my .ext.

Please tell me if you see anything that would cause it not to work!

class CfgSounds
{
sounds[] = {contactleft,supressive,combat1,mandown};


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

};

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

};

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

};

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

}; 
};

My triggers say > esca say3d "mandown"; < ("esca" is the name of a vehicle)

Share this post


Link to post
Share on other sites

I tried your config and it's working for me using my own sounds, and my own description.ext has nothing else but CfgSounds, CfgMusic, CfgSFX, and CfgIdentities (no includes, resources, or other typical defaults).

I even tried enclosing path and filename in "" (like I tend to do myself), and removing the sounds[] = {....} list at the top. Still works (yes, after resave :)) I also tried the db format for volume and using a stereo file. Everything worked except stereo file was played in mono (as expected using say/say3D). Object would even say the sound if I used hideObject on it.

For ref, I mostly use 16bit monosounds at 22050Hz saved as ogg as a fixed bitrate of 128. For testing I made a 2 sec delayed true trigger with act: ttt say3d "mandown" (ttt being the vehicle).

I had no problems with it.

Share this post


Link to post
Share on other sites

Thanks. I'm probably going to try another .mp3 > .ogg converter and try that out.

May be an external thing though, like drivers or something?

Share this post


Link to post
Share on other sites

To me it appears playSound is broken with .ogg files.

I extracted an .ogg file from BI's own PBOs and even those come up with "... not found" errors.

The sounds work from the Effects > Trigger drop down in a trigger though that is problematic since the player will only hear them if he is near the center of the trigger.

FWIW here's my description.ext

class CfgSounds {
   class dj76_radio_walkie
   {
       sounds[] = {"dj76_radio_walkie"};
       name = "Radio Walkie S";
       dj76_radio_walkie[] = {"radio_18s.ogg", 0.316228, 1};
       titles[] = {};
   };
};

class CfgEnvSounds {
   class dj76_radio_walkie_env
   {
       name = "Radio Walkie ENV";
       sound[] = {"radio_18s.ogg", 0.316228, 1};
       soundNight[] = {"radio_18s.ogg", 0.316228, 1};
       volume = "1";
   };
};

class CfgSFX {
   class dj76_radio_walkie_sfx 
   {
sounds[] = {"dj76_radio_walkie_sfx"};
name = "Radio Walkie SFX";
dj76_radio_walkie_sfx[] = {"radio_18s.ogg", 1, 1, 0.6, 0.1, 0.5, 5};
   };
};

In the trigger "On Act." I just use playSound "Radio Walkie S" and it always pops up a message box saying "Sound Radio Walkie S not found".

radio_18s.ogg is in the same dir as desciption.ext and mission.sqm.

Share this post


Link to post
Share on other sites

Not broken. I use cfgSounds myself with playSound without any issues. You should use playSound "classname" instead of playSound "name". Name is only for what shows up in the triggerlist, and can be localized. Same with cfgSFX. These can be created using scripts using createTrigger (and other needed trigger commands) and setSoundEffect, but you have to set the first "" slot to a dummy (i.e. NoSound with no soundfile defined) to avoid getting some error message.

Works in SP and also in MP if playSound is used locally and triggers/setSoundEffect are done locally, with almost no issues in OA, but strange results in Arma2.

Share this post


Link to post
Share on other sites
You should use playSound "classname" instead of playSound "name"

Yeah the strange thing is I tried putting the classname in there instead of the name and it still wouldn't work. Only when I put name to the same string as the classname it started to work. I know this makes no sense but it could also be because you really have to exit out of the Editor completely to get the changes to .ext to show up. Just saving/reloading doesn't seem to cut it for me.

Anyway, thanks to your help I got it working now. Do you know what the numbers after the sound file path mean in BI's own CfgSounds section?

e.g. as in

       sound[] = {
           "sound\radio_18s.ogg", 
           0.632456,
           1,
           30,
           1,
           4,
           8,
           15
       };

The Biki only seems to document 2 numbers out of those...

Share this post


Link to post
Share on other sites

Ahh, that might be some kind of memory thing. I sometimes get the same thing happening, nothing updates, whenever I replace an image file that a dialog uses. Saving and loading does nothing, but for some strange reason if I change the "size" of the picture, then it forces the reload. I don't really know, but it might be related.

Uhm, nope, sorry. I've never seen those numbers before for cfgSounds, except the volume and the first "1". Damn, I really need to have a go at those :p

Share this post


Link to post
Share on other sites

I went through this once myself and Loyalguard helped me solve it, see if it helps you.

description.ext:

class CfgSounds 

{

sounds[] = {}; 

#include "sounds.hpp"

};

sounds.hpp:

class Hotel 

{

name     = "Hotel";
sound[]  = {"\sounds\Hotel.ogg", 1, 1};
titles[] = {};

};

sayhotel.sqf:

// By Loyalguard

while {(player in list trigHotel)} do
{
logicHotel say ["Hotel",5];
sleep 22;
};

exit;

mission.sqm:

class Item14
	{
		position[]={6857.0986,45.861191,2498.5403};
		a=12;
		b=18;
		angle=132;
		rectangular=1;
		activationBy="ANY";
		repeating=1;
		timeoutMin=1;
		timeoutMid=1;
		timeoutMax=1;
		interruptable=1;
		age="UNKNOWN";
		name="trigHotel";
		expCond="player in thisList";
		expActiv="nul = [] execVM ""sayhotel.sqf"";";
		class Effects
		{
		};
	};

Edited by callihn

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  

×