Discussion:
[asterisk-users] .GSM -> .WAV (or ,MP3) Conversion
Tim Dobson
2009-04-14 11:39:14 UTC
Permalink
Hey there,

I'm trying to convert some call recordings from asterisk we have in .gsm
format to something I can pipe through ffmpeg - wav would be good, mp3
would be amazing!

I've been trying playing with sox but I don't seem to be getting too far
with
1239101491.30.gsm -ql -r 64000 -t wav 1239101491.30.conv.wav resample
as ffmpeg borks at it:

***@freee-meee:~/dmc/call recordings$ ffmpeg -i 1239101491.30.conv.wav
1239101491.30.conv.mp3
FFmpeg version r11872+debian_3:0.svn20080206-12ubuntu3.1, Copyright (c)
2000-2008 Fabrice Bellard, et al.
configuration: --enable-gpl --enable-pp --enable-swscaler
--enable-x11grab --prefix=/usr --enable-libgsm --enable-libtheora
--enable-libvorbis --enable-pthreads --disable-strip --enable-libfaad
--enable-libfaadbin --enable-liba52 --enable-liba52bin
--enable-libdc1394 --disable-armv5te --disable-armv6 --disable-altivec
--disable-vis --enable-shared --disable-static
libavutil version: 49.6.0
libavcodec version: 51.50.0
libavformat version: 52.7.0
libavdevice version: 52.0.0
built on Mar 13 2009 17:48:10, gcc: 4.3.2
Input #0, wav, from '1239101491.30.conv.wav':
Duration: 00:00:06.7, bitrate: 1040 kb/s
Stream #0.0: Audio: libgsm_ms, 640000 Hz, mono, 1040 kb/s
File '1239101491.30.conv.mp3' already exists. Overwrite ? [y/N] y
Output #0, mp2, to '1239101491.30.conv.mp3':
Stream #0.0: Audio: mp2, 640000 Hz, mono, 64 kb/s
Stream mapping:
Stream #0.0 -> #0.0
[mp2 @ 0xb7d352f0]Sampling rate 640000 is not allowed in mp2
Error while opening codec for output stream #0.0 - maybe incorrect
parameters such as bit_rate, rate, width or height
***@freee-meee:~/dmc/call recordings$

Has anyone got any suggestions based on previous experience?


www.tdobson.net
----
If each of us have one object, and we exchange them, then each of us
still has one object.
If each of us have one idea, and we exchange them, then each of us now
has two ideas. - George Bernard Shaw
David Backeberg
2009-04-14 12:30:43 UTC
Permalink
Post by Tim Dobson
I'm trying to convert some call recordings from asterisk we have in .gsm
Why not use sox for this purpose?

sox mygsm.gsm -r 8000 -c 1 mywave.wav resample -ql

Once it's a wav you can mp3 it with lame or your preferred encoder,
but encoding and playing mp3s takes more cpu than just playing it in
gsm, or stopping after sox and playing as a wav.
Post by Tim Dobson
Has anyone got any suggestions based on previous experience?
My previous experience is to just use sox. It works, it's free, it
does what it says it does. What makes ffmpeg so special?
Michael
2009-04-14 12:57:03 UTC
Permalink
Post by David Backeberg
Once it's a wav you can mp3 it with lame or your preferred encoder,
but encoding and playing mp3s takes more cpu than just playing it in
gsm, or stopping after sox and playing as a wav.
Post by Tim Dobson
Has anyone got any suggestions based on previous experience?
I convert to MP3 and delete the original wav file using a script automatically
executed by the Monitor command (because wav is very large files).
Arjan Kroon | Mobillion
2009-04-14 12:35:14 UTC
Permalink
Hey,

I record the message in ULAW
exten => s,1,Record(${A_record}:ulaw,0,60)

After that I call sox with this command:
/usr/bin/sox -c 1 -1 -t ul -r 8000 $in_fl -t wav -2 -r 8000 -c 1
$wav_fl

Regards,

Arjan Kroon
Mobillion BV

-----Oorspronkelijk bericht-----
Van: asterisk-users-***@lists.digium.com
[mailto:asterisk-users-***@lists.digium.com] Namens Tim Dobson
Verzonden: 14-04-2009 13:39
Aan: asterisk-***@lists.digium.com
Onderwerp: [asterisk-users] .GSM -> .WAV (or ,MP3) Conversion

Hey there,

I'm trying to convert some call recordings from asterisk we have in .gsm

format to something I can pipe through ffmpeg - wav would be good, mp3
would be amazing!

