#6 mpg321 doesn't resample

Joe Drew
Neill Bell

I have an MP3 file with the following characteristics:

Media Type: MPEG 2.0 Layer III
Audio: 64 KB/s, 22KHz (joint stereo)
Emphasis: none
Copyright: No
Original: Yes
Padding: Yes
Length: 6:07

If I play the file via my sound card using a command
like 'mpg321 file.mp3' it sounds normal.

If I process the file like so:

mpg321 -r 44100 -s --stereo -q file.mp3 > file.raw
sox -r 44100 -s -w -c 2 file.raw file.wav

The resulting file appears to be encoded at only half
the bitrate and therefore sounds like it is speeded up
by 2X.

I'm using the mpg321 code from CVS as of today and


  • Neill Bell

    Neill Bell - 2002-02-07

    Sample MP3 file

  • Joe Drew

    Joe Drew - 2002-02-07
    • assigned_to: nobody --> hoserhead
  • Joe Drew

    Joe Drew - 2002-02-07

    Logged In: YES

    Hm, this shouldn't be a problem - I think. I'll have to
    investigate, but the WAV file should have all relevant data
    in the headers, so that different bitrates, etc won't
    matter. Anyhow, post-0.3.0, since I'm concentrating on
    network issues for 0.3.0.

  • Joe Drew

    Joe Drew - 2002-03-27
    • summary: Decoding occurs at half rate --> mpg321 doesn't resample
  • Joe Drew

    Joe Drew - 2002-03-27

    Logged In: YES

    This is a fundamental problem with mpg321. It hasn't got
    resampling capabilities, so it ignores the -r 44100 argument.

    I am planning on enhancing libao, the audio output library
    (which handles all output, even to stdout) to do resampling;
    however, I've not put in the time to do it yet, and might
    not until after mpg321 version 0.3.0 is released.

  • Sam Bingner

    Sam Bingner - 2003-05-20

    Logged In: YES

    This would be good to have so that mpg321 can be used
    instead of mpg123 for asterisk (http://www.asterisk.org) ---
    it has to downsample to 8Khz to play over phone interface.
    The options passed are "-q -s --mono -r 8000 -b 2048" and
    when you listen all you hear is strange gurgling noises.
    Assume it's the resample problem... :)

  • Nobody/Anonymous

    Logged In: NO

    This is a critical bug because instead giving an error or
    resampling correctly cdr files created with --cdr are no
    resampled and sound funny in the cdaudio player.


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks