Audio clips randomly not playing

Started by elentgirl, Tue 23/03/2021 10:08:29

Previous topic - Next topic

elentgirl

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

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

Quote from: eri0o on Tue 23/03/2021 11:46:41
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

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 :)

Crimson Wizard

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

Quote from: arj0n on Tue 23/03/2021 20:33:03
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

nightmarer

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.

nightmarer

Hello.
I'm still having issues with the ogg files, even with the files which are longer than one second.
As mp3 or wav are leaving a gap in the loops I need to use ogg files.
Are there plans of fixing this soon?

eri0o

#8
Edit: actually, can you try your game here and see if the missing sounds happens? No idea if the game is too big or will have other problems, but got curious.

Also if possible try picking the 3.6.0 acwin.exe from here and the SDL2.dll and see if the missing audio still happens with it - place both in the same directory of your compiled game, and run the acwin.exe.

nightmarer

Hello.
I am actually using the 3.6.0 but these audios are not played, but this seems to happen above the audio track number 175

Crimson Wizard

#10
Quote from: nightmarer on Mon 10/05/2021 20:37:57
I am actually using the 3.6.0 but these audios are not played, but this seems to happen above the audio track number 175

I'd like to clarify, what you are saying is that the outcome depends on audio clip's ID?

What happens if you make a test and change non-playing clip's ID in the editor (there's an option in context menu)?


BTW, you had this report previously: https://www.adventuregamestudio.co.uk/forums/index.php?topic=58901.0
but there you said that the problem got fixed in AGS 3.5.1. I wonder if these are related in some way.


PS. I have downloaded the compiled game you sent me previously, might test it.

SMF spam blocked by CleanTalk