Frictional Games Forum (read-only)

Full Version: My custom sound won't work?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am trying to add a custom sound to a grunt when the player is forced to turn around and look at him. This is what i have.

void OnStart()
{
AddEntityCollideCallback("Player", "precious", "LookAtGrunt", true, 1);

}

void LookAtGrunt(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("ghostgrunt", true);
ShowEnemyPlayerPosition("ghostgrunt");
AddTimer("", 2, "TimerGruntEnd");
PlaySoundAtEntity("", "precious.snt", "Player", 0, false);
StartPlayerLookAt("ghostgrunt", 10, 50, "");
AddTimer("", 2, "TimerStopPlayerLook");
}

void TimerStopPlayerLook (string &in asTimer)
{
StopPlayerLookAt();
}

void OnEnter()
{

}

void OnLeave()
{

}



everything works but the sound, it won't play for some odd reason. I have my sound file in mysounds folder under my custom story. I also have the .snt file. Inside it looks like this:

<SOUNDENTITY>
<SOUNDS>
<Main>
<Sound File="precious.ogg" />
</Main>
</SOUNDS>
<PROPERTIES Volume="5" MinDistance="1" MaxDistance="50" Random="0" Interval="0" FadeEnd="False" FadeStart="False" Stream="False" Loop="False" Use3D="false" Blockable="False" BlockVolumeMul="0.7" Priority="5" />
</SOUNDENTITY>



Can anyone help? Undecided
Inside your custom story folder put "sounds" That's where both files go. If it still is broken use a different ogg converter.
(07-30-2012, 08:00 PM)Harthex Wrote: [ -> ]Inside your custom story folder put "sounds" That's where both files go. If it still is broken use a different ogg converter.
"I have my sound file in my sounds folder under my custom story."

already did
Change "mysounds" to "sounds"
If Harthex's advice doesn't work, try setting the priority to 0 or 1. Oh, and also, the max volume is 1.0f, putting anything above that is pretty much useless. One last thing, if you're using PlaySoundAtEntity and actually want to make it sound like it's coming from a specific entity, make sure "Use3D" is true instead of false.

Also, did you properly convert the sound into an .ogg or did you just try to rename it? If not, I'd suggest using Audacity, it's lightweight and ideal for editing your own sounds.