It was a bug. next time file it in JIRA, its only by chance that I caught this email floating in a sea of 1000 other ones. commit 5fe3a22d83867d07f30ef7974329b2fa966747ea Author: Anthony Minessale <anthm@freeswitch.org> Date: Wed Sep 21 11:05:33 2011 -0500 fix inaccurate sample count in file handle, buffered samples were being double tallied On Wed, Sep 21, 2011 at 10:08 AM, Adam Kelloway <adam.kelloway@newpace.ca> wrote:
Hi there,
I've noticed that the variable_record_ms and variable_record_seconds values are often inaccurate. Is there any explanation for this?
The example below shows that while the RECORD_START and RECORD_STOP events were about 4 seconds apart, the variables claim that the file is 7 seconds long. See the soxi output at the end, which shows that the length of the file is 00:00:03.50, thus more in line with what the event timestamps suggest.
RECV EVENT Event-Name: RECORD_START Core-UUID: 235bab4c-36c6-48af-87d7-0f30a1140d52 Event-Date-GMT: Wed, 21 Sep 2011 14:52:24 GMT Event-Date-Timestamp: 1316616744483384 Event-Calling-File: switch_ivr_play_say.c Event-Calling-Function: switch_ivr_record_file Event-Calling-Line-Number: 615 Unique-ID: fa39d249-c9da-4072-aebe-4b606e661e5f Caller-Profile-Created-Time: 1316616744483384 Caller-Channel-Created-Time: 1316616740683382 Caller-Channel-Answered-Time: 1316616740683382 variable_current_application_data: /tmp/fa39d249-c9da-4072-aebe-4b606e661e5f.wav 120 200 2 variable_current_application: record Record-File-Path: /tmp/fa39d249-c9da-4072-aebe-4b606e661e5f.wav
RECV EVENT Event-Name: RECORD_STOP Core-UUID: 235bab4c-36c6-48af-87d7-0f30a1140d52 Event-Date-GMT: Wed, 21 Sep 2011 14:52:28 GMT Event-Date-Timestamp: 1316616748083413 Event-Calling-File: switch_ivr_play_say.c Event-Calling-Function: switch_ivr_record_file Event-Calling-Line-Number: 790 Unique-ID: fa39d249-c9da-4072-aebe-4b606e661e5f Caller-Profile-Created-Time: 1316616744483384 Caller-Channel-Created-Time: 1316616740683382 Caller-Channel-Answered-Time: 1316616740683382 variable_current_application_data: /tmp/fa39d249-c9da-4072-aebe-4b606e661e5f.wav 120 200 2 variable_current_application: record variable_record_seconds: 7 variable_record_ms: 7000 variable_record_samples: 56000 Record-File-Path: /tmp/fa39d249-c9da-4072-aebe-4b606e661e5f.wav
root@dev:/usr/local/freeswitch# soxi /tmp/fa39d249-c9da-4072-aebe-4b606e661e5f.wav
Input File : '/tmp/fa39d249-c9da-4072-aebe-4b606e661e5f.wav' Channels : 1 Sample Rate : 8000 Precision : 16-bit Duration : 00:00:03.50 = 28000 samples ~ 262.5 CDDA sectors File Size : 56.0k Bit Rate : 128k Sample Encoding: 16-bit Signed Integer PCM
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Anthony Minessale II FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire AIM: anthm MSN:anthony_minessale@hotmail.com GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com IRC: irc.freenode.net #freeswitch FreeSWITCH Developer Conference sip:888@conference.freeswitch.org googletalk:conf+888@conference.freeswitch.org pstn:+19193869900