Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[Freeswitch-users] Seeking in recordFIle


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users
View previous topic :: View next topic  
Author Message
rjcajax at gmail.com
Guest





PostPosted: Wed Sep 10, 2008 8:43 am    Post subject: [Freeswitch-users] Seeking in recordFIle Reply with quote

All,

Where streamFile allows you to seek forward and backward by samples.
Is there anyway to seek backward and play a file to a user allowing the user to pause and continue recording (I assume with recordFile) a file at an intermediate point (not insert).

Bob
Back to top
brian at freeswitch.org
Guest





PostPosted: Wed Sep 10, 2008 9:09 am    Post subject: [Freeswitch-users] Seeking in recordFIle Reply with quote

You can use the inputCallback for this.

Example values you can return during that event callback to influence
the playback:


pause
stop
speed:[-|+]1 (example speed:+2)
restart
seek:[-|+]samples (example seek:+4000)

Here is an example in lua:

function all_done(s, how)
--os.exit();
--ex();
io.write("done: " .. how .. "\n");

end

function my_cb(s, type, obj, arg)
if (arg) then
io.write("type: " .. type .. "\n" .. "arg: " .. arg .. "\n");
else
io.write("type: " .. type .. "\n");
end

if (type == "dtmf") then
io.write("digit: [" .. obj['digit'] .. "]\nduration: [" ..
obj['duration'] .. "]\n");

if (obj['digit'] == "1") then
return "pause";
end

if (obj['digit'] == "2") then
return "seek:+3000";
end

if (obj['digit'] == "3") then
return "seek:-3000";
end

if (obj['digit'] == "4") then
return "seek:+3000";
end

if (obj['digit'] == "5") then
return "speed:+1";
end
if (obj['digit'] == "6") then
return "speed:0";
end
if (obj['digit'] == "7") then
return "speed:-1";
end

if (obj['digit'] == "8") then
return "stop";
end

if (obj['digit'] == "9") then
return "break";
end
else
io.write(obj:serialize("xml"));

end
end


blah = "args";
session:setHangupHook("all_done");
session:setInputCallback("my_cb", "blah");
session:streamFile("/tmp/swimp.raw");



If you wish to stop playback or a recording and move on you just
return "break" in the inputcallback.

/b




On Sep 10, 2008, at 8:40 AM, Robert Clayton wrote:

Quote:
All,

Where streamFile allows you to seek forward and backward by samples.
Is there anyway to seek backward and play a file to a user allowing
the user to pause and continue recording (I assume with recordFile)
a file at an intermediate point (not insert).

Bob
_______________________________________________
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

Brian West
sip:brian@freeswitch.org







_______________________________________________
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
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services