Thanks Mike and everyone, this makes life a lot simpler for me.

cheers,
Richard
  ----- Original Message ----- 
  From: Mike Ashton 
  To: asterisk@uc.org 
  Cc: Richard (Rogers @ work) 
  Sent: Wednesday, March 28, 2007 2:41 PM
  Subject: Re: [on-asterisk] Creating custom recording based on asterisk sound 
files


  Here is a shell script I use for appending audio files, I guess I had to do 
hard way since I've used sox for a long long time.

  I call it soxcat8  ( have various versions for different encoding options )


#!/bin/sh
sox $1 -r 8000 -c 1 -s -w /tmp/$$-1.raw
sox $2 -r 8000 -c 1 -s -w /tmp/$$-2.raw
cat /tmp/$$-1.raw /tmp/$$-2.raw > /tmp/$$.raw
sox -r 8000 -c 1 -s -w /tmp/$$.raw $3
rm /tmp/$$*.raw

So vi soxcat8 , and paste, save and chmod 755

Then just soxcat8 in1.gsm in2.gsm out.gsm

Hope this helps.
Mike

  [EMAIL PROTECTED] wrote: 
Ah, it's an old version of sox, they've apparently changed the command
syntax. I just checked an old Fedora Core1 system, and it doesn't look
like it supports concatenation (as far as I can tell from the rather
cryptic manpage).

On debian (with sox 12.17.9), it's the syntax I described, as is another
fedora system where I built it from source.

What I mean by simultaneously with soxmix is that the audio will be mixed
together so that you hear both 'thousdandth', and 'through' at the same
time, rather than one after the other.

Cheers,
spd

On Wed, 28 Mar 2007, Richard (Rogers @ work) wrote:

  Sure.  There were no dashes in the filenames and here is what I got.

[EMAIL PROTECTED] sounds]# sox thousandth.gsm through.gsm test11.gsm
sox: Known effects: avg band bandpass bandreject chorus compand copy dcshift
deemph earwax echo echos fade filter flanger highp highpass lowp lowpass map
mask pan phaser pick pitch polyphase rate repeat resample reverb reverse
silence speed stat stretch swap synth trim vibro vol

sox: Effect 'test11.gsm' is not known!

How do you mean by simultaneously in your comment after joining the files?
 soxmix will mix two or more files together so that they will play
simultaneously,

It both input files becomes one file after soxmix, how can the individual
files still be play simultanously??  May be I got the wrong end of the
stick.

thanks,
Richard
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: "Richard (Rogers @ work)" <[EMAIL PROTECTED]>
Cc: <asterisk@uc.org>
Sent: Wednesday, March 28, 2007 1:07 PM
Subject: Re: [on-asterisk] Creating custom recording based on asterisk sound
files


    Could you clarify "did not work"? As regretably, you're mistaken, the
command and syntax is:

 sox sourcefile1.gsm sourcefile2.gsm destination.gsm

It might be that all the dashes in your filename are confusing the
commandline parser, and trying to use them as options...

soxmix will mix two or more files together so that they will play
simultaneously, which I don't believe is what you were asking for.

Cheers,
spd

On Wed, 28 Mar 2007, Richard (Rogers @ work) wrote:

      Hi Simon,

I tried using 'sox' to join the files but it did not work.
Having looked around, I think you meant 'soxmix' rather than 'sox'

Thanks,
Richard
----- Original Message -----
From: "Richard (Rogers @ work)" <[EMAIL PROTECTED]>
To: "Simon P. Ditner" <[EMAIL PROTECTED]>
Cc: <asterisk@uc.org>
Sent: Wednesday, March 28, 2007 11:43 AM
Subject: Re: [on-asterisk] Creating custom recording based on asterisk
        sound
    files


        Thanks Simon.  Regarding the normalization.  I tried it with a windows
          tool
        but it could not even read the wav file generated by sox.
I will try the tool you suggested.

Thanks,
Richard
----- Original Message -----
From: "Simon P. Ditner" <[EMAIL PROTECTED]>
To: "Richard (Rogers @ work)" <[EMAIL PROTECTED]>
Cc: <asterisk@uc.org>
Sent: Wednesday, March 28, 2007 11:12 AM
Subject: Re: [on-asterisk] Creating custom recording based on asterisk
          sound
        files


          That sort of work would happen outside of asterisk using tools like
'sox', and 'audacity'.

For example, with sox you can concatenate files like so:

  sox 1-for-am-2-for-pm.gsm thanks-for-calling-today.gsm output.gsm

Normalization would happen outside of Asterisk, I'm not sure how it
            would
        be done from the command line with sox, though it's easy to do in
Audacity (Effect -> Normalize).

On Wed, 28 Mar 2007, Richard (Rogers @ work) wrote:

            Hi,

There are a whole bunch of .gsm, .ulaw, .wav files in
/var/lib/asterisk/sounds/ within asterisk.
Is there any ways to create a custom recording by concatenating
              these
    available files?

Say 1-for-am-2-for-pm.gsm + thanks-for-calling-today.gsm +... to
              make
    up
        a
          custom sentence to be played back to the callers.

Also, I tried to converting a gsm file to wav format but end up
              with
    very
          low volume - too low it's not usuable.
Any ideas on how to normalise a wave file in Asterisk?

Thanks in advance,
Richard



              
---------------------------------------------------------------------
      To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


              
---------------------------------------------------------------------
      To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

                    
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

      ---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


    
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




  

-- 
Mike Ashton

Quality Track Intl

Ph:     647-722-2092 x 251
Cell:   416-527-4995
Fax:    416-352-6043

QTI CONFIDENTIAL AND PROPRIETARY INFORMATION

The contents of this material are confidential and proprietary to Quality Track 
 International, Inc.
and may not be reproduced, disclosed, distributed or used without the express 
permission of an authorized representative of QTI.
Use for any purpose or in any manner other than that expressly authorized is 
prohibited.
If you have received this communication in error, please immediately delete it 
and all copies, and promptly notify the sender.

 

Reply via email to