Forum Rule: Always post complete source code & details to reproduce any issue!
-
Crossfade and loop
Hi,
I want to loop certain wave files, but I want them to crossfade.
So, one file plays almost till the end (3 to 4 seconds) and crossfades into the next.
No buttons, not interaction, just looping forever.
I'm a Frankenscript coder - by cutting & sewing together - but here it's the reasoning behind it I cannot mathemetize. Concrete code help is very very welcome..
---> I think there has to be something to indicate that a file ends, to be able to start the next one
- by a specific object?
- by calculating the length of your file - how to know/stock this?
- other
?
thanks
---> the audio board is great; by the way, crystal clear sound :-)
greetzw,
dywen
-
As a start, I'd just use two known files - with known length - and use millis() to determine the point where you want start the next file.
If that works, you can add the next step, and try to determine the length in your program.
-
Senior Member

Originally Posted by
dywen
Concrete code help is very very welcome..
If you haven't already looked at the audio tutorials, take a look at part 2-2. It plays 2 WAV files and lets you pan between them.
With a little coding as Frank suggested, you should be able to achieve your goal. The player also has functions you can call to find the current position with the file and the total length. But if you know the lengths, maybe fixed numbers with delay() or elapsedMillis would be simpler.
-
Ok. I did not make the link with the panning example..
Thanks!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules