<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[elapsed time when playing audio file? object&#x2F;external&#x2F;simple method?]]></title><description><![CDATA[<p>Hello,</p>
<p>I am trying to build a patch that syncs subtitles to an audio file. I.e. loads a .txt and bangs each text line at key moments determined by mm:ss of audio file.</p>
<p>But I cannot find an easy way to get elapsed time of a playing audio file. Could someone please guide me? is there an vanilla object or external for this?</p>
<p>I was doing this before with ableton live sending midi to PD through IAC driver on OSX. PD would respond to the midi by loading .txt files and banging the text lines from textfile towards text2d, then gem window.</p>
<p>Any help appreciated.</p>
<p>Thank you</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/8710/elapsed-time-when-playing-audio-file-object-external-simple-method</link><generator>RSS for Node</generator><lastBuildDate>Thu, 14 May 2026 08:01:50 GMT</lastBuildDate><atom:link href="http://forum.pdpatchrepo.info/topic/8710.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 15 Oct 2014 15:04:32 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to elapsed time when playing audio file? object&#x2F;external&#x2F;simple method? on Wed, 15 Oct 2014 15:04:32 GMT]]></title><description><![CDATA[<p>Hello,</p>
<p>I am trying to build a patch that syncs subtitles to an audio file. I.e. loads a .txt and bangs each text line at key moments determined by mm:ss of audio file.</p>
<p>But I cannot find an easy way to get elapsed time of a playing audio file. Could someone please guide me? is there an vanilla object or external for this?</p>
<p>I was doing this before with ableton live sending midi to PD through IAC driver on OSX. PD would respond to the midi by loading .txt files and banging the text lines from textfile towards text2d, then gem window.</p>
<p>Any help appreciated.</p>
<p>Thank you</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/8710/elapsed-time-when-playing-audio-file-object-external-simple-method</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/8710/elapsed-time-when-playing-audio-file-object-external-simple-method</guid><dc:creator><![CDATA[ferr]]></dc:creator><pubDate>Wed, 15 Oct 2014 15:04:32 GMT</pubDate></item><item><title><![CDATA[Reply to elapsed time when playing audio file? object&#x2F;external&#x2F;simple method? on Wed, 15 Oct 2014 16:27:02 GMT]]></title><description><![CDATA[<p>Hello again,</p>
<p>I went back to read audio basics here <a href="http://www.pd-tutorial.com/english/index.html" rel="nofollow">http://www.pd-tutorial.com/english/index.html</a></p>
<p>...and I understand I can use soundfile_info to obtain length of .wav in samples. Divide it by sample rate, i.e. 44100, and obtain this way the length in seconds.</p>
<p>I imagine after this I could attempt to build a timer and start both wav file and timer at the same time, so they run in sync...then I could &quot;listen&quot; to the timer in order to fire bangs at concrete mm:ss</p>
<p>But there must be an easy and more accurate way to do this, right?</p>
<p>Thank you again.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/8710/elapsed-time-when-playing-audio-file-object-external-simple-method/2</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/8710/elapsed-time-when-playing-audio-file-object-external-simple-method/2</guid><dc:creator><![CDATA[ferr]]></dc:creator><pubDate>Wed, 15 Oct 2014 16:27:02 GMT</pubDate></item><item><title><![CDATA[Reply to elapsed time when playing audio file? object&#x2F;external&#x2F;simple method? on Wed, 15 Oct 2014 17:18:00 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>What you described in your second post looks very reasonable to me, why do you think it wouldn't be accurate?</p>
<p>Best,<br />
Gilberto</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/8710/elapsed-time-when-playing-audio-file-object-external-simple-method/3</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/8710/elapsed-time-when-playing-audio-file-object-external-simple-method/3</guid><dc:creator><![CDATA[gsagostinho]]></dc:creator><pubDate>Wed, 15 Oct 2014 17:18:00 GMT</pubDate></item><item><title><![CDATA[Reply to elapsed time when playing audio file? object&#x2F;external&#x2F;simple method? on Wed, 15 Oct 2014 18:27:58 GMT]]></title><description><![CDATA[<p>Hello , thanks for your reply.</p>
<p>I always had the impression that an object is more efficient and accurate than a chain of them, isn't this right in this situation ?</p>
<p>Anyway I've tried, patch in next post. What do you think?</p>
<p>Thank you!</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/8710/elapsed-time-when-playing-audio-file-object-external-simple-method/4</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/8710/elapsed-time-when-playing-audio-file-object-external-simple-method/4</guid><dc:creator><![CDATA[ferr]]></dc:creator><pubDate>Wed, 15 Oct 2014 18:27:58 GMT</pubDate></item><item><title><![CDATA[Reply to elapsed time when playing audio file? object&#x2F;external&#x2F;simple method? on Wed, 15 Oct 2014 18:38:55 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>I downloaded the patch you had previously uploaded, and I am reuploading it with some few improvements you may like (or not!). It seems to work quite well, but you seem to have forgotten to connect the right <strong>[inlet]</strong> of <strong>[pd playcount]</strong> to the <strong>[metro 1]</strong> object. As soon as I connected it, your subpatch worked perfectly well. Also, I would rather connect the leftmost outlet of <strong>[t b 0]</strong> to the 3rd inlet of <strong>[counter[</strong> instead of the 4th. This way, when the file finishes, the elapsed time stays in the final value and does not automatically change to 0 (but it will start to count from 0 when you play a file once again). I also corrected the patch cords connected to <strong>[dac~]</strong>, and finally I added the function to playback a file without having to reopen it (a time saver when dealing with <strong>[readsf~]</strong>!). Let me know what you think and if you need any more help: <a href="/uploads/upload-bad8b851-e260-4411-9ab8-5d30cdf126af.pd">playcount.pd</a></p>
<p>Take care,<br />
Gilberto</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/8710/elapsed-time-when-playing-audio-file-object-external-simple-method/5</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/8710/elapsed-time-when-playing-audio-file-object-external-simple-method/5</guid><dc:creator><![CDATA[gsagostinho]]></dc:creator><pubDate>Wed, 15 Oct 2014 18:38:55 GMT</pubDate></item><item><title><![CDATA[Reply to elapsed time when playing audio file? object&#x2F;external&#x2F;simple method? on Wed, 15 Oct 2014 18:39:26 GMT]]></title><description><![CDATA[<p>Here: <a href="http://jaumeferrete.net/pd/playcount.pd" rel="nofollow">http://jaumeferrete.net/pd/playcount.pd</a></p>
<p>I get a small difference between elapsed time and total time</p>
<p>thanks</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/8710/elapsed-time-when-playing-audio-file-object-external-simple-method/6</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/8710/elapsed-time-when-playing-audio-file-object-external-simple-method/6</guid><dc:creator><![CDATA[ferr]]></dc:creator><pubDate>Wed, 15 Oct 2014 18:39:26 GMT</pubDate></item><item><title><![CDATA[Reply to elapsed time when playing audio file? object&#x2F;external&#x2F;simple method? on Wed, 15 Oct 2014 18:40:10 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/gsagostinho">@gsagostinho</a> Oh, great thank you , let me check</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/8710/elapsed-time-when-playing-audio-file-object-external-simple-method/7</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/8710/elapsed-time-when-playing-audio-file-object-external-simple-method/7</guid><dc:creator><![CDATA[ferr]]></dc:creator><pubDate>Wed, 15 Oct 2014 18:40:10 GMT</pubDate></item><item><title><![CDATA[Reply to elapsed time when playing audio file? object&#x2F;external&#x2F;simple method? on Wed, 15 Oct 2014 18:44:26 GMT]]></title><description><![CDATA[<p>No problems. I just noticed that the patch I uploaded also shows a small difference between total duration and the final elapsed time. But when I try using <strong>[wavinfo]</strong> instead of <strong>[soundfile_info]</strong>, the result is spot on (so it seems to be a problem with the latter object). Since I use pd-extended, I couldn't say if <strong>[wavinfo]</strong> is present on vanilla or not.</p>
<p>Good luck,<br />
Gilberto</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/8710/elapsed-time-when-playing-audio-file-object-external-simple-method/8</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/8710/elapsed-time-when-playing-audio-file-object-external-simple-method/8</guid><dc:creator><![CDATA[gsagostinho]]></dc:creator><pubDate>Wed, 15 Oct 2014 18:44:26 GMT</pubDate></item><item><title><![CDATA[Reply to elapsed time when playing audio file? object&#x2F;external&#x2F;simple method? on Wed, 15 Oct 2014 20:56:02 GMT]]></title><description><![CDATA[<p>Thanks for the tip !</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/8710/elapsed-time-when-playing-audio-file-object-external-simple-method/9</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/8710/elapsed-time-when-playing-audio-file-object-external-simple-method/9</guid><dc:creator><![CDATA[ferr]]></dc:creator><pubDate>Wed, 15 Oct 2014 20:56:02 GMT</pubDate></item></channel></rss>