Asterisk Users 4 Comments


Can someone please comment about the below issue

[root@host0040 kaushal]# file obd-demo.mp3
obd-demo.mp3: MPEG ADTS, layer III, v1, 256 kBits, 44.1 kHz, Monaural
[root@host0040 kaushal]# sox obd-demo.mp3 -e stat
sox: Failed reading obd-demo.mp3: Do not understand format type: mp3

[root@host0040 kaushal]# sox -V obd-demo.mp3 -r 8000 -c 1 -t ul -w vm-intro.ulaw
sox: Failed reading obd-demo.mp3: Do not understand format type: mp3

[root@host0040 kaushal]# sox -v 0.125 -V -t au -r 8000
-U -b -c 1
resample -ql
-bash: obd-demo.ulaw: No such file or directory
[root@host0040 kaushal]# sox -V obd-demo.mp3 -t au -r 8000 -U -b -c 1
obd-demo.ulaw resample -ql
sox: Failed reading obd-demo.mp3: Do not understand foReply
rmat type: mp3

[root@host0040 kaushal]#

When i invoke the same obd-demo.mp3 it works perfectly fine

host0040*CLI> channel originate DAHDI/g0/xxxxxxxxxx Application
MP3Player /home/kaushal/obd-demo.mp3
[Sep 9 16:44:56] DEBUG[12691]: sig_pri.c:985 sig_pri_request: sig_pri_request 1
[Sep 9 16:44:56] DEBUG[12691]: sig_pri.c:6427 sig_pri_call: CALLER NAME: NUM:

4 thoughts on - mp3

  • On Wed, Sep 14, 2011 at 7:04 AM, Steve Edwards

    Hi Steve,

    Please let me know the correct procedure to get .alaw file format
    since I belong to India region.



  • Well, let’s see…

    You used ‘-t ul’ and got a ‘ulaw.’

    I wonder what ‘-t al’ will give you?

    Failing that, I suspect ‘sox –help’ or Google would be a more responsive

  • On Thu, Sep 15, 2011 at 11:45 AM, Steve Edwards

    Thanks Steve. it worked this time. Also is there a way to verify .alaw
    file without playing the file. Although i did play obd-demo.alaw it
    worked fine.

    I did ran the below command

    [root@host0040 test]# file obd-demo.alaw
    obd-demo.alaw: data
    [root@host0040 test]#
    [root@host0040 test]# sox obd-demo.alaw -e stat
    sox: Failed reading obd-demo.alaw: Do not understand format type: alaw

    [root@host0040 test]#

    Basically trying to understand the properties of the .alaw file about
    encoding and details. Please guide.

    [root@host0040 test]# sox -V obd-demo.wav -r 8000 -b -t al -c 1 obd-demo.alaw
    sox: Detected file format type: wav

    sox: WAV Chunk fmt
    sox: WAV Chunk data
    sox: Reading Wave file: Microsoft PCM format, 1 channel, 44100 samp/sec
    sox: 88200 byte/sec, 2 block align, 16 bits/samp, 2041438 data bytes
    sox: 1020719 Samps/chans
    sox: Input file obd-demo.wav: using sample rate 44100
    size shorts, encoding signed (2’s complement), 1 channel
    sox: Output file obd-demo.alaw: using sample rate 8000
    size bytes, encoding a-law, 1 channel
    sox: Output file: comment “Processed by SoX”

    sox: resample opts: Kaiser window, cutoff 0.800000, beta 16.000000

    [root@host0040 test]# ls -ltrh
    total 2.9M
    -rwxr-xr-x 1 root root 725K Sep 14 06:32 obd-demo.mp3
    -rw-r–r– 1 root root 2.0M Sep 14 06:32 obd-demo.wav
    -rw-r–r– 1 root root 181K Sep 15 16:57 obd-demo.alaw

  • [au]law are ‘headerless’ file formats so the ‘file’ command can’t help.
    Sox needs a clue as well. (See what sox says if you change the file name
    from example.alaw to

    Personally, I prefer to use WAV (not the funky ‘gsm in wav’ kind) files

    I don’t think ‘transcoding’ between [au]law and wav is a big deal CPU wise
    and I like easy to use file formats.

    Call me lazy, but being able to just type ‘play example.wav’ or ‘audacity
    example.wav’ has value to me. So does being able to email an audio file to
    a ‘non-techie’ and not having to explain anything.

    If you’re looking to squeeze every last CPU cycle, there are probably
    better places to look. If you are really that tight on resources, maybe
    you should reconsider your hardware choices.