Olá pessoa,
estou recebendo o seguinte erro ao tentar executar um arquivo .mp3
Unable to handle format: mpeglayer3, 44100.0 Hz, 16-bit, Stereo, LittleEndian, Signed, 12000.0 frame rate, FrameSize=32768 bits
Failed to realize: com.sun.media.PlaybackEngine@8814e9
Error: Unable to realize com.sun.media.PlaybackEngine@8814e9
No media player found
Classe
import java.awt.*;
import java.net.*;
import javax.media.*;
import javax.swing.JPanel;
public class Test_Sound extends JPanel
{
public Player mediaPlayer;
public Test_Sound( URL mediaURL )
{
setLayout( new BorderLayout() );
setBackground(Color.BLACK);
Manager.setHint( Manager.LIGHTWEIGHT_RENDERER, true );
try
{
mediaPlayer = Manager.createRealizedPlayer( mediaURL );
// double time = mediaPlayer.getDuration().getSeconds();
Component video = mediaPlayer.getVisualComponent();
Component controls = mediaPlayer.getControlPanelComponent();
if ( video != null )
{
add( video, BorderLayout.CENTER );
}
if ( controls != null )
{
add( controls, BorderLayout.SOUTH );
}
mediaPlayer.start();
}
catch (Exception noPlayerException )
{
System.err.println( "No media player found" );
mediaPlayer.close();
}
}
}
eu nao lembro, mas eu acho q eu ja executei mp3 com esse codigo a um tempo atraz