Crossfade and loop

Status
Not open for further replies.

dywen

Member
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.
 
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.
 
Status
Not open for further replies.
Back
Top