Page 1 of 1

Playsound problem with an actor

Posted: Sun Nov 03, 2013 8:11 pm
by Mr.Man
Hi, does anyone know why this isnt working? I want it to play MRMXPL when it activates, which is an explosion sound. However, it doesnt.

ACTOR StiffExplosion2 20040
{
//$Category Stijfjes Stuff
States
{
Spawn:
EXP2 A 0 A_PlaySound("MRMXPL")
EXP2 ABCDEFGHIJKLMN 2
Stop
}
}

RE: Playsound problem with an actor

Posted: Sun Nov 03, 2013 9:24 pm
by W1D3A55
It most likely needs to be defined in SNDINFO.

RE: Playsound problem with an actor

Posted: Sun Nov 03, 2013 9:57 pm
by Ænima
You also can't execute an action in the first frame of an actor's Spawn state ...

Try this instead:

Code: Select all

ACTOR StiffExplosion2 20040
{
//$Category Stijfjes Stuff
  States
  {
  Spawn:
    EXP2 A 0 // you can't do actions here, you have to wait until the second frame
    EXP2 A 0 A_PlaySound("MRMXPL")  
    EXP2 ABCDEFGHIJKLMN 2
    Stop
  }
}

RE: Playsound problem with an actor

Posted: Sun Nov 03, 2013 10:30 pm
by Ivan
Or you can put an extra A to that line, meaning

Code: Select all

EXP2 AA 0 A_PlaySound("MRMXPL")
This will also work in case you want to make it take less lines :p

RE: Playsound problem with an actor

Posted: Mon Nov 04, 2013 12:51 am
by -Jes-
The first frame in an actor's spawn state can indeed not perform any actions.

In fact, ZDoom just recently introduced an actor flag to remove this behavior.

RE: Playsound problem with an actor

Posted: Mon Nov 04, 2013 8:16 am
by Mr.Man
Ah, explains. Yeah, i has it in SNDINFO, ill try it when i get to a proper pc. Thanks for the help.

RE: Playsound problem with an actor

Posted: Tue Nov 05, 2013 12:43 pm
by Mr.Man
i tried with the double A and it works! But its not very loud, can this be increased?

RE: Playsound problem with an actor

Posted: Tue Nov 05, 2013 3:50 pm
by Ænima
Mr.Man wrote: i tried with the double A and it works! But its not very loud, can this be increased?
Yeah, open the sound with Audacity and amplify it.

RE: Playsound problem with an actor

Posted: Tue Nov 05, 2013 4:10 pm
by Ivan
Ænima wrote:
Mr.Man wrote: i tried with the double A and it works! But its not very loud, can this be increased?
Yeah, open the sound with Audacity and amplify it.
No, there's an even better solution. Put more A there and in the sound definition at SNDINFO do this:

Code: Select all

$limit Soundname 0
Notice the 0 means "No limit" so you can play same types of these sounds at any channel as many times as you want, giving it an amplification effect. If it turns out to be too loud, you can make the limit to say, 2 or 4. Also note that the number of A you add means the more instances of that sound being played, so it amplifies like 2 times, 3 times, 4 times and so on.

RE: Playsound problem with an actor

Posted: Tue Nov 05, 2013 4:19 pm
by Ijon Tichy
That is not a better solution. Playing the same sound on multiple channels clogs up those channels (they're shared across the entire player actor), as well as the global sound channels (64 or so by default), and since only one sound can be played per channel, you're basically silencing other sounds because you couldn't be bothered to go into Audacity and use an Amplify function. By default, it makes the sound as loud as possible without clipping, so it's literally just three clicks once you have the sound open.

If you're using automatic, really rapid firing weapons, switching between three or four audio channels for each shot might make the weapon sound better, but that's something else. Even then, use only as many sound channels as you need to make it sound good.

RE: Playsound problem with an actor

Posted: Tue Nov 05, 2013 4:22 pm
by Ivan
Ijon Tichy wrote: That is not a better solution. Playing the same sound on multiple channels clogs up those channels (they're shared across the entire player actor), as well as the global sound channels (64 or so by default). Amplifying it really isn't that big of a deal, and it means less stupid code bloat.
But it's an external actor, so it shouldn't affect the player in any way.

RE: Playsound problem with an actor

Posted: Tue Nov 05, 2013 4:25 pm
by Ijon Tichy
Doesn't change the fact that it's still clogging up sound channels, as well as being a really nasty hack.

The only reason I'd use this hack is because it seems to bypass clipping to some extent, but even then, I'd use it only sparingly.

RE: Playsound problem with an actor

Posted: Tue Nov 05, 2013 4:30 pm
by Ivan
Ijon Tichy wrote: Doesn't change the fact that it's still clogging up sound channels, as well as being a really nasty hack.

The only reason I'd use this hack is because it seems to bypass clipping to some extent, but even then, I'd use it only sparingly.
Yes, that is exactly why I suggested it, no clipping. It does what many of the sound editing tools fail to do, Audacity included. Often times, no matter how loud I tried to make an effect, or a weapon firing sound, it would not work. I used this and voila, perfect. IMO it can be very useful if done right.

RE: Playsound problem with an actor

Posted: Thu Nov 07, 2013 7:27 pm
by Klofkac
About playsound, I noticed that compressed formats are much quietter than the wave format, while using completely same, normalized sound.
The similar applies to stereo sounds.

RE: Playsound problem with an actor

Posted: Thu Nov 07, 2013 7:28 pm
by Ivan
Klofkac wrote: About playsound, I noticed that compressed formats are much quietter than the wave format, while using completely same, normalized sound.
The similar applies to stereo sounds.
Yeah I noticed this a long while ago too, but I thought it was just me... There certainly is something weird with how Zandronum handles those.

RE: Playsound problem with an actor

Posted: Thu Nov 07, 2013 7:48 pm
by Ænima
Ivan wrote:
Klofkac wrote: About playsound, I noticed that compressed formats are much quietter than the wave format, while using completely same, normalized sound.
The similar applies to stereo sounds.
Yeah I noticed this a long while ago too, but I thought it was just me... There certainly is something weird with how Zandronum handles those.
I have never noticed this. Infact I have recently batch-converted all of SST's sounds (which were all WAVs) to OGG's and everything sounds just as loud as it used to (and no it's not just relative, sometimes I play with headphones on at 100% volume and everything sounds just as loud as before the conversion).

It may be related to your guys' sound drivers or even OS (not sure if Linux Zandro handles sound file decompression differently than Windows).


The only thing i've noticed in relation to compressed sound formats in Zandro is that with long clips (mostly just music) can lag for a second before the sound plays for the first time due the sound needing to be decompressed as it's loaded. This is most noticeable when a map/server changes the music to an MP3 in the middle of a map. If it were a WAV, there would be hardly any pause. (But the filesize would be ridiculous ... a 3-minute song in WAV format alone is like 30 fucking megabytes...)