[asterisk-users] Re: Ringtone/gentone/busy and g729
Kristian Kielhofner
kris at krisk.org
Fri Aug 18 11:52:00 MST 2006
Tony Mountifield wrote:
> OK, create a script called samples.pl containing the following:
>
> #!/usr/bin/perl
> $times = shift || 1;
> undef $/;
> $data = <>;
> $data =~ /{\s*(.*?)\s*}/s;
> @samples = split /[^0-9-]+/,$1;
> print pack('v*', at samples) x $times;
> #--end--
>
> This will read busy.h or ringtone.h and output the values as a raw slin file.
> You can pass a repeat count to samples.pl if you want to make a longer file.
> You can convert that to whatever format you like using sox, e.g. for .wav:
>
> samples.pl 50 <busy.h | sox -t raw -sw -c1 -r8000 - busy.wav
> samples.pl 100 <ringtone.h | sox -t raw -sw -c1 -r8000 - ringtone.wav
>
> Change .wav to .ul or .al for uLaw or aLaw output.
>
> Hope this helps!
>
> Cheers
> Tony
Tony,
Thanks! Wow, now all I need to do is get the cadence right and I'll be
done!
--
Kristian Kielhofner
More information about the asterisk-users
mailing list