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.
IndexProgramming Questions & HelpSound,  Music Libraries › playing a portion of a loaded mp3 question
Page Index Toggle Pages: 1
playing a portion of a loaded mp3 question (Read 1043 times)
playing a portion of a loaded mp3 question
Mar 15th, 2010, 1:33pm
 
Hi.
I'm very new to programming, so this may be an obvious answer, but any help would be truly appreciated!

What I'm trying to do is load a 30 second mp3, and depending on the users selection (the user would have around 10 selections, only a portion of that mp3 is played) Every selection will start from the beginning of the mp3, but I need to program it so that one selection will play only 10 seconds from the beginning, another selection will play 20 seconds from the beginning, etc.
On top of that, I'd like to add effects to the mp3 dependent on the selection.

I've checked out Minim, but I can't seem to figure out how to play only a portion of an mp3 when play is selected, as opposed to the entire mp3....

I would want it so that it fades out prior to the end as well, so it just doesn't cut abruptly.....

Can anyone help with this??
Re: playing a portion of a loaded mp3 question
Reply #1 - Mar 18th, 2010, 5:21pm
 
anyone? really any help would be much appreciated.
Re: playing a portion of a loaded mp3 question
Reply #2 - Mar 28th, 2010, 4:18pm
 
I've just struggled through this myself - you can try -

   yourPlayer.setLoopPoints(1000, 2000);
   yourPlayer.loop(10);

Loop points are in milliseconds and the num in the loop() is the number of times to loop.

I hope that works for you.
Page Index Toggle Pages: 1