Issue #17 open

isPlaying() boolean to find out if the track is finished or not...

Anonymous created an issue

Hi there

I'm using a combination of Minim and Toxiclibs - Minim has a feature (which is not even finished implementing yet, but anyway) to find out if the track "isPlaying()"

Can I request this in Toxiclibs? It didn't seem to exist already.

Thanks, Sam

Comments (1)

  1. Karsten Schmidt repo owner

    Hi Sam, sorry for late reply, but this feature is already there although in disguise using the AudioSource.getBuffersProcessed() function. This returns the number of times the underlying AudioBuffer for this source has been played back. So if this number is >0 then playback is either finished (for non-looping samples) or else contains the number of loops played so far...

    https://bitbucket.org/postspectacular/toxiclibs/src/9c09266d9c01/src.audio/toxi/audio/AudioSource.java#cl-104

    I will add a convenience isPlaying() function though for the next release, so leaving this issue open for now...

  2. Log in to comment