Quoth Rick T, on 27/02/2013 09:04:
Greetings All
I'm trying to control how a text file with a list of audio files in it are read/played.
Example: I have a text file which is read and plays several audio files one right after the other till the end. I would like to have it read/play the text file list in reverse, forward, or loop play on the current file.
So if I have a text file with. one.wav, two.wav three.wave
When a button is clicked for Forward it reads the text file and plays the audio files like: one.wav two.wav three.wav
When a button is clicked for Reverse it reads the text file and plays the audio files like: three.wav two.wav one.wav
When a button is clicked for Loop it reads the text file and plays the audio files like: one.wav two.wav two.wav two.wav .... until I cancel the loop or hit another button to go forward or reverse
I've gotten the buttons to work as a selection but I'm having issues in getting the text list to change directions and loop. I was thinking of using a list to read in all the lines in the text file but I wasn't sure how to get the list to read/play in the forward, reverse, and loop options. Is their another way I should be trying to do this? I've attached what I have so far.
Thanks
To loop the current file you need to know where in the playlist you are. [textfile] doesn't really have this information ( [msgfile] in zexy does though so you might want to look at that ). Or you can make a counter to keep track of where you are so you can then loop the track, or reverse the playback. See attached patch.
James