You can get the samplerate and file length of your file by sending a read message to soundfiler and not specifying a table to write to. From that you can calculate the expected play time.
On Wed, 20 Nov 2019 at 04:42, Jakob Laue jakkesprinter@web.de wrote:
Hey all, I want to play a wav-file with [readsf~] and I want to loop the wav-file. This can easily be done by connecting [readsf~]'s right outlet it its inlet. The problem is that I have a metronome in my patch which is the master of the tempo. The [readsf~] object will get out of sync with the metronome when it loops the same file over a longer period of time. That's why I want to constantly check the position of the wav-file that [readsf~] is currently at, when it plays the wav-file. By this, I can restart/loop the wav-file in sync with the metronome, as soon as it has almost reached its end. Do you have an idea how I could do that?
In a former version of my patch, I did this successfully when I was using [tabread4~] as my file-playing-object, but I needed to switch to [readsf~] in order to implement dynamic loading of wav-files.
Thanks, Jakob _______________________________________________ Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list