We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
Minim, triggering (Read 615 times)
Minim, triggering
Oct 9th, 2008, 10:31pm
 
I have prepared many short audio samples (10-20 seconds) which I am trying have Minim arrange in a random sequence, that is, selecting a sample at random as soon as the previous sample ends, creating a seamless continuity. All attempts have failed, essentially because I do not know how to make the program aware of when an audio file has reached its end, or how I could utilize this information for triggering new audio samples. can anyone suggest the most efficient way to achieve this?
Re: Minim, triggering
Reply #1 - Oct 10th, 2008, 12:10am
 
Yes, it's true, there isn't really a way to find out when an AudioSample has finished playing. It was designed to be fire-and-forget, I didn't anticipate people wanting to use it in this way. I may implement a listener scheme for broadcasting this kind of information. There is already an AudioEventListener in Javasound, so it'd be easy enough to piggy-back on that.
Re: Minim, triggering
Reply #2 - Dec 12th, 2008, 9:39pm
 
Couldn't you watch for isPlaying()==false?
Re: Minim, triggering
Reply #3 - Dec 12th, 2008, 10:45pm
 
I cant recall if I'm using AudioSamples (or even if I'm using minim...) but on one of my projects, I am calling getPlayTime (or something similar) to get the current position of playback in seconds. When the audio finishes, the time stops going up.

Don't know if its at all relevant to your situation, but I thought I'd throw it out there.
Page Index Toggle Pages: 1