Author Topic: Audio Stuff  (Read 755 times)

A couple things.

1) Many players (mostly those who don't have the sounds) seem to crash when I play 3d sound on all players. Why? What can I do to fix this?

2) How do you stop an AudioLooping2D after calling serverPlay2d(whatever); ?


Give the code you're using for #1.

Code: [Select]
function sp_playtoall(%sound)
{
for(%j = 0; %j < ClientGroup.getCount(); %j++)
{
%client = ClientGroup.getObject(%j);
if(isObject(%client.player))
{
%client.player.playAudio(1, %sound);
}
}
}

Code: [Select]
datablock AudioDescription(spLooping3d)
{
   volume   = 2.0;
   isLooping= true;

   is3D     = true;
   ReferenceDistance= 5.5;
   MaxDistance= 80.0;
   type     = $SimAudioType;
};
Code: [Select]
datablock AudioProfile(sp_chase)
{
filename = "./chase.wav";
description = spLooping3d;
preload = true;
};

3D audio sound being played over 2D.

3D audio sound being played over 2D.
Oh, is playAudio 2D?

Yeah but not everyone crashes.

Only a couple of them do.

Oh, is playAudio 2D?
2D sound would be %client.play2D(theSoundStuff) I think.

Yeah but not everyone crashes.

Only a couple of them do.
Yeah, that is odd.

Ideas?

Ideas?

This might not be a practical option, but maybe a way to keep clients from crashing is to send them a clientcmd, and then they would need a client addon that would recieve that cmd and play the proper sound.  Just a thought that popped into my head.

I think the problem is that they're not downloading it.

I think the problem is that they're not downloading it.
That's my guess as well.

I remember this in a TDM server with the stereo mod:

The pilot would keep crashing because the passengers couldn't resist playing music.
Then I told the pilot to download music/sounds.
He no longer crashed.