1 Reply Latest reply: Feb 11, 2013 3:03 PM by jsmith RSS

    java media framework

    990240
      Hi,

      I am getting below error while player.start code

      java.lang.ArrayIndexOutOfBoundsException: 15
           at codecLib.mpa.k.a(Unknown Source)
           at codecLib.mpa.k.do(Unknown Source)
           at codecLib.mpa.Decoder.decode(Unknown Source)
           at com.sun.media.codec.audio.mpa.JavaDecoder.process(JavaDecoder.java:327)
           at com.sun.media.BasicFilterModule.process(BasicFilterModule.java:322)
           at com.sun.media.BasicModule.connectorPushed(BasicModule.java:69)
           at com.sun.media.BasicOutputConnector.writeReport(BasicOutputConnector.java:120)
           at com.sun.media.SourceThread.process(BasicSourceModule.java:729)
           at com.sun.media.util.LoopThread.run(LoopThread.java:135)
      BUILD SUCCESSFUL (total time: 10 seconds)
      Below is the code
      /*************************************************************/
      //package org.jmf.example;

      import java.awt.Component;
      import java.awt.Graphics;
      import java.awt.event.ActionEvent;
      import java.awt.event.ActionListener;
      import java.io.IOException;
      import java.net.MalformedURLException;
      import java.net.URL;
      import javax.media.ControllerEvent;
      import javax.media.ControllerListener;
      import javax.media.Manager;
      import javax.media.NoPlayerException;
      import javax.media.Player;
      import javax.media.RealizeCompleteEvent;
      import javax.swing.JPanel;

      public class examplePanel extends JPanel implements ActionListener, ControllerListener
      {
      private static final long serialVersionUID = 1L;

      private Component visualComponent;
      private Player player;

      public examplePanel()
      {
      try
      {

      player = Manager.createPlayer(new URL("file:///E:/movies/Engeyum-Eppodhum/Govinda.mp3"));
      //player = Manager.createPlayer(new URL("/Govinda.mp3"));
      player.addControllerListener(this);

      player.start();

      }
      catch(NoPlayerException e)
      {
      e.printStackTrace();

      }
      catch(MalformedURLException e)
      {
      e.printStackTrace();
      }
      catch(IOException e)
      {
      e.printStackTrace();

      }
      }

      public void paintComponent(Graphics g)
      {
      super.paintComponent(g);
      }

      public void actionPerformed(ActionEvent e)
      {

      }

      public void controllerUpdate(ControllerEvent c)
      {
      if(player == null) {
      return;
      }

      if(c instanceof RealizeCompleteEvent)
      {
      if((visualComponent = player.getVisualComponent()) != null) {
      add(visualComponent);
      }
      }
      }
      }
        • 1. Re: java media framework
          jsmith
          This is a JavaFX forum.

          JavaFX media (http://docs.oracle.com/javafx/2/media/jfxpub-media.htm) is not the same as the Java Media Framework (http://www.oracle.com/technetwork/java/javase/tech/index-jsp-140239.html).

          As the technology used in your sample relates only to the Java Media Framework, not to JavaFX Media, you are unlikely to get assistance from this forum.