Question

is there any example on how to use LameOnJ, Pure Java Mp3 Encoder etc. to encode WAV format to MP3 in java? Example code, tutorial anything would be great!

I'm fully confused in libraries right now; tried Tritonus lib but it gave me:

Error: Unsupported conversion: MPEG1L3 from PCM_SIGNED 44100.0 Hz, 16 bit, stereo, 4 bytes/frame, little-endian

Maybe thats because I use Mac OS - but I followed Linux instructions as there's no MAC instructions available?! Any suggestions?

Was it helpful?

Solution

As an alternative, use JAVE (J ava A udio V ideo E ncoder) library:

The JAVE (Java Audio Video Encoder) library is Java wrapper on the ffmpeg project. Developers can take take advantage of JAVE to transcode audio and video files from a format to another. In example you can transcode an AVI file to a MPEG one, you can change a DivX video stream into a (youtube like) Flash FLV one, you can convert a WAV audio file to a MP3 or a Ogg Vorbis one, you can separate and transcode audio and video tracks, you can resize videos, changing their sizes and proportions and so on. Many other formats, containers and operations are supported by JAVE.

OTHER TIPS

ON website of Jave for Java:

JAVE is not pure Java: it acts as a wrapper around an ffmpeg (http://ffmpeg.mplayerhq.hu/) executable. ffmpeg is an open source and free software project entirely written in C, so its executables cannot be easily ported from a machine to another. You need a pre-compiled version of ffmpeg in order to run JAVE on your target machine. The JAVE distribution includes two pre-compiled executables of ffmpeg: a Windows one and a Linux one, both compiled for i386/32 bit hardware achitectures. This should be enough in most cases. If it is not enough for your specific situation, you can still run JAVE, but you need to obtain a platform specific ffmpeg executable :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top