Home   Help Search Login Register  

Author Topic: Sound Problem  (Read 1343 times)

0 Members and 1 Guest are viewing this topic.

Offline JamesF1

  • Editors Depot Staff
  • *****
    • JamesBurgess.co.uk
Sound Problem
« on: 25 Nov 2008, 15:07:01 »
Sorry if I'm being entirely dumb here, but I've spent a good couple of hours trying to work this out, and I can't seem to find the answer. I hope someone can help.

I'm trying to set off a sound using a trigger, which all works fine-and-well with the built-in sounds, but when I try to use my own sound, nothing happens.  The sound has the correct properties, etc. (even tried a working sound from a tutorial I found), and I've got this in my Description.ext:
Code: [Select]
class CfgSounds
{
sounds[] =
{
PunchFace
};

class PunchFace
{
name = "PunchFace";
sound[] = {"\Sound\punchSound.ogg", db-10, 1.0};
titles[] =
{
};
};
};

And then I've got this in a script, that's executed by an action:
Code: [Select]
// Punch Sound
playPunch = true;
publicVariable "playPunch";

A trigger then detects the playPunch = true, and attempts to play the sound using:
Code: [Select]
playSound "PunchFace";
However, I never hear anything.  If I change it to a built-in sound, such as "Alarm", it works adequately.

Using the following also causes the same problem:
Code: [Select]
this say "PunchFace";
What am I doing wrong?  I'm pulling my hair out here. :(

Thanks in advance! :)

Edit: I should probably note that I've tried all sorts of volume settings, from db-10 and db+10 to 100.  Still, nothing.

« Last Edit: 25 Nov 2008, 15:19:36 by JamesF1 »

Offline savedbygrace

  • Intel Depot
  • Administrator
  • *****
  • Be swift to hear...slow to speak...slow to wrath.
Re: Sound Problem
« Reply #1 on: 25 Nov 2008, 15:27:31 »
Code: [Select]
sound[] = {"\Sound\punchSound.ogg", db-10, 1.0};
Remove the quotes from this line and you should be good to go.

Offline JamesF1

  • Editors Depot Staff
  • *****
    • JamesBurgess.co.uk
Re: Sound Problem
« Reply #2 on: 25 Nov 2008, 15:32:11 »
Thanks but, alas, I'm still getting no sound at all :(

Offline savedbygrace

  • Intel Depot
  • Administrator
  • *****
  • Be swift to hear...slow to speak...slow to wrath.
Re: Sound Problem
« Reply #3 on: 25 Nov 2008, 15:39:11 »
Try this
Code: [Select]
class PunchFace
{
name = "PunchFace";
sound[] = {\Sound\punchSound.ogg, db-10, 1.0};
titles[] = {0, ""};
};   
Notice the brackets behind the      titles [] =

Offline JamesF1

  • Editors Depot Staff
  • *****
    • JamesBurgess.co.uk
Re: Sound Problem
« Reply #4 on: 25 Nov 2008, 15:41:30 »
It works now :D  Thank you very much  :clap:

Offline savedbygrace

  • Intel Depot
  • Administrator
  • *****
  • Be swift to hear...slow to speak...slow to wrath.
Re: Sound Problem
« Reply #5 on: 25 Nov 2008, 15:42:41 »
Glad I could help. Happy editing.