Excellent! Do you mind finding a spot up on the wiki for this?<br>-MC<br><br><div class="gmail_quote">On Mon, Jul 23, 2012 at 4:01 PM, Alexandre Fiori <span dir="ltr"><<a href="mailto:fiorix@gmail.com" target="_blank">fiorix@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><br></div><div>Amazing. This is exactly what I was looking for, and couldn't figure out how to do.</div>
<div>Thank you!</div><div><div class="h5"><div><br></div><br><div><div>On 2012-07-23, at 6:55 PM, Michael Collins <<a href="mailto:msc@freeswitch.org" target="_blank">msc@freeswitch.org</a>> wrote:</div><br><blockquote type="cite">
Well, if you have soxi installed (Linux, of course) then you could always use a system call to grab the file length. For kicks I whipped up a proof of concept dial plan to demonstrate how it could work. If anyone finds it useful please let me know and I'll wikify it.<br>
-MC<br><br><span style="font-family:courier new,monospace"> <extension name="soxi sound file length"></span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> <condition field="destination_number" expression="^(9904)$"></span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> <action application="answer"/></span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> <action application="sleep" data="500"/></span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> <action application="set" <br> data="sound_file=${sounds_dir}/music/8000/danza-espanola-op-37-h-142-xii-arabesca.wav"/></span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> <action application="set"</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> data="file_length=${system soxi -D ${sound_file} | tr -d '\\n' }"/></span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> <action application="log" data="INFO Sound file length is '${file_length}'"/></span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> <action application="set" data="file_length=${expr(ceil(${file_length}))}"/></span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> <action application="log" data="INFO Sound file length is '${file_length}'"/></span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> <action application="say" data="en number pronounced ${file_length}"/></span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> <action application="playback" data="time/seconds.wav"/></span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> </condition></span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> </extension></span><br style="font-family:courier new,monospace"><br>
</blockquote></div></div></div></div></blockquote></div><br>