Tuesday, 15 April 2014

java - JMF + mp3plugin.jar mp3 files is not playing -



java - JMF + mp3plugin.jar mp3 files is not playing -

i have code :

bundle test; import java.io.file; import javax.media.format; import javax.media.manager; import javax.media.medialocator; import javax.media.player; import javax.media.pluginmanager; import javax.media.format.audioformat; public class audiotest { public static void main(string[] args) { format input1 = new audioformat(audioformat.mpeglayer3); format input2 = new audioformat(audioformat.mpeg); format output = new audioformat(audioformat.linear); pluginmanager.addplugin( "com.sun.media.codec.audio.mp3.javadecoder", new format[]{input1, input2}, new format[]{output}, pluginmanager.codec ); try{ player player = manager.createplayer(new medialocator(new file("1.mp3").touri().tourl())); player.realize(); player.start(); } catch(exception ex){ ex.printstacktrace(); } } }

i'm trying play mp3 file, mp3plugin added project lib jmf jar. there's no error on console cant hear sound.

the file not playing. .wav files playing fine.

any thought ?

jmf bad option. project abandoned long time ago. have answered similar question here:

java - error when trying utilize mp3plugin playing mp3 file

it might usefull - im using java sound

java mp3 javasound jmf

No comments:

Post a Comment