File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Convert pcm wav file to mp3 file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Convert pcm wav file to mp3 file" Watch "Convert pcm wav file to mp3 file" New topic

Convert pcm wav file to mp3 file

jan dressen
Ranch Hand

Joined: Oct 25, 2007
Posts: 47
is it possible to convert an PCM file to an mp3 file? if yes, how?

thanks alot
Pat Farrell

Joined: Aug 11, 2007
Posts: 4659


Do you mean purely withing Java? I'm sure the answer is yes, but I would not do that. Use 'lame', which is a cross platform program designed to do exactly that.

Do not reinvent the wheel, use someone else's wheel and do something creative.
Rob Spoor

Joined: Oct 27, 2005
Posts: 20184

You may be able to use LameOnJ for that.

How To Ask Questions How To Answer Questions
jan dressen
Ranch Hand

Joined: Oct 25, 2007
Posts: 47
well, actually i would like to do it completely in java, so not using lameOnJ, but thanks for the advice.
is it possible with JMF? or can anyone help with an example..

thanks alot
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 15038

Try Google, search for "java encode mp3" for example. This looks useful: MP3 Encoding in Java.

One problem with this, is that MP3 is not a free format. You'd need to pay a license fee to the inventors if you'd want to publish an MP3 encoder.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
subject: Convert pcm wav file to mp3 file
It's not a secret anymore!