Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Héctor Bometón on Mon 11/03/2019 14:09:07

Title: Can't play two fx sounds simultaneously, am I dumb?
Post by: Héctor Bometón on Mon 11/03/2019 14:09:07

Hi!

So... I thought I wasn't a "begginer" anymore since it's been a couple years developing my game and I'm pretty confident with my AGS skills, but I'm having some stupid basic problems adding sound to my demo lately.

The thing is... I can't manage to play more than two sounds simultaneously. I can have background music playing AND trigger ONE sound, and I can hear both no problem, but... music playing or not, if I try to play TWO FX SOUNDS, (directly from script or triggering an animation that includes frames with sounds), the first one to be triggered sounds over the second one, and only when it's finished, you can hear the ending of the second one (if it happens to be longer).

I read all about sound and channels in the tutorials, but I can't figure out the problem. It's not about sound prioritys, that's all I can say (not 100% sure, but tried "everything" with that and I wasn't lucky).

Seems so simple... I just want to have music and a couple fx sounds playing. I know AGS is capable of this, but I'm not.

Currently using Build 3.5.0.6 BETA VERSION, January 2019.

Thanks!  :=
Title: Re: Can't play two fx sounds simultaneously, am I dumb?
Post by: Héctor Bometón on Mon 11/03/2019 14:12:05
Quote from: Héctor Bometón on Mon 11/03/2019 14:09:07
[...] the first one to be triggered sounds over the second one, and only when it's finished, you can hear the ending of the second one (if it happens to be longer).

In case I didn't explaing it well enough, by that I DON'T mean that the two sounds OVERLAP. The second sounds is muted till the first one is done.
Title: Re: Can't play two fx sounds simultaneously, am I dumb?
Post by: Snarky on Mon 11/03/2019 14:34:39
What is the code you're using? How do you have your audio types set up (particularly the MaxChannels setting)?
Title: Re: Can't play two fx sounds simultaneously, am I dumb?
Post by: Héctor Bometón on Tue 12/03/2019 10:22:40

MaxChannels have the default settings.

BUT...

It seems like the problem was the fx sounds I imported were too short ????

Some of them are under half a second length (gun shot, radio beep...). I just added some silence at the end of each file and now it's working!!

Thank you and sorry!  :tongue: :tongue: :tongue:
Title: Re: Can't play two fx sounds simultaneously, am I dumb?
Post by: Monsieur OUXX on Tue 12/03/2019 16:01:48
It's really weird. I think you should post your code.
Title: Re: Can't play two fx sounds simultaneously, am I dumb?
Post by: eri0o on Tue 12/03/2019 16:46:46
And maybe audiofiles... I've seen some wav files that doesn't work.
Title: Re: Can't play two fx sounds simultaneously, am I dumb?
Post by: WHAM on Wed 13/03/2019 11:17:14
I've had experiences with AGS before where extremely short audio files would not play at all. Stuff that was half a second or less. In the cases where I encountered this I edited the sound files, adding some blank audio after them to push their length over 1 second. Quick and dirty fix, but it's served its purpose for me so far.