AGS Engine

Further development of AGS engine

Feature Issue: AudioClip.IsPlaying

Pages: [1]

Crimson Wizard

  • AGSer
  • Posts: 2,536
  • not et suppotreD
« on: 10 Jul 2012, 17:28 »
It seems to me AGS lacks a way to simply check if AudioClip is being played, while have a way to check what clip the channels play.
I believe AudioClip.IsPlaying this is a nice candidate for helper function (or property).

Other option would be to add following properties:
AudioClip.PlayCount - number of channels this clip is played on right now.
AudioClip.ChannelsPlaying - array of references to AudioChannel.

Joseph DiPerla

  • AGSer
  • Posts: 1,083
  • Joseph DiPerla, Adventure Game Creator Wannabe!
« Reply #1 on: 10 Jul 2012, 22:04 »
I thought it did have a few of those features you just asked for.


AudioChannel *channel = aExplosion.Play();
while (channel.IsPlaying) Wait(1);
Display("Finished playing the explosion");


-------------


AudioChannel *channel = System.AudioChannels[2];
if (channel.PlayingClip == null)
{
  Display("Nothing is playing on channel 2");
}
else
{
  Display("Channel 2 is playing a clip of type %d", channel.PlayingClip.Type);
}


-----------------------------


while (Game.IsAudioPlaying(eAudioTypeMusic))
{
  Wait(1);
}


-----------------------


Display("There are %d audio channels.", System.AudioChannelCount);


-------------------------



AudioChannel *channel = System.AudioChannels[2];
Display("Channel 2's current volume is %d.", channel.Volume);

-------------------------------

Unless you meant a more direct way of achieving those things or are talking about something else entirely?
Joseph DiPerla--- http://www.adventurestockpile.com
Member in this community since before 1999.
-The oldest member without ever making a full game...

Crimson Wizard

  • AGSer
  • Posts: 2,536
  • not et suppotreD
« Reply #2 on: 10 Jul 2012, 23:13 »
Unless you meant a more direct way of achieving those things or are talking about something else entirely?
Here's a recent thread referencing the problem:
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=46384.0

Basically there's no way to know if certain AudioClip is playing without checking all channels, and that usually requires writing your own helper functions in the script.
That is - you can know what clip is playing on a channel, but to know what channel does the clip play on you should do some extra coding.
« Last Edit: 10 Jul 2012, 23:15 by Crimson Wizard »

Pages: [1]

Issue Details

  • Reported
    10 Jul 2012, 17:28
  • Updated
    10 Jul 2012, 23:13
  • View Status
    Public
  • Type
    Feature
  • Status
    New
  • Priority
    Normal
  • Version
    (none)
  • Fixed in
    (none)
  • Assigned to
    (none)
  • Category
    Scripts

Tags



Powered by: SMF Project Tools 0.5.3 © Niko Pahajoki 2007-2011