I'm trying create a feature that allows a callers to add more speech to his recording. I think this can be done inside a dialplan, but I can't find an example of how to do this. Basically,after he records the primary message, a menu would play asking if he wants to append to this message. If yes, then he would record a temp file with the additional message and when done, I want SOX to add the temp message to the primary message making it one larger message. Would you mind showing me an example of how to run SOX inside the dialplan? Thanks, Bart -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20091010/57ffdc21/attachment.htm
exten => _X.,n,System(sox arg1 ... argN) Martin On Sat, Oct 10, 2009 at 5:25 PM, Bart Fisher <bart at icpage.com> wrote:> I'm trying create a feature that allows a callers?to add more speech to his > recording. I think this can be done inside a dialplan, but I?can't find an > example of how to do this. > > Basically,after he records the primary message, a menu would play asking if > he wants to append to this message.? If yes, then he would record a temp > file with the additional message and when done, I want SOX to add the temp > message to the primary message making it one larger message. > > Would you mind showing me an example of how to run SOX inside the dialplan? > > Thanks, Bart > _______________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > AstriCon 2009 - October 13 - 15 Phoenix, Arizona > Register Now: http://www.astricon.net > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > ? http://lists.digium.com/mailman/listinfo/asterisk-users >
covici at ccs.covici.com
2009-Oct-10 22:52 UTC
[asterisk-users] Method to use SOX inside a Dialplan
The record app has an append feature, if I remember correctly. Bart Fisher <bart at icpage.com> wrote:> I'm trying create a feature that allows a callers to add more speech to his recording. I think this can be done inside a dialplan, but I can't find an example of how to do this. > > Basically,after he records the primary message, a menu would play asking if he wants to append to this message. If yes, then he would record a temp file with the additional message and when done, I want SOX to add the temp message to the primary message making it one larger message. > > Would you mind showing me an example of how to run SOX inside the dialplan? > > Thanks, Bart > ---------------------------------------------------- > Alternatives: > > ---------------------------------------------------- > _______________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > AstriCon 2009 - October 13 - 15 Phoenix, Arizona > Register Now: http://www.astricon.net > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users-- Your life is like a penny. You're going to lose it. The question is: How do you spend it? John Covici covici at ccs.covici.com
On Sat, 10 Oct 2009, Bart Fisher wrote:> I'm trying create a feature that allows a callers to add more speech to > his recording. I think this can be done inside a dialplan, but I can't > find an example of how to do this. > > Basically,after he records the primary message, a menu would play asking > if he wants to append to this message. If yes, then he would record a > temp file with the additional message and when done, I want SOX to add > the temp message to the primary message making it one larger message. > > Would you mind showing me an example of how to run SOX inside the > dialplan?The system() dialplan application will allow you to run any executable. If you plan on concatenating more than 32 input files you'll have to make sure you have sox v14.3.0 or later. The dialplan snippet would look something like: exten = s,n,system(/path-to-sox/sox a.wav b.wav c.wav) This would copy a.wav followed by b.wav to a new file, c.wav. I would code the entire feature up as an AGI so you can hide all the ugly details like creating files with unique file names, maybe running normalize on the pieces before concatenation, error handling, maybe even trimming the leading and trailing silence off each file so the gaps are consistent, allowing the caller to listen to the new file and accept or re-record the "suffix," cleaning up in case the caller hangs up, etc, etc, etc. -- Thanks in advance, ------------------------------------------------------------------------- Steve Edwards sedwards at sedwards.com Voice: +1-760-468-3867 PST Newline Fax: +1-760-731-3000