I've been trying playing with sox but I don't seem to be getting too far

with
1239101491.30.gsm -ql -r 64000 -t wav 1239101491.30.conv.wav resample
as ffmpeg borks at it:

***@freee-meee:~/dmc/call recordings$ ffmpeg -i 1239101491.30.conv.wav
1239101491.30.conv.mp3
FFmpeg version r11872+debian_3:0.svn20080206-12ubuntu3.1, Copyright (c)
2000-2008 Fabrice Bellard, et al.
configuration: --enable-gpl --enable-pp --enable-swscaler
--enable-x11grab --prefix=/usr --enable-libgsm --enable-libtheora
--enable-libvorbis --enable-pthreads --disable-strip --enable-libfaad
--enable-libfaadbin --enable-liba52 --enable-liba52bin
--enable-libdc1394 --disable-armv5te --disable-armv6 --disable-altivec
--disable-vis --enable-shared --disable-static
libavutil version: 49.6.0
libavcodec version: 51.50.0
libavformat version: 52.7.0
libavdevice version: 52.0.0
built on Mar 13 2009 17:48:10, gcc: 4.3.2
Input #0, wav, from '1239101491.30.conv.wav':
Duration: 00:00:06.7, bitrate: 1040 kb/s
Stream #0.0: Audio: libgsm_ms, 640000 Hz, mono, 1040 kb/s
File '1239101491.30.conv.mp3' already exists. Overwrite ? [y/N] y
Output #0, mp2, to '1239101491.30.conv.mp3':
Stream #0.0: Audio: mp2, 640000 Hz, mono, 64 kb/s
Stream mapping:
Stream #0.0 -> #0.0
[mp2 @ 0xb7d352f0]Sampling rate 640000 is not allowed in mp2
Error while opening codec for output stream #0.0 - maybe incorrect
parameters such as bit_rate, rate, width or height
***@freee-meee:~/dmc/call recordings$

Has anyone got any suggestions based on previous experience?


www.tdobson.net
----
If each of us have one object, and we exchange them, then each of us
still has one object.
If each of us have one idea, and we exchange them, then each of us now
has two ideas. - George Bernard Shaw

_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Steve Edwards
2009-04-14 14:08:08 UTC
Permalink
Post by Arjan Kroon | Mobillion
I record the message in ULAW
/usr/bin/sox -c 1 -1 -t ul -r 8000 $in_fl -t wav -2 -r 8000 -c 1
$wav_fl
What are "-1" and "-2" for? Both sox 12.17.5 and 12.18.1 say they are
invalid.

Thanks in advance,
------------------------------------------------------------------------
Steve Edwards ***@sedwards.com Voice: +1-760-468-3867 PST
Newline Fax: +1-760-731-3000
Danny Nicholas
2009-04-14 15:17:53 UTC
Permalink
In sox 14.0.1 the -1 is a one byte sample, -2 is a two byte sample,
therefore the command is sampling one-in, two-out.

-----Original Message-----
From: asterisk-users-***@lists.digium.com
[mailto:asterisk-users-***@lists.digium.com] On Behalf Of Steve Edwards
Sent: Tuesday, April 14, 2009 9:08 AM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] .GSM -> .WAV (or ,MP3) Conversion
Post by Arjan Kroon | Mobillion
I record the message in ULAW
/usr/bin/sox -c 1 -1 -t ul -r 8000 $in_fl -t wav -2 -r 8000 -c 1
$wav_fl
What are "-1" and "-2" for? Both sox 12.17.5 and 12.18.1 say they are
invalid.

Thanks in advance,
------------------------------------------------------------------------
Steve Edwards ***@sedwards.com Voice: +1-760-468-3867 PST
Newline Fax: +1-760-731-3000

_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Tim Dobson
2009-04-14 16:01:00 UTC
Permalink
Post by Tim Dobson
1239101491.30.gsm -ql -r 64000 -t wav 1239101491.30.conv.wav resample
Gah I meant
sox 1239101491.30.gsm -ql -r 64000 -t wav 1239101491.30.conv.wav resample

--
Thanks everyone! Really appreciate it - all the documentation via google
is to convert *to* gsm... nothing says anything about *from* it!

Cheers!

Tim
--
www.tdobson.net
----
If each of us have one object, and we exchange them, then each of us
still has one object.
If each of us have one idea, and we exchange them, then each of us now
has two ideas. - George Bernard Shaw
a***@hotmail.com
2009-04-14 16:04:23 UTC
Permalink
<p class=EC_ecmsonormal style="background:white"><span lang=EN-US style="font-size:10pt;color:#444444;font-family:Verdana">Hi Friend,</span><span lang=EN-US style="font-size:9pt;color:#444444;font-family:Verdana"></span></p>
<p class=EC_ecmsonormal style="background:white"><span lang=EN-US style="font-size:10pt;color:#444444;font-family:Verdana">How are you doing recently? I would like to introduce you a very good company which I know. Their website is <a href="http://www.myewell.com/" target="_blank"><font color="#0066cc">www.myewell.com</font></a>. They can offer you all kinds of</span><span lang=EN-US style="font-size:9pt;color:#444444;font-family:Verdana"></span></p>
<p class=EC_ecmsonormal style="background:white"><span lang=EN-US style="font-size:10pt;color:#444444;font-family:Verdana">Electronic products like laptops, gps,TV LCD,cell phones,ps3,MP3/4, etc........Please take some time to have a check, There must have something you'd like to buy.<br>Their contact email: <a href="mailto:***@vip.188.com"><font color="#0066cc">***@vip.188.com</font></a> </span><span lang=EN-US style="font-size:9pt;color:#444444;font-family:Verdana"></span></p>
<p class=EC_ecmsonormal style="background:white"><span lang=EN-US style="font-size:10pt;color:#444444;font-family:Verdana"><br>Hope you have a good mood in shopping from their company!</span><span lang=EN-US style="font-size:9pt;color:#444444;font-family:Verdana"></span></p>
<p class=EC_ecmsonormal style="background:white"><span lang=EN-US style="font-size:10pt;color:#444444;font-family:Verdana"><br>Best Regards</span><span lang=EN-US style="font-size:9pt;color:#444444;font-family:Verdana"></span></p>
<p class=EC_MsoNormal style=""><span lang=EN-US style="font-size:16pt;color:#f4793a;font-family:Tahoma">aymen</span><span lang=EN-US style="font-size:10pt;color:#444444;font-family:Tahoma"> </span></p>
Doug Lytle
2009-04-14 16:13:18 UTC
Permalink
Post by a***@hotmail.com
Hi Friend,
Oh boy, this is fun.

Doug
--
Ben Franklin quote:

"Those who would give up Essential Liberty to purchase a little Temporary Safety, deserve neither Liberty nor Safety."
a***@hotmail.com
2009-04-14 16:16:25 UTC
Permalink
<p class=EC_ecmsonormal style="background:white"><span lang=EN-US style="font-size:10pt;color:#444444;font-family:Verdana">Hi Friend,</span><span lang=EN-US style="font-size:9pt;color:#444444;font-family:Verdana"></span></p>
<p class=EC_ecmsonormal style="background:white"><span lang=EN-US style="font-size:10pt;color:#444444;font-family:Verdana">How are you doing recently? I would like to introduce you a very good company which I know. Their website is <a href="http://www.myewell.com/" target="_blank"><font color="#0066cc">www.myewell.com</font></a>. They can offer you all kinds of</span><span lang=EN-US style="font-size:9pt;color:#444444;font-family:Verdana"></span></p>
<p class=EC_ecmsonormal style="background:white"><span lang=EN-US style="font-size:10pt;color:#444444;font-family:Verdana">Electronic products like laptops, gps,TV LCD,cell phones,ps3,MP3/4, etc........Please take some time to have a check, There must have something you'd like to buy.<br>Their contact email: <a href="mailto:***@vip.188.com"><font color="#0066cc">***@vip.188.com</font></a> </span><span lang=EN-US style="font-size:9pt;color:#444444;font-family:Verdana"></span></p>
<p class=EC_ecmsonormal style="background:white"><span lang=EN-US style="font-size:10pt;color:#444444;font-family:Verdana"><br>Hope you have a good mood in shopping from their company!</span><span lang=EN-US style="font-size:9pt;color:#444444;font-family:Verdana"></span></p>
<p class=EC_ecmsonormal style="background:white"><span lang=EN-US style="font-size:10pt;color:#444444;font-family:Verdana"><br>Best Regards</span><span lang=EN-US style="font-size:9pt;color:#444444;font-family:Verdana"></span></p>
<p class=EC_MsoNormal style=""><span lang=EN-US style="font-size:16pt;color:#f4793a;font-family:Tahoma">aymen</span><span lang=EN-US style="font-size:10pt;color:#444444;font-family:Tahoma"> </span></p>
Continue reading on narkive:
Loading...