This was broken on many levels.<br><br>First off the obvious one besides the potential FPE was it&#39;s using fh-&gt;samples_in not fh-&gt;samples_out<br>but that value was not being computed correctly anyway and to top it off the value has to be determined after we close the file and not before to make sure we pick up any buffered audio.<br>
<br>FYI, can you please report incidents like this in the future to jira <a href="http://jira.freeswitch.org">http://jira.freeswitch.org</a> so we can track them easier.<br><br><br><div class="gmail_quote">On Tue, Oct 13, 2009 at 1:31 PM, Peter Volchek <span dir="ltr">&lt;<a href="mailto:pvolchek@voicemobility.com">pvolchek@voicemobility.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">



<div bgcolor="#ffffff" text="#000000">
<tt>Hi,<br>
I am currently trying to retrieve the length of the most recent
recording, and I am using &#39;record_ms&#39; channel variable.<br>
However, the returned value is always &#39;0&#39;.<br>
<br>
Here is the code I am using (lua):<br>
<br>
...<br>
session:recordFile(file, 30, 10, 10 );<br>
local rlen  = session:getVariable(&quot;record_ms&quot;);  -- rlen is Always 0<br>
...<br>
<br>
Any ideas why?<br>
<br>
<br>
Looking at switch_ivr_play_say.c, I found the line that sets this
variable at the end of recording:<br>
<br>
switch_channel_set_variable_printf(channel, &quot;record_ms&quot;, &quot;%d&quot;,
fh-&gt;samples_in / read_impl.samples_per_second);<br>
switch_channel_set_variable_printf(channel, &quot;record_samples&quot;, &quot;%d&quot;,
fh-&gt;samples_in);<br>
<br>
I also dumped the &quot;</tt><tt>record_samples</tt><tt>&quot; variable, which
was also 0, so there are no surprises that record_ms was 0 too.<br>
Please also compare the first function call to the analogous with
&quot;playback_ms&quot;<br>
<br>
<b>if (read_impl.samples_per_second)
switch_channel_set_variable_printf(channel, &quot;playback_ms&quot;, &quot;%d&quot;,
fh-&gt;samples_out /   read_impl.samples_per_second);<br>
<br>
</b>The second one, checks for the &quot;0&quot; value in the denominator; the
first one doesn&#39;t, so the potential segfault exists.<b><br>
</b><br>
<br>
Cheers,<br>
PV<br>
</tt>
</div>


<br>_______________________________________________<br>
FreeSWITCH-dev mailing list<br>
<a href="mailto:FreeSWITCH-dev@lists.freeswitch.org">FreeSWITCH-dev@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Anthony Minessale II<br><br>FreeSWITCH <a href="http://www.freeswitch.org/">http://www.freeswitch.org/</a><br>ClueCon <a href="http://www.cluecon.com/">http://www.cluecon.com/</a><br>
Twitter: <a href="http://twitter.com/FreeSWITCH_wire">http://twitter.com/FreeSWITCH_wire</a><br><br>AIM: anthm<br><a href="mailto:MSN%3Aanthony_minessale@hotmail.com">MSN:anthony_minessale@hotmail.com</a><br>GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com">PAYPAL:anthony.minessale@gmail.com</a><br>
IRC: <a href="http://irc.freenode.net">irc.freenode.net</a> #freeswitch<br><br>FreeSWITCH Developer Conference<br><a href="mailto:sip%3A888@conference.freeswitch.org">sip:888@conference.freeswitch.org</a><br><a href="http://iax:guest@conference.freeswitch.org/888">iax:guest@conference.freeswitch.org/888</a><br>
<a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org">googletalk:conf+888@conference.freeswitch.org</a><br>pstn:213-799-1400<br>