Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Sign in to follow this  
Ex3B

.ogg sound files not playing in mission

Recommended Posts

So I am trying to add a bit of flavor to some missions by adding custom sounds and speech. I am using an online text to speech tool (https://toolsaday.com/text-to-speech), and I placed the resulting .ogg files

in a "sounds" subfolder of the mission folder. (Example .ogg file here: https://www.dropbox.com/scl/fi/jldjkzml1m9usbtkgjrrt/Rifle_1.ogg?rlkey=fykfm37lq5ih7mhklu360we4x&st=8tfagfre&dl=0 )

 

I started just with some NATO brevity codes, as these can also aid in gameplay (an audio notification when the AI wingman fires an ARM is useful, for example).

 

In description.ext of the mission folder I have the following:

Spoiler

class CfgSounds
{
    sounds[] = {}; // OFP required it filled, now it can be empty or absent depending on the game's version

    class Magnum_1
    {
        name = "Magnum_1";                        // display name
        sound[] = { "sounds\Magnum_1.ogg", 1, 1, 100 };    // file, volume, pitch, maxDistance
        titles[] = { 0, "" };            // subtitles
    };
    class Rifle_1
    {
        name = "Rifle_1";                        // display name
        sound[] = { "sounds\Rifle_1.ogg", 1, 1, 100 };    // file, volume, pitch, maxDistance
        titles[] = { 0, "" };            // subtitles
    };
    class Fox3_1
    {
        name = "Fox3_1";                        // display name
        sound[] = { "sounds\Fox3_1.ogg", 1, 1, 100 };    // file, volume, pitch, maxDistance
        titles[] = { 0, "" };            // subtitles
    };
    class Fox2_1
    {
        name = "Fox2_1";                        // display name
        sound[] = { "sounds\Fox2_1.ogg", 1, 1, 100 };    // file, volume, pitch, maxDistance
        titles[] = { 0, "" };            // subtitles
    };
    class Paveway_1
    {
        name = "Paveway_1";                        // display name
        sound[] = { "sounds\Paveway_1.ogg", 1, 1, 100 };    // file, volume, pitch, maxDistance
        titles[] = { 0, "" };            // subtitles
    };
    class Pickle_1
    {
        name = "Pickle_1";                        // display name
        sound[] = { "sounds\Pickle_1.ogg", 1, 1, 100 };    // file, volume, pitch, maxDistance
        titles[] = { 0, "" };            // subtitles
    };
    class Guns_1
    {
        name = "Guns_1";                        // display name
        sound[] = { "sounds\Guns_1.ogg", 1, 1, 100 };    // file, volume, pitch, maxDistance
        titles[] = { 0, "" };            // subtitles
    };
    class Splash_1
    {
        name = "Splash_1";                        // display name
        sound[] = { "sounds\Splash_1.ogg", 1, 1, 100 };    // file, volume, pitch, maxDistance
        titles[] = { 0, "" };            // subtitles
    };
// second voice
    class Magnum_2
    {
        name = "Magnum_2";                        // display name
        sound[] = { "sounds\Magnum_2.ogg", 1, 1, 100 };    // file, volume, pitch, maxDistance
        titles[] = { 0, "" };            // subtitles
    };
    class Rifle_2
    {
        name = "Rifle_2";                        // display name
        sound[] = { "sounds\Rifle_2.ogg", 1, 1, 100 };    // file, volume, pitch, maxDistance
        titles[] = { 0, "" };            // subtitles
    };
    class Fox3_2
    {
        name = "Fox3_2";                        // display name
        sound[] = { "sounds\Fox3_2.ogg", 1, 1, 100 };    // file, volume, pitch, maxDistance
        titles[] = { 0, "" };            // subtitles
    };
    class Fox2_2
    {
        name = "Fox2_2";                        // display name
        sound[] = { "sounds\Fox2_2.ogg", 1, 1, 100 };    // file, volume, pitch, maxDistance
        titles[] = { 0, "" };            // subtitles
    };
    class Paveway_2
    {
        name = "Paveway_2";                        // display name
        sound[] = { "sounds\Paveway_2.ogg", 1, 1, 100 };    // file, volume, pitch, maxDistance
        titles[] = { 0, "" };            // subtitles
    };
    class Pickle_2
    {
        name = "Pickle_2";                        // display name
        sound[] = { "sounds\Pickle_2.ogg", 1, 1, 100 };    // file, volume, pitch, maxDistance
        titles[] = { 0, "" };            // subtitles
    };
    class Guns_2
    {
        name = "Guns_2";                        // display name
        sound[] = { "sounds\Guns_2.ogg", 1, 1, 100 };    // file, volume, pitch, maxDistance
        titles[] = { 0, "" };            // subtitles
    };
    class Splash_2
    {
        name = "Splash_2";                        // display name
        sound[] = { "sounds\Splash_2.ogg", 1, 1, 100 };    // file, volume, pitch, maxDistance
        titles[] = { 0, "" };            // subtitles
    }; 
};

 

I have also tried to make an addon (EX3B_sounds) with the .ogg files in it (as I would like to use the brevity codes across multiple missions, and then just have mission specific .ogg files in the mission folders)

Spoiler

class CfgPatches
{
    class Ex3B_Sounds
    {
        author="$STR_A3_Bohemia_Interactive";
        name="Arma 3 - Sound Effects";
        url="https://www.arma3.com";
        requiredAddons[]=
        {
            "A3_Sounds_F",
        };
        requiredVersion=0.1;
        units[]=
        {
        };
        weapons[]={};
    };
};
class CfgSounds
{
    sounds[] = {}; // OFP required it filled, now it can be empty or absent depending on the game's version

    class EX3B_Magnum_1
    {
        name = "EX3B_Magnum_1";                        // display name
        sound[] = { "EX3B_sounds\Magnum_1.ogg", 1, 1, 100 };    // file, volume, pitch, maxDistance
        titles[] = { 0, "" };            // subtitles
    };
    class EX3B_Rifle_1
    {
        name = "EX3B_Rifle_1";                        // display name
        sound[] = { "EX3B_sounds\Rifle_1.ogg", 1, 1, 100 };    // file, volume, pitch, maxDistance
        titles[] = { 0, "" };            // subtitles
    };
    class EX3B_Fox3_1
    {
        name = "EX3B_Fox3_1";                        // display name
        sound[] = { "EX3B_sounds\Fox3_1.ogg", 1, 1, 100 };    // file, volume, pitch, maxDistance
        titles[] = { 0, "" };            // subtitles
    };
    class EX3B_Fox2_1
    {
        name = "EX3B_Fox2_1";                        // display name
        sound[] = { "EX3B_sounds\Fox2_1.ogg", 1, 1, 100 };    // file, volume, pitch, maxDistance
        titles[] = { 0, "" };            // subtitles
    };
    class EX3B_Paveway_1
    {
        name = "EX3B_Paveway_1";                        // display name
        sound[] = { "EX3B_sounds\Paveway_1.ogg", 1, 1, 100 };    // file, volume, pitch, maxDistance
        titles[] = { 0, "" };            // subtitles
    };
    class EX3B_Pickle_1
    {
        name = "EX3B_Pickle_1";                        // display name
        sound[] = { "EX3B_sounds\Pickle_1.ogg", 1, 1, 100 };    // file, volume, pitch, maxDistance
        titles[] = { 0, "" };            // subtitles
    };
    class EX3B_Guns_1
    {
        name = "EX3B_Guns_1";                        // display name
        sound[] = { "EX3B_sounds\Guns_1.ogg", 1, 1, 100 };    // file, volume, pitch, maxDistance
        titles[] = { 0, "" };            // subtitles
    };
    class EX3B_Splash_1
    {
        name = "EX3B_Splash_1";                        // display name
        sound[] = { "EX3B_sounds\Splash_1.ogg", 1, 1, 100 };    // file, volume, pitch, maxDistance
        titles[] = { 0, "" };            // subtitles
    };
// second voice
    class EX3B_Magnum_2
    {
        name = "EX3B_Magnum_2";                        // display name
        sound[] = { "EX3B_sounds\Magnum_2.ogg", 1, 1, 100 };    // file, volume, pitch, maxDistance
        titles[] = { 0, "" };            // subtitles
    };
    class EX3B_Rifle_2
    {
        name = "EX3B_Rifle_2";                        // display name
        sound[] = { "EX3B_sounds\Rifle_2.ogg", 1, 1, 100 };    // file, volume, pitch, maxDistance
        titles[] = { 0, "" };            // subtitles
    };
    class EX3B_Fox3_2
    {
        name = "EX3B_Fox3_2";                        // display name
        sound[] = { "EX3B_sounds\Fox3_2.ogg", 1, 1, 100 };    // file, volume, pitch, maxDistance
        titles[] = { 0, "" };            // subtitles
    };
    class EX3B_Fox2_2
    {
        name = "EX3B_Fox2_2";                        // display name
        sound[] = { "EX3B_sounds\Fox2_2.ogg", 1, 1, 100 };    // file, volume, pitch, maxDistance
        titles[] = { 0, "" };            // subtitles
    };
    class EX3B_Paveway_2
    {
        name = "EX3B_Paveway_2";                        // display name
        sound[] = { "EX3B_sounds\Paveway_2.ogg", 1, 1, 100 };    // file, volume, pitch, maxDistance
        titles[] = { 0, "" };            // subtitles
    };
    class EX3B_Pickle_2
    {
        name = "EX3B_Pickle_2";                        // display name
        sound[] = { "EX3B_sounds\Pickle_2.ogg", 1, 1, 100 };    // file, volume, pitch, maxDistance
        titles[] = { 0, "" };            // subtitles
    };
    class EX3B_Guns_2
    {
        name = "EX3B_Guns_2";                        // display name
        sound[] = { "EX3B_sounds\Guns_2.ogg", 1, 1, 100 };    // file, volume, pitch, maxDistance
        titles[] = { 0, "" };            // subtitles
    };
    class EX3B_Splash_2
    {
        name = "EX3B_Splash_2";                        // display name
        sound[] = { "EX3B_sounds\Splash_2.ogg", 1, 1, 100 };    // file, volume, pitch, maxDistance
        titles[] = { 0, "" };            // subtitles
    }; 
};

 

In either case, I have an event handler that will display a message in sidechat, and use the playsound command.

Spoiler

When trying to refer to sounds in EX3B_sounds:

 

this addEventHandler ["Fired", 
 {  
  if (_this select 1 == "EX3B_gatling_20mm") then { playSound "EX3B_Guns_1"; player_1 sideChat "Guns Guns Guns";};  
  if (_this select 1 == "EX3B_gatling_API_HE_20mm") then { playSound "EX3B_Guns_1"; player_1 sideChat "Guns Guns Guns";}; 
  if (_this select 1 == "EX3B_gatling_25mm") then { playSound "EX3B_Guns_1"; player_1 sideChat "Guns Guns Guns";}; 
  if (_this select 1 == "EX3B_gatling_API_HE_25mm") then { playSound "EX3B_Guns_1"; player_1 sideChat "Guns Guns Guns";}; 
 
  if (_this select 1 == "weapon_AMRAAMLauncher") then { playSound "EX3B_Fox3_1"; player_1 sideChat "Fox 3";}; 
 
  if (_this select 1 == "weapon_BIM9xLauncher") then { playSound "EX3B_Fox2_1"; player_1 sideChat "Fox 2";}; 
  if (_this select 1 == "missiles_ASRAAM") then { playSound "EX3B_Fox2_1"; player_1 sideChat "Fox 2";}; 
 
  if (_this select 1 == "weapon_ALARMLauncher") then { playSound "EX3B_Magnum_1"; player_1 sideChat "Magnum";}; 
  if (_this select 1 == "weapon_HARMLauncher") then { playSound "EX3B_Magnum_1"; player_1 sideChat "Magnum";}; 
 
  if (_this select 1 == "missiles_SCALPEL") then { playSound "EX3B_Rifle_1"; player_1 sideChat "Rifle";}; 
  if (_this select 1 == "missiles_DAGR_HE") then { playSound "EX3B_Rifle_1"; player_1 sideChat "Rifle";}; 
  if (_this select 1 == "missiles_DAGR_HEAT") then { playSound "EX3B_Rifle_1"; player_1 sideChat "Rifle";}; 
  if (_this select 1 == "missiles_DAGR") then { playSound "EX3B_Rifle_1"; player_1 sideChat "Rifle";}; 
  if (_this select 1 == "weapon_AGM_65Launcher") then { playSound "EX3B_Rifle_1"; player_1 sideChat "Rifle";}; 
 
  if (_this select 1 == "EX3B_weapon_JSOWLauncher") then { playSound "EX3B_Paveway_1"; player_1 sideChat "Paveway";}; 
  if (_this select 1 == "weapon_SDBLauncher") then { playSound "EX3B_Paveway_1"; player_1 sideChat "Paveway";}; 
  if (_this select 1 == "weapon_GBU12Launcher") then { playSound "EX3B_Paveway_1"; player_1 sideChat "Paveway";}; 
 }]; 

 

and when trying to refer to sounds in the mission folder:

this addEventHandler ["Fired", 
 {  
  if (_this select 1 == "EX3B_gatling_20mm") then { playSound "Guns_1"; player_1 sideChat "Guns Guns Guns";};  
  if (_this select 1 == "EX3B_gatling_API_HE_20mm") then { playSound "Guns_1"; player_1 sideChat "Guns Guns Guns";}; 
  if (_this select 1 == "EX3B_gatling_25mm") then { playSound "Guns_1"; player_1 sideChat "Guns Guns Guns";}; 
  if (_this select 1 == "EX3B_gatling_API_HE_25mm") then { playSound "Guns_1"; player_1 sideChat "Guns Guns Guns";}; 
 
  if (_this select 1 == "weapon_AMRAAMLauncher") then { playSound "Fox3_1"; player_1 sideChat "Fox 3";}; 
 
  if (_this select 1 == "weapon_BIM9xLauncher") then { playSound "Fox2_1"; player_1 sideChat "Fox 2";}; 
  if (_this select 1 == "missiles_ASRAAM") then { playSound "Fox2_1"; player_1 sideChat "Fox 2";}; 
 
 
  if (_this select 1 == "weapon_ALARMLauncher") then { playSound "Magnum_1"; player_1 sideChat "Magnum";}; 
  if (_this select 1 == "weapon_HARMLauncher") then { playSound "Magnum_1"; player_1 sideChat "Magnum";}; 
 
  if (_this select 1 == "missiles_SCALPEL") then { playSound "Rifle_1"; player_1 sideChat "Rifle";}; 
  if (_this select 1 == "missiles_DAGR_HE") then { playSound "Rifle_1"; player_1 sideChat "Rifle";}; 
  if (_this select 1 == "missiles_DAGR_HEAT") then { playSound "Rifle_1"; player_1 sideChat "Rifle";}; 
  if (_this select 1 == "missiles_DAGR") then { playSound "Rifle_1"; player_1 sideChat "Rifle";}; 
  if (_this select 1 == "weapon_AGM_65Launcher") then { playSound "Rifle_1"; player_1 sideChat "Rifle";}; 
 
  if (_this select 1 == "EX3B_weapon_JSOWLauncher") then { playSound "Paveway_1"; player_1 sideChat "Paveway";}; 
  if (_this select 1 == "weapon_SDBLauncher") then { playSound "Paveway_1"; player_1 sideChat "Paveway";}; 
  if (_this select 1 == "weapon_GBU12Launcher") then { playSound "Paveway_1"; player_1 sideChat "Paveway";}; 
 }]; 
 

 

The sidechat message displays correcty, so the event handler seems to be working correctly

 

For some reason no error message pops up, but sounds don't play.

Can anyone tell me what I am doing wrong?

Share this post


Link to post
Share on other sites

Hey, to be sure your EH is working, try to remplace your "playsound" with a simple hint "test 1", hint "test 2". If Hints are showing, problem might be in your description.ext.

 

I can't clearly see why, but if it can help you, this is a part of description.ext working well :

 

class CfgSounds
{
        sounds[] = {"class1", "class2"};

        class class1
        {
                name = "class1";
                sound[] = {"sound\class1.ogg", db+5, 1.0};
                titles[] = {};
        };

        class class2
        {
                name = "class2";
                sound[] = {"sound\class2.ogg", db+5, 1.0};
                titles[] = {};
        };


};

 

It should do the work ! Good luck 😊

  • Like 1

Share this post


Link to post
Share on other sites

@Necropaulo

"Try to remplace your "playsound" with a simple hint "test 1", hint "test 2""

As I said, the sidechat messages performed that function, the EH works.

I changed the file toa .was, and referred to it, I barely heard it:

"sounds\Magnum_1.ogg", 1, 1, 100

Changed to

sounds\Magnum_1.wss", 5, 1, 100000

worked (or was it "sounds\Magnum_1", 5, 1, 10000)

 

Share this post


Link to post
Share on other sites

I haven't messed with sounds in a description.ext file (yet), as I've just gone the lazy way and done it through a trigger via playsound3D and assigned it to a unit.  I say that because I'm not smart if the max distance works the same way, but have you tried setting max difference to "0"?  On playsound3d, that just makes it heard everywhere...helpful if a unit is in a vehicle.

 

You've probably already done this, but I was also going to suggest you make sure your .ogg file is a mono file.  From my research in trying to get sounds to work, I found someone saying that's a requirement to play correctly.

Share this post


Link to post
Share on other sites
Sign in to follow this  

×