Author Topic: Audio clips randomly not playing  (Read 307 times)

elentgirl

  • You are only as old as your Avatar!
    • elentgirl worked on one or more games that won an AGS Award!
    •  
    • elentgirl worked on one or more games that was nominated for an AGS Award!
Audio clips randomly not playing
« on: 23 Mar 2021, 10:08 »
I have an ongoing problem with the AGS sound system.  When test playing my scripts, audio clips occasionally do not play when they should.  This is not simply because all the audio channels are in use as I am careful about the number of clips I play at any one time.  Also, the same section of program usually runs perfectly with all the clips playing, but occasionally one or more of the clips does not play.

This seems to happen randomly as I have made no alterations to the audio calls in my program to cause the clips(s) not playing, and if I run that same section of progam again, it runs perfectly.  This also happens occasionally whether or not I have compiled the program.  I have studied the forum posts on audio channels to try to understand fully how they work, but I have been unable to find anything that could explain what is happening in my game.

If anyone can suggest a way in which I can prevent this happening, I would be very grateful, or is it something I just have to live with?

Many thanks,
elentgirl.

eri0o

Re: Audio clips randomly not playing
« Reply #1 on: 23 Mar 2021, 11:46 »
Are these audio clips short? If they are, can you add a bit of silence (Audacity has a useful "generate silence" function) at the end so the audioclip is at least 1 second in duration?

My experience is that doing this and using ogg only I don't get these problems, but I don't if this is real or in my head after listening the same section of a game over and over.

elentgirl

  • You are only as old as your Avatar!
    • elentgirl worked on one or more games that won an AGS Award!
    •  
    • elentgirl worked on one or more games that was nominated for an AGS Award!
Re: Audio clips randomly not playing
« Reply #2 on: 23 Mar 2021, 14:18 »
Are these audio clips short? If they are, can you add a bit of silence (Audacity has a useful "generate silence" function) at the end so the audioclip is at least 1 second in duration?

Thank you, I will try that for the shorter clips.  Do you think that after playing a very short clip the channel may not be released and be available for other clips?

All my audio clips are in ogg format.  I have one channel allocted for ambient sounds, two for music and four for all other sounds.

Thank you for your suggestion,
elentgirl

arj0n

  • Mittens Vassal
  • art consists in drawing a line somewhere
    • arj0n worked on one or more games that won an AGS Award!
    •  
    • arj0n worked on one or more games that was nominated for an AGS Award!
Re: Audio clips randomly not playing
« Reply #3 on: 23 Mar 2021, 20:33 »
I use wav for shorter audio clips (SFX) and OGG only for music tracks since there is a problem with the OGG player in AGS.
For example, when an audio clip of 180ms as OGG is played in AGS, only a click is played/heard.
(In my case this was a gunshot sound)
But when using the same audio clip as WAV in AGS, the actual sound is correctly played.

Not sure if this has to do with your initial problem though, just a tip :)

Re: Audio clips randomly not playing
« Reply #4 on: 23 Mar 2021, 20:35 »
My hopes is that a testable Alpha version of SDL2-backed engine will be properly released later this week (with editor installer etc). It has all the audio subsystem rewritten, and will be very interesting to test if these and similar problems go away. Because this version has zero changes to game data itself it may be safe to use to make alternate game builds even if you prefer to keep using AGS 3.5.0.

elentgirl

  • You are only as old as your Avatar!
    • elentgirl worked on one or more games that won an AGS Award!
    •  
    • elentgirl worked on one or more games that was nominated for an AGS Award!
Re: Audio clips randomly not playing
« Reply #5 on: 23 Mar 2021, 21:32 »
I use wav for shorter audio clips (SFX) and OGG only for music tracks since there is a problem with the OGG player in AGS.

Thank you for the tip.  I have just spent this afternoon exctending all my shorter clips (over 60) as suggested by eri0o.  If this does not cure the problem I will try re-importing them as wav files.

I look forward to seeing the new version with better sound control.  To my mind, the audio controls in AGS have been its weakest part.

Thanks to all,
elentgirl

Re: Audio clips randomly not playing
« Reply #6 on: 02 May 2021, 22:36 »
Hello.
Is this issue going to be fixed un 3.6.0 aswell?
I'm having this problem since I use ogg, even with files larger than one second.