Jump to content
gc8

playSound3D arguments

Recommended Posts

Hi

I'm trying to play some sound but when I wanted to change the sound volume I found that playSound3D doesn't really work with many parameters.

 

This works:

 

 playSound3D ["A3\Sounds_F\sfx\alarm_blufor.wss",  player];

 

But this doesn't:

 

playSound3D ["A3\Sounds_F\sfx\alarm_blufor.wss",  player, false, [0,0,0], 3, 1, 0];

 

 

Any one know why?

 

thx!

 

Share this post


Link to post
Share on other sites

If the 3rd argument (position) is passed to the command, the 1st argument (source) will not work anymore. So, your code is working actually but in [0,0,0].

  • Thanks 1

Share this post


Link to post
Share on other sites
11 minutes ago, POLPOX said:

If the 3rd argument (position) is passed to the command, the 1st argument (source) will not work anymore. So, your code is working actually but in [0,0,0].

 

I read that from wiki but I thought [0,0,0] was default argument. Anyway got it working now, thx POLPOX!

 

But how do I make the sound follow player then?

 

 

Edit: I guess the sound cannot follow the player? Is there command for that?

 

Share this post


Link to post
Share on other sites

No this command/sound will not follow the player. The say commands do, although they attenuate heavily and not as easy to hear.

  • Thanks 1

Share this post


Link to post
Share on other sites

So how come this wont work:

 

(description.ext)

class CfgSounds
{
	sounds[] = {};
	
class TestSound1
{
	sound[] = {"A3\Sounds_F\sfx\alarm_blufor.wss",3,1,0};
	name = "TestSound1";
	titles[] = {};
};

};

 

(init.sqf)

playSound "TestSound1";

 

I get no sound

 

Share this post


Link to post
Share on other sites

the last parameter in your sound[] line is 0, that's the distance for the sound, try making it 100 or just remove it (I never use it)

 

Share this post


Link to post
Share on other sites

you can attach a say3d also ex. :

_your_pos = "#particlesource" createVehicle [0,0,0];	
_your_pos attachTo [_this, [0,0,0]];

 

  • Thanks 1

Share this post


Link to post
Share on other sites
1 hour ago, GEORGE FLOROS GR said:

 

You need  playSound3D for this.

 

no no, I think gc8 is just trying a simple playSound test and it wasn't working, but I think say3D might give the right result if if the config is correct

 

Share this post


Link to post
Share on other sites
13 hours ago, GEORGE FLOROS GR said:

 

You need  playSound3D for this.

 

What's wrong with playSound?

Share this post


Link to post
Share on other sites
13 hours ago, AZCoder said:

the last parameter in your sound[] line is 0, that's the distance for the sound, try making it 100 or just remove it (I never use it)

 

I tried removing it and making it 100 but nothing works

Share this post


Link to post
Share on other sites
1 hour ago, gc8 said:

What's wrong with playSound?

 

What exacly you want to succeed?

Play just a sound for player ? for everyone ? a 3d sound ?

Share this post


Link to post
Share on other sites
3 minutes ago, GEORGE FLOROS GR said:

 

What exacly you want to succeed?

Play just a sound for player ? for everyone ? a 3d sound ?

 

play a sound for every player. I also want to attach sound to some object but first I wanted to test all the commands out :) Didn't quite understand your attachTo example

  • Like 2

Share this post


Link to post
Share on other sites

You can use either playSound3D or say3d for a 3d sound .

If you want to play not a 3d sound then you can use playsound.

If you want to play the arma 3d sounds like the alarm , you have to use the playSound3D  , like the .wss above.

You don't need also to add this in the cfgsounds at the description.

I don't think so , that you can use the playsound for the game sounds .wss , but i haven't also test this.

 

For the say3d , to attachto you can creavehicle a #particlesource and then attach it to your object .

You can also check in my scripts for the examples.

Share this post


Link to post
Share on other sites

@GEORGE FLOROS GR Thanks, I will try those commands later but I would still like to make the playSound work just out of curiosity. Maybe I'll make a new thread for that.

Share this post


Link to post
Share on other sites
45 minutes ago, gc8 said:

make the playSound

 

The certain?

22 hours ago, gc8 said:

"A3\Sounds_F\sfx\alarm_blufor.wss"

 

Share this post


Link to post
Share on other sites
27 minutes ago, GEORGE FLOROS GR said:

The certain?

 

wiki says playsound:

"Selects sound from Description.ext#CfgSounds or config.cpp."

Share this post


Link to post
Share on other sites

i just tested and i don't think that you can play a 3d sound as plain sound.

You can play this as a 3d :

add in the init of an object:

playSound3D ["A3\Sounds_F\sfx\alarm_blufor.wss", this];

 

Might be that you want to do something else ?

Because i remember that you were asking how to play the sounds in unsung.

Share this post


Link to post
Share on other sites

Ok i just noticed the @

 

It is working.

so it's :

//__________________________ ***  C O P Y   T H I S  *** __________________________


class CfgSounds
{
	sounds[] = {};
	class sound_1
	{
		name		= "sound_1";
		// start path to sound file in AddOn with @
		sound[]		= { "@A3\Sounds_F\sfx\alarm_blufor.wss", 0.8, 1, 100 };
		titles[]	= { 0, "" };
	};
};

 

add this in an .sqf

waituntil {time > 3};  // for the test
playSound "sound_1";
hint"test";

 

  • Like 1

Share this post


Link to post
Share on other sites
5 minutes ago, GEORGE FLOROS GR said:

Might be that you want to do something else ?

 

I would like the sound to follow with vehicle

Share this post


Link to post
Share on other sites
1 minute ago, GEORGE FLOROS GR said:

Ok i just noticed the @

 

Hey it works! Thanks George. One problem less :)

 

  • Like 1

Share this post


Link to post
Share on other sites
Just now, gc8 said:

I would like the sound to follow with vehicle

 

So you are doing this wrong !

 

The above example is how to play a sound from an addon as a (plain) playsound and not as a 3d.

so in order to do this:

( hold on)

Share this post


Link to post
Share on other sites

This sound has a small duration so you need to loop this .

 

you could use this :

_particlesource = "#particlesource" createVehicle [0,0,0];	
_particlesource attachTo [_this, [0,0,0]];
playSound3D ["A3\Sounds_F\sfx\alarm_blufor.wss", _particlesource];

but it's not needed since it will stop on the next seconds

 

So just loop this :

playSound3D ["A3\Sounds_F\sfx\alarm_blufor.wss", _this];

 

Share this post


Link to post
Share on other sites

@GEORGE FLOROS GR Thanks but I don't think that works because the sound is not following _particlesource, it just is created at the position of _particlesource.

It states this in the wiki at one of the comments.

Share this post


Link to post
Share on other sites

Why not use say3D like you mentioned earlier @GEORGE FLOROS GR? If you loop playsound3D it will create a bunch of alarms, even if short-lived, but could be good for a torture scene :-D

 

  • Haha 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×