Sound management : what's in the toolbox?

Started by Monsieur OUXX, Thu 24/11/2016 14:03:37

Previous topic - Next topic

Monsieur OUXX

so I'm experimenting with a little sound engine inside AGS and I'm not sure what I can do or not do.

- listing and iterating on the game's AudioClips? There's this but apparently it was never integrated in the main source branch? I think that's the most important thing.
On a side note, helios introduced a way to check which channel plays a given AudioClip, but Ithink it's kind of brokensince the same AudioClip can be played on several channels.
- listing and iterating on the game's AudioChannels? At least, knowing which are free or which are in use. (that's the least important of my requests though)
- listing and iterating on the game's AudioTypes? That I could do manually at game startup if I could iterate on the game's AudioClips. That would allow me to automaticlaly check that the right types have been set on the many, many sounds.
 

Crimson Wizard

#1
Monsieur OUXX, with all due respect, but it begins to look like you did not really read the post I referenced in your previous topic, because I answered those questions too. I will give this link once again:
http://www.adventuregamestudio.co.uk/forums/index.php?topic=54062.msg636546051#msg636546051

I even posted example of finding out which clips are playing on which channels there.


- listing and iterating on the game's AudioClips:
(Since 3.4.0) You can find out how many AudioClips you have and access them using Game.AudioClips array and Game.AudioClipCount property.

- listing and iterating on the game's AudioChannels?
You can find out how many AudioChannels you have and access them using System.AudioChannels array and System.AudioChannelCount property.

- listing and iterating on the game's AudioTypes?
No way AFAIK.

Monsieur OUXX

I have read your post, but I am currently in a level of exhaustion that you can't imagine (extremely long days of work in front of a computer screen, followed by hours of AGS "work" until late in the evening).
Thanks for your answers.

AFAIK Game.AudioClipCount is not in the autocomplete in 3.3.4, and since I read about it too in a thread where it was still hypothetical, I got lost between what's real and what's just a wish.
Thanks for answering, though. That's helping a lot. Thanks thanks thanks.

 

Crimson Wizard

Quote from: Monsieur OUXX on Thu 24/11/2016 16:26:49
I have read your post, but I am currently in a level of exhaustion that you can't imagine (extremely long days of work in front of a computer screen, followed by hours of AGS "work" until late in the evening).
I see, sorry for nagging.

It would be interesting to know whether there are things that still wanted to be improved here, because IMHO new audio system is kind of messy. Old system was more logical although less flexible. The new system seemingly was planned to have more customization capabilities, but turned out to be half-baked.

Monsieur OUXX

OK I'll share my thoughts.
I'd say that the number of channels is really the first thing that comes to mind (see example of channels-heavy use in other thread).
 

Alan v.Drake

#5
Exposing AudioChannel that way was a bad design decision. It would have been better scripting-wise if an audioclip instance was returned instead of the channel.
Then knowing if the clip is playing and manipulating its properties would have been a no brainer.

Could be something to implement in a future version, 3 years from now when I'll feel like doing more coding on AGS source.  (laugh)

- Alan

Snarky

#6
Unless there's some stumbling block I'm forgetting, I think it's possible to create a module that would offer an API more along those lines. You'd need to monitor each channel to catch it when a clip stops playing, but that should be doable.

(Can you distinguish between a looping clip and a clip being preempted by another instance of the same clip? That's the only potential issue I can foresee at the moment.)

Monsieur OUXX

Quote from: Snarky on Thu 24/11/2016 20:30:57
You'd need to monitor each channel to catch it when a clip stops playing

It's kinda what I'm doing in my own module (except functionally I focus more on "is this channel still playing the expected clip?")
 

Monsieur OUXX

Oh, one thing I'd love: if Each clip had its name stored in a string.
 

SMF spam blocked by CleanTalk