ciao!
ho scaricato e "installato" JMF in un mio progetto.
quando provo a sentire un mp3 mi esce questo:
codice:
Unable to handle format: mpeglayer3, 48000.0 Hz, 16-bit, Stereo, LittleEndian, Signed, 8000.0 frame rate, FrameSize=32768 bits
Failed to realize: com.sun.media.PlaybackEngine@6a6824be
Error: Unable to realize com.sun.media.PlaybackEngine@6a6824be
leggendo in giro, ho visto che ci sarebbe da installare anche un plugin per JMF: http://www.oracle.com/technetwork/ja...ad-137625.html
il problema è che quando vado alla pagina di download, non lo vedo.
a questo punto non capisco.
questo l'ultimo codice provato:
codice:
public class TestAudio {
public static void testAudio() throws UnsupportedAudioFileException, IOException, LineUnavailableException, NoPlayerException, CannotRealizeException {
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
);
String strFile = "canzone.mp3";
Player player = Manager.createPlayer(new MediaLocator(new File(strFile).toURI().toURL()));
player.start();
}
}