Home   Help Search Login Register  

Author Topic: Sounds aren't working  (Read 1409 times)

0 Members and 1 Guest are viewing this topic.

Serial Killer

  • Guest
Sounds aren't working
« on: 06 Aug 2005, 16:16:02 »
After I placed some custom fonts, etc. on my description.ext file, the sounds aren't working anymore. Here's the description.ext file:

Quote
#define FontS "tahomaB24"
#define FontM "tahomaB36"
#define FontP "tahomaB48"
#define FontHTML "courierNewB64"
#define FontHTMLBold "courierNewB64"
#define FontMAP "courierNewB64"
#define FontMAIN "SteelfishB64"
#define FontMAINCZ "SteelfishB64CE"
#define FontTITLE "SteelfishB128"
#define FontTITLEHalf "SteelfishB64"
#define FontBOOK "garamond64"
#define FontNOTES "AudreysHandI48"


// Control types
#define CT_STATIC                  0
#define CT_HTML                     9

//   #define CT_OBJECT                  80
//   #define CT_OBJECT_CONTAINER               82

//   #define CT_3DSTATIC                  20
//   #define CT_3DHTML                  23

// Static styles
#define ST_LEFT         0
#define ST_RIGHT      1
#define ST_CENTER      2
#define ST_UP         3
#define ST_DOWN         4
#define ST_VCENTER      5

#define ST_SINGLE      0
#define ST_MULTI      16
#define ST_PICTURE      48
#define ST_FRAME      64

#define ST_HUD_BACKGROUND   128
#define ST_TILE_PICTURE      144
#define ST_WITH_RECT      160
#define ST_LINE         176

#define ST_SHADOW      256
#define ST_NO_RECT      512



class RscPicture
{
   type = CT_STATIC;
   idc = -1;
   style = ST_PICTURE;
   colorBackground[] = {0, 0, 0, 0};
   colorText[] = {1, 1, 1, 1};
   font = FontS;
   size = 0;
};

class RscText
{
   type = CT_STATIC;
   idc = -1;
   style = ST_LEFT;
   h = 0.04;
   colorBackground[] = {0, 0, 0, 0};
   colorText[] = {1, 1, 1, 1};
   font = FontS;
   size = 1;
};

class RscBackground
{
   type = CT_STATIC;
   idc = -1;
   style = ST_LEFT;
   colorBackground[] = {0, 1, 0, 1};
   colorText[] = {1, 1, 1, 1};
   font = FontS;
   size = 0;
   text = "";
};

class RscHTML
{
   type = CT_HTML;
   idc = -1;
   style = 0;
   colorBackground[] = {1, 1, 1, 1};
   colorText[] = {0, 0, 0, 1};
   colorBold[] = {0, 0, 0.2, 1};
   colorLink[] = {0.4, 0.4, 0.8, 1};
   colorLinkActive[] = {0.8, 0.35, 0.48, 1};

   // styles
   class H1
   {
      font = FontHTML;
      fontBold = FontHTMLBold;
      size = 1.0;
   };
   class H2
   {
      font = FontHTML;
      fontBold = FontHTMLBold;
      size = 0.7;
   };
   class H3
   {
      font = FontHTML;
      fontBold = FontHTMLBold;
      size = 0.5;
   };
   class H4
   {
      font = FontHTML;
      fontBold = FontHTMLBold;
      size = 0.4;
   };
   class H5
   {
      font = FontBOOK;
      fontBold = FontBOOK;
      size = 0.6;
   };
   class H6
   {
      font = FontNOTES;
      fontBold = FontNOTES;
      size = 0.7;
   };
   class P
   {
      font = FontHTML;
      fontBold = FontHTML;
      size = 0.47;
   };
};



class RscTitles
{
   


   
   
   class Author
   {
      name = "Author";
      duration = 7;
      idd = -1;
      movingEnable = false;
      
      controls[]=
      {
         name1
      };
      
      class name1 : RscText
      {
         style = ST_MULTI + ST_CENTER + ST_NO_RECT;
         lineSpacing = 1.0;
         text = "Serial Killer presents...";
         x = 0.15; y = 0.50; w = 0.65; h = 0.4;
         colorText[] = {1.0, 1.0, 1.0, 1};
         font = FontNOTES;
         sizeEx = 1.5 * 0.1;
         size = 1.5;
      };
   };
   class Mission
   {
      name = "Mission";
      duration = 7;
      idd = -1;
      movingEnable = false;
      
      controls[]=
      {
         name1
      };
      
      class name1 : RscText
      {
         style = ST_MULTI + ST_CENTER + ST_NO_RECT;
         lineSpacing = 1.0;
         text = "A big supply";
         x = 0.15; y = 0.40; w = 0.65; h = 0.4;
         colorText[] = {0,0.250980,0.501961,1};
         font = FontTITLE;
         sizeEx = 1.5 * 0.1;
         size = 2.5;
      };
   };
   class Complete
   {
      name = "Complete";
      duration = 2;
      idd = -1;
      movingEnable = false;
      
      controls[]=
      {
         name1
      };
      
      class name1 : RscText
      {
         style = ST_MULTI + ST_CENTER + ST_NO_RECT + ST_SHADOW;
         lineSpacing = 1.0;
         text = "Mission completed";
         x = 0.15; y = 0.75; w = 0.65; h = 0.4;
         colorText[] = {0.8, 0.35, 0.48, 1};
         font = FontMAINCZ;
         sizeEx = 1.5 * 0.1;
         size = 1;
      };
   };
   class Failed
   {
      name = "Failed";
      duration = 2;
      idd = -1;
      movingEnable = false;
      
      controls[]=
      {
         name1
      };
      
      class name1 : RscText
      {
         style = ST_MULTI + ST_CENTER + ST_NO_RECT + ST_SHADOW;
         lineSpacing = 1.0;
         text = "Mission failed";
         x = 0.15; y = 0.75; w = 0.65; h = 0.4;
         colorText[] = {1.0, 1.0, 1.0, 1};
         font = FontMAINCZ;
         sizeEx = 1.5 * 0.1;
         size = 1;
      };
   };


OnLoadIntro="Please wait...";
OnLoadMission="Please wait...";

class CfgSounds
{
sounds[] = {1,2,3,4,5,6,7};
class 1
{
name = "1";
sound[] = {"\sound\1.ogg", db-40, 1.0};
titles[] = {0, "I'm not gonna show this to public :O"};
};
class 2
{
name = "2";
sound[] = {"\sound\2.ogg", db-40, 1.0};
titles[] = {0, "I'm not gonna show this to public :O"};
};
class 3
{
name = "3";
sound[] = {"\sound\3.ogg", db-40, 1.0};
titles[] = {0, "I'm not gonna show this to public :O"};
};
class 4
{
name = "4";
sound[] = {"\sound\4.ogg", db-40, 1.0};
titles[] = {0, "I'm not gonna show this to public :O"};
};
class 5
{
name = "5";
sound[] = {"\sound\5.ogg", db-40, 1.0};
titles[] = {0, "I'm not gonna show this to public :O"};
};
class 6
{
name = "6";
sound[] = {"\sound\6.ogg", db-40, 1.0};
titles[] = {0, "I'm not gonna show this to public :O"};
};
class 7
{
name = "1";
sound[] = {"\sound\7.ogg", db-40, 1.0};
titles[] = {0, "I'm not gonna show this to public :O"};
};
};

I knew that there will be some problems because this is my first time when I add some custom fonts and stuff on my mission. :-[ The fonts works perfectly, btw, but the sounds aren't.

Offline 456820

  • Contributing Member
  • **
Re:Sounds aren't working
« Reply #1 on: 06 Aug 2005, 16:34:15 »
well if the sounds worked before you put the fonts in then try my idea wich i do when that happens to me because when i add new things i ususally get error messages about things that didnt work
take the bottom bit and oput it on top for example your font go first now copy and paste your sounds above the font class'
ill do it for yo to save confusion

Code: [Select]
OnLoadIntro="Please wait...";
OnLoadMission="Please wait...";

class CfgSounds
{
sounds[] = {1,2,3,4,5,6,7};
class 1
{
name = "1";
sound[] = {"\sound\1.ogg", db-40, 1.0};
titles[] = {0, "I'm not gonna show this to public :O"};
};
class 2
{
name = "2";
sound[] = {"\sound\2.ogg", db-40, 1.0};
titles[] = {0, "I'm not gonna show this to public :O"};
};
class 3
{
name = "3";
sound[] = {"\sound\3.ogg", db-40, 1.0};
titles[] = {0, "I'm not gonna show this to public :O"};
};
class 4
{
name = "4";
sound[] = {"\sound\4.ogg", db-40, 1.0};
titles[] = {0, "I'm not gonna show this to public :O"};
};
class 5
{
name = "5";
sound[] = {"\sound\5.ogg", db-40, 1.0};
titles[] = {0, "I'm not gonna show this to public :O"};
};
class 6
{
name = "6";
sound[] = {"\sound\6.ogg", db-40, 1.0};
titles[] = {0, "I'm not gonna show this to public :O"};
};
class 7
{
name = "1";
sound[] = {"\sound\7.ogg", db-40, 1.0};
titles[] = {0, "I'm not gonna show this to public :O"};
};
};

#define FontS "tahomaB24"
#define FontM "tahomaB36"
#define FontP "tahomaB48"
#define FontHTML "courierNewB64"
#define FontHTMLBold "courierNewB64"
#define FontMAP "courierNewB64"
#define FontMAIN "SteelfishB64"
#define FontMAINCZ "SteelfishB64CE"
#define FontTITLE "SteelfishB128"
#define FontTITLEHalf "SteelfishB64"
#define FontBOOK "garamond64"
#define FontNOTES "AudreysHandI48"


// Control types
#define CT_STATIC                  0
#define CT_HTML                     9

//   #define CT_OBJECT                  80
//   #define CT_OBJECT_CONTAINER               82

//   #define CT_3DSTATIC                  20
//   #define CT_3DHTML                  23

// Static styles
#define ST_LEFT         0
#define ST_RIGHT      1
#define ST_CENTER      2
#define ST_UP         3
#define ST_DOWN         4
#define ST_VCENTER      5

#define ST_SINGLE      0
#define ST_MULTI      16
#define ST_PICTURE      48
#define ST_FRAME      64

#define ST_HUD_BACKGROUND   128
#define ST_TILE_PICTURE      144
#define ST_WITH_RECT      160
#define ST_LINE         176

#define ST_SHADOW      256
#define ST_NO_RECT      512



class RscPicture
{
   type = CT_STATIC;
   idc = -1;
   style = ST_PICTURE;
   colorBackground[] = {0, 0, 0, 0};
   colorText[] = {1, 1, 1, 1};
   font = FontS;
   size = 0;
};

class RscText
{
   type = CT_STATIC;
   idc = -1;
   style = ST_LEFT;
   h = 0.04;
   colorBackground[] = {0, 0, 0, 0};
   colorText[] = {1, 1, 1, 1};
   font = FontS;
   size = 1;
};

class RscBackground
{
   type = CT_STATIC;
   idc = -1;
   style = ST_LEFT;
   colorBackground[] = {0, 1, 0, 1};
   colorText[] = {1, 1, 1, 1};
   font = FontS;
   size = 0;
   text = "";
};

class RscHTML
{
   type = CT_HTML;
   idc = -1;
   style = 0;
   colorBackground[] = {1, 1, 1, 1};
   colorText[] = {0, 0, 0, 1};
   colorBold[] = {0, 0, 0.2, 1};
   colorLink[] = {0.4, 0.4, 0.8, 1};
   colorLinkActive[] = {0.8, 0.35, 0.48, 1};

   // styles
   class H1
   {
      font = FontHTML;
      fontBold = FontHTMLBold;
      size = 1.0;
   };
   class H2
   {
      font = FontHTML;
      fontBold = FontHTMLBold;
      size = 0.7;
   };
   class H3
   {
      font = FontHTML;
      fontBold = FontHTMLBold;
      size = 0.5;
   };
   class H4
   {
      font = FontHTML;
      fontBold = FontHTMLBold;
      size = 0.4;
   };
   class H5
   {
      font = FontBOOK;
      fontBold = FontBOOK;
      size = 0.6;
   };
   class H6
   {
      font = FontNOTES;
      fontBold = FontNOTES;
      size = 0.7;
   };
   class P
   {
      font = FontHTML;
      fontBold = FontHTML;
      size = 0.47;
   };
};



class RscTitles
{
   


   
   
   class Author
   {
      name = "Author";
      duration = 7;
      idd = -1;
      movingEnable = false;
     
      controls[]=
      {
         name1
      };
     
      class name1 : RscText
      {
         style = ST_MULTI + ST_CENTER + ST_NO_RECT;
         lineSpacing = 1.0;
         text = "Serial Killer presents...";
         x = 0.15; y = 0.50; w = 0.65; h = 0.4;
         colorText[] = {1.0, 1.0, 1.0, 1};
         font = FontNOTES;
         sizeEx = 1.5 * 0.1;
         size = 1.5;
      };
   };
   class Mission
   {
      name = "Mission";
      duration = 7;
      idd = -1;
      movingEnable = false;
     
      controls[]=
      {
         name1
      };
     
      class name1 : RscText
      {
         style = ST_MULTI + ST_CENTER + ST_NO_RECT;
         lineSpacing = 1.0;
         text = "A big supply";
         x = 0.15; y = 0.40; w = 0.65; h = 0.4;
         colorText[] = {0,0.250980,0.501961,1};
         font = FontTITLE;
         sizeEx = 1.5 * 0.1;
         size = 2.5;
      };
   };
   class Complete
   {
      name = "Complete";
      duration = 2;
      idd = -1;
      movingEnable = false;
     
      controls[]=
      {
         name1
      };
     
      class name1 : RscText
      {
         style = ST_MULTI + ST_CENTER + ST_NO_RECT + ST_SHADOW;
         lineSpacing = 1.0;
         text = "Mission completed";
         x = 0.15; y = 0.75; w = 0.65; h = 0.4;
         colorText[] = {0.8, 0.35, 0.48, 1};
         font = FontMAINCZ;
         sizeEx = 1.5 * 0.1;
         size = 1;
      };
   };
   class Failed
   {
      name = "Failed";
      duration = 2;
      idd = -1;
      movingEnable = false;
     
      controls[]=
      {
         name1
      };
     
      class name1 : RscText
      {
         style = ST_MULTI + ST_CENTER + ST_NO_RECT + ST_SHADOW;
         lineSpacing = 1.0;
         text = "Mission failed";
         x = 0.15; y = 0.75; w = 0.65; h = 0.4;
         colorText[] = {1.0, 1.0, 1.0, 1};
         font = FontMAINCZ;
         sizeEx = 1.5 * 0.1;
         size = 1;
      };
   };

you should of noticed its back to front i usually od that and works perfectly again
have a go if that doesnt work i re wrote all my sound class' well i actually used chris' ofp editor to do that for me

anyway hope it helps

Serial Killer

  • Guest
Re:Sounds aren't working
« Reply #2 on: 06 Aug 2005, 16:51:00 »
Wow, it's working. :o

Cheers! :)

Serial Killer

  • Guest
Re:Sounds aren't working
« Reply #3 on: 07 Aug 2005, 14:00:51 »
Ok, didn't want to start new thread so I post this here.
When I try to play those sounds by 'playSound "sound_name"', I cant hear anything. I just see the texts what appears with the sound but sounds aren't working. Any advices? :'(

Offline 456820

  • Contributing Member
  • **
Re:Sounds aren't working
« Reply #4 on: 07 Aug 2005, 14:02:46 »
well in the description.ext where it says 'db'
for example
Quote
sound[] = {"\sound\3.ogg", db-40, 1.0};
you have that and it says db-40
try changing that bit to
db+0

if its too low its hard to hear some sounds

Serial Killer

  • Guest
Re:Sounds aren't working
« Reply #5 on: 07 Aug 2005, 14:13:10 »
Hmm... Not working. :-\ I tried db+0, db+10, and few others, but I still cant hear anything.
Could it be because I made a .lip file from that sound...?

Dane

  • Guest
Re:Sounds aren't working
« Reply #6 on: 07 Aug 2005, 18:17:16 »
Are you sure your sounds are in the right format? when i compress soundfiles to .ogg i always use Frequence 24000hz and Mono because that always works for me.
Music can be stereo but sound files not and a frequence not over something? (i can't remember).

Edit. Nvm. Didn' read the first post sorry.
« Last Edit: 07 Aug 2005, 18:20:06 by DaneDK »

Serial Killer

  • Guest
Re:Sounds aren't working
« Reply #7 on: 08 Aug 2005, 10:26:04 »
Can anyone help me? :'(

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:Sounds aren't working
« Reply #8 on: 08 Aug 2005, 12:45:31 »
These are some of the things that normally trip me up:
  • Sound file format. Make sure it's Mono... can be almost any freq as far as I know (I have used 11,500Hz right up to 44,100Hz with no problems).
  • Sound name in the .ext file is the exact file name, including extension
  • The sound file is in the right place. If you put it in a folder called 'sound' right off your mission folder, you should only need to put the sound file name in quotes (I highly suspect that this could be your problem there ;) ).
  • The sound file size is above 10-12Kb. I've had issues where small .ogg files just won't play for no good reason. I'm not sure why this is, and there doesn't seem to be a set file size limit (I've had some 8kb files play fine, when others wouldn't...)
Anyway, check all of those, or at least let us know which ones you are having issues with and we can help you further ;)

Serial Killer

  • Guest
Re:Sounds aren't working
« Reply #9 on: 08 Aug 2005, 13:08:58 »
Ok...

My sound file is mono, .ogg, 44100Hz, it's inside of a folder called 'sound' and it's size is 32kb.

I just noticed that the sound works perfectly if I play it by trigger. :o Wtf..?

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:Sounds aren't working
« Reply #10 on: 09 Aug 2005, 02:39:26 »
In your class definition in your .ext, try getting rid of the directory.

eg.

sound[] = {"3.ogg", db-40, 1.0};

Provided you put the .ogg file in the sound directory, you shouldn't need to specify the path...


Serial Killer

  • Guest
Re:Sounds aren't working
« Reply #11 on: 09 Aug 2005, 10:15:56 »
Cool, it's working. Thanks!