Tarsos Transcoder is a library to transcode audio with JAVA. It also supports
all kinds of streams.
Downloads can be found on the release repository. Some information can also be found here.
It uses (platform dependent) FFmpeg binaries in the background. It is a fork of JAVE (Java Audio and Video Encoder) by Carlo Pelliccia (www.sauronsoftware.it).
Tarsos Transcoder focuses only on audio and it is compatible with more, and more recent FFmpeg binaries and it less dependent on text output of the different binaries. The interface is also simplified. It falls back to use the ffmpeg binary in the system path, if one is present, therefore it supports platforms for which no binary is provided within the release.
If you have Apache Ant and git installed on your system the following commands get you started quickly:
git clone https://JorenSix@github.com/JorenSix/TarsosTranscoder.git
cd TarsosTranscoder/build
ant #Compiles and builds the core TarsosTranscoder library
ant javadoc #Creates the javadoc documentation in TarsosTranscoder/doc
java -jar tarsos_transcoder-1.0.jar ../audio/input/tone/tone_10s.wav test.flac FLAC_MONO_44KHZ #Test wav to flac transcoding
If you want to use the transcoder from within Java you need to call Transcoder. It is as simple as:
Transcoder.transcode("foo.mp3","foo.wav",DefaultAttributes.WAV_PCM_S16LE_STEREO_44KHZ);
To stream, decode, resample and downmix audio from about any source the following
calls suffice. The code yields an AudioInputStream
in the requested AudioFormat
, which can then be used for your purposes.
String radioStream = "http://mp3.streampower.be/stubru-high.mp3";
AudioInputStream stream = Streamer.stream(radioStream,DefaultAttributes.WAV_PCM_S16LE_STEREO_44KHZ);
AudioFormat streamFormat = Streamer.streamAudioFormat(DefaultAttributes.WAV_PCM_S16LE_STEREO_44KHZ);
FFmpeg can encode to a lot of audio formats and can decode even more.
Tarsos Transcoder tries to find an FFmpeg binary in the path of the system. If it does not find one it tries to copy a binary for the current platform. Tarsos Transcoder contains three binaries: one for MAC OS X, one for Linux (x86) and one for windows. Tarsos Transcoder has been tested on:
It will probably work most of the time.
If the TarsosTranscoder does not include binaries for you platform, install ffmpeg and add the ffmpeg executable to your system path. It will be found and used by TarsosTranscoder automatically.
Alternatively, providing binaries for your (unsupported) platform can be done by implementing FFMPEGLocator
. The PickMe()
method should yield true on your platform and copy e.g. an FFmpeg binary to a temporary directory.
This software is licensed under GPL, TarsosTranscoder is based on JAVE (GPL).
JAVE (Java Audio and Video Encoder) by Carlo Pelliccia – www.sauronsoftware.it
FFmpeg: this uses libraries from the FFmpeg project under the LGPLv2.1
This product includes software developed by The Apache Software Foundation. It uses the Apache Commons Exec library, licensed under the Apache License Version 2.0
TarsosTranscoder is used by Tarsos, Tarsos is developed at University College Ghent, Faculty of Music and University Ghent, IPEM