Find the answer to your Linux question:
Results 1 to 6 of 6
Hi, I would like to resample and reencode some mp3 files so that they play at a slower speed (at around 90% of the original speed), and I want the ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jun 2009
    Posts
    5

    audacity "change speed" type operation with mencoder/ffmpeg?


    Hi,

    I would like to resample and reencode some mp3 files so that they play at a slower speed (at around 90% of the original speed), and I want the pitch to change correspondingly, i.e. i *don't want* any sort of pitch compensation to be performed. Basically my goal is just to "fix" these mp3 files that seem to be speeded up versions of a speech recording (and the speaker's voice sounds higher than it actually is) so I just want to reverse the effect.

    Audacity, which I use at home with Windows, has this feature. I want to do the same thing at work (we use Ubuntu Linux, and both ffmpeg and mencoder are available).

    How can I achieve this with either of these programs? Can anyone give me a sample command?

    Thank you in advance.

  2. #2
    Linux Engineer psic's Avatar
    Join Date
    Nov 2004
    Location
    Ljubljana, Slovenia
    Posts
    1,205
    Why not just use Audacity in Ubuntu?
    Stumbling around the 'net:
    www.cloudyuseful.com

  3. #3
    Just Joined!
    Join Date
    Jun 2009
    Posts
    5
    Quote Originally Posted by psic View Post
    Why not just use Audacity in Ubuntu?
    because we aren't allowed to install software on our machines, and it's not worth it for me at the moment to expend the effort of compiling audacity from source. And I would prefer the ease and convenience of a shell command if possible.

  4. #4
    Linux Engineer psic's Avatar
    Join Date
    Nov 2004
    Location
    Ljubljana, Slovenia
    Posts
    1,205
    Kind of figured you'd say that. Well, I know Mplayer has a scale tempo filter. It seems as if their html man page isn't working at the moment, but an example from the txt would be:

    mplayer -af scaletempo -speed 1.2 media.ogg

    I'm not sure how you would do this directly with ffmpeg and mencoder
    Stumbling around the 'net:
    www.cloudyuseful.com

  5. #5
    Just Joined!
    Join Date
    Jun 2009
    Posts
    5
    Quote Originally Posted by psic View Post
    Kind of figured you'd say that. Well, I know Mplayer has a scale tempo filter. It seems as if their html man page isn't working at the moment, but an example from the txt would be:

    mplayer -af scaletempo -speed 1.2 media.ogg

    I'm not sure how you would do this directly with ffmpeg and mencoder
    Thanks, your reply has led me through to a (so far) partial solution. As for as playback speed adjustment goes,
    mplayer -speed 0.9 inputfile.mp3
    does the trick for me. Basically I was not aware of the mplayers "speed" option... should have looked at the man page. (I don't want to use the "scaletempo" filter, since the whole purpose of what i want to achieve is to change the pitch of the playback along with the speed, as I mentioned in the OP... and besides the version of mplayer i have doesn't seem to support it anyway.)

    By googling, I found I could dump the audio into a pcm wav file:
    mplayer -quiet -vo null -vc dummy -ao pcm:waveheader:file="rawaudio.wav" "inputfile.mp3"

    Now all I need to do is to convert the rawaudio.wav to mp3. Unfortunately, we don't seem to have "lame" on our system. I also checked out ffmpeg -formats and it didn't find any mp3 encoders.
    But anyway, I'm sure the solution is close at hand... maybe I can compile lame from source or find a self-contained precompiled binary or something (unless you have any other suggestions i could try).

    Anyway, thanks a lot for your help!

  6. #6
    Linux Engineer psic's Avatar
    Join Date
    Nov 2004
    Location
    Ljubljana, Slovenia
    Posts
    1,205
    I think with ffmpeg you can just do:

    ffmpeg -i /file.wav /file.mp3

    Here's its on-line man page: click.

    Glad to be of help
    Stumbling around the 'net:
    www.cloudyuseful.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •