Home   Help Search Login Register  

Author Topic: Hearing custom sound from a certain point  (Read 1717 times)

0 Members and 1 Guest are viewing this topic.

Offline JasonO

  • OFPEC Patron
  • ****
  • Oh no...
    • The New Life RPG
Hearing custom sound from a certain point
« on: 11 Jun 2006, 19:39:01 »
Hi
I have a custom ogg that I would like to play. This is ok, but how would I make it so it plays from a certain place. What I want is a bank alarm to go off when a trigger is done.
But instead of hearing the sound where ever you are, I would like you to be near to it and if you face it, it would be louder.
I know this is possible, because when playing 'Crime City', when the bank alarm goes off you can hear the sound coming from the bank.

I have tried multiple ways, so does anyone know a real solution?  ???

All help apreciated. Thanks ;)

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: Hearing custom sound from a certain point
« Reply #1 on: 11 Jun 2006, 20:02:36 »
if you define your custom sound with a name, you should see it listed in the trigger's effects bit under 'trigger'. that way when the trigger fires, the sound will should play at the trigger's position.

Offline JasonO

  • OFPEC Patron
  • ****
  • Oh no...
    • The New Life RPG
Re: Hearing custom sound from a certain point
« Reply #2 on: 11 Jun 2006, 20:07:16 »
Thanks for your reply.

Ive checked the trigger drop down in the trigger effects, but my ogg dosent apear. Do I have to define it in the description.ext for it to apear?

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: Hearing custom sound from a certain point
« Reply #3 on: 11 Jun 2006, 20:20:04 »
oh yes. only way to get it into the game as far as i can tell. here's a sample:

Code: [Select]
class CfgSounds
{
sounds[] = { my_sound};

class my_sound
{
name = "my_sound";
sound[] = {"my_sound.ogg", db-05, 1.0};
titles[] = {};
};

};

save that in the description file, resave your mission, and when you next look in the trigger effects box my_sound should be there.

Offline JasonO

  • OFPEC Patron
  • ****
  • Oh no...
    • The New Life RPG
Re: Hearing custom sound from a certain point
« Reply #4 on: 11 Jun 2006, 20:38:21 »
I know that is slightly correct and that this is the one to make it appear in trigger drop down box (read another thread)

Code: [Select]
class CfgSFX
{
   sounds[] = {bankalarm};
   
   class alarm
   {
      name = "bankalarm";
      sounds[]={sound1};
      sound1[]={"bankalarm.ogg", db0,1, 1, 1, 1, 1};
      empty[]= {, , , , 1 , 5, 20};
   };
};

Its there, but when activated nothing happens. Ive put hint"test" in the activation field to make sure its defnitly activating.

This is where I dont understand why it isnt working

Offline The-Architect

  • Former Staff
  • ****
  • Bite my shiny metal...
    • Bob's Un-official Flashpoint Page
Re: Hearing custom sound from a certain point
« Reply #5 on: 11 Jun 2006, 20:40:39 »
Try it Bedges' way, rather than SFX, use sound. then see if you're still having trouble.
James Andrew Wilkinson 1977 - 2005 R.I.P.
"If it ain't the friggin' incoming it's the friggin' outgoing. Only difference is who gets the friggin' grease, and that ain't no friggin' difference at all."

Offline JasonO

  • OFPEC Patron
  • ****
  • Oh no...
    • The New Life RPG
Re: Hearing custom sound from a certain point
« Reply #6 on: 11 Jun 2006, 21:06:55 »
That will make the sound play, but then it takes me back to square one.

I need the sound to be heard in a certain direction, so that the sound is playing from a point. If it is a 'Trigger' sound then I know it will do this. But for some reason the sound does not play when I use CfgSFX.

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: Hearing custom sound from a certain point
« Reply #7 on: 11 Jun 2006, 21:17:34 »
soooo.... use CfgSounds.  :-\

is there a specific reason you want to use CfgSFX?

Offline JasonO

  • OFPEC Patron
  • ****
  • Oh no...
    • The New Life RPG
Re: Hearing custom sound from a certain point
« Reply #8 on: 11 Jun 2006, 21:24:21 »
So people at a far distance cant hear the bank being robbed.

I was also going to use a picklocking sound and use the same princible but I might just get the unit to say that.

I am not saying I want to use cfgSFX, but that, and CfgEnvSounds are the only ways to making a sound be heared from a certain point.

Cfg sounds just makes the sound heard anywhere you are on an island.

Thanks for all your help.
« Last Edit: 11 Jun 2006, 21:26:16 by JasonO »

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: Hearing custom sound from a certain point
« Reply #9 on: 11 Jun 2006, 22:23:37 »
um, that's not strictly true my friend. and i must admit i'm in error about the effects part of the trigger. it's in 'voice', not 'trigger'

i set up a test missionette. you can just barely hear the far sound, but the near sound you hear distinctly, and from the trigger's location.

[attachment deleted by admin]

Offline The-Architect

  • Former Staff
  • ****
  • Bite my shiny metal...
    • Bob's Un-official Flashpoint Page
Re: Hearing custom sound from a certain point
« Reply #10 on: 13 Jun 2006, 17:18:44 »
Ok, forget all the drop down boxes and that. In the activation field or your script (script preferably), make sure that your object is saying the sound. Any object can say it so it's best to choose something tough rather than a unit. For obvious reasons.

ObjectName Say "SoundFile"
James Andrew Wilkinson 1977 - 2005 R.I.P.
"If it ain't the friggin' incoming it's the friggin' outgoing. Only difference is who gets the friggin' grease, and that ain't no friggin' difference at all."

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re: Hearing custom sound from a certain point
« Reply #11 on: 14 Jun 2006, 08:35:54 »
I have to side with bedges on this one ;)

You can use either the SFX or Sound sections of the .ext. Both will allow you to use sound directed from a certain point.
Either in a trigger, or as the Architect has suggested via script and the say command.

CfgEnvSounds will not make the sound directional... that's the part of the .ext that defines 'area' sounds. Such as the wind through the trees, and rain etc.

Offline JasonO

  • OFPEC Patron
  • ****
  • Oh no...
    • The New Life RPG
Re: Hearing custom sound from a certain point
« Reply #12 on: 18 Jun 2006, 13:48:30 »
Ahh i see.

The demo mission that Bedges has uploaded works, does the sound have to be a certain sample rate? Its ogg, and the sample rate is 2400 mono .

Thanks a lot for all your help.  8)

Offline Gogs

  • Contributing Member
  • **
  • WWIIEC - Gracefully retired boss
Re: Hearing custom sound from a certain point
« Reply #13 on: 19 Jun 2006, 15:35:58 »
16-bit Mono at 16,000Hz is the standard, but I have sucsessfully used sample rates well outside this range...