sdl.mpeg
Class SDLMpeg

java.lang.Object
  |
  +--sdl.mpeg.SDLMpeg

public class SDLMpeg
extends java.lang.Object

Java binding for SMPEG - Mpeg I/ MP3 decoder and player.
Basic use is a follows

 	SDLMpeg m_Mpeg =new SDLMpeg("song.mp3");
 	m_Mpeg.enableAudio(true);
 	test.m_Mpeg.play();
Its always a good idea to set your player up as an event listener so you can interrupt the playing.

About SMPEG

excerpt from SMPEG homepage

SMPEG is based on UC Berkeley's mpeg_play software MPEG decoder and SPLAY, an mpeg audio decoder created by Woo-jae Jung. We have completed the initial work to wed these two projects in order to create a general purpose MPEG video/audio player for the Linux OS. Based on our initial work, SMPEG is able to playback MPEG video with sound on Pentium II based systems. SMPEG does not achieve adequate performance on slower systems.

excerpt from SMPEG "README" Release notes

SDL MPEG Player Library (SMPEG)

Written by Karl Robillard and Sam Lantinga, Loki Software, Inc. Streaming MPEG support contributed by Vivien Chappelier.

SMPEG is a free MPEG1 video player library with sound support. Video playback

is based on the ubiquitous Berkeley MPEG player, mpeg_play v2.2. Audio is played through a slightly modified mpegsound library, part of Splay v0.8.2. SMPEG supports MPEG audio (MP3), MPEG-1 video, and MPEG system streams.

This library is distributed under the GNU Library Public License (LGPL) version 2.

plaympeg, gtv, and glmovie are simple video players provided to test the library. The C library interface is 'documented' in smpeg.h, and the C++ library interface is spread out over the MPEG*.h files.

This is a work in progress. Only 16 or 32 bit color depth is supported. The player will dynamically conver to other color depths, but playback will be much faster if your display is already set to 16 bit color depth. Currently it has only been tested on Linux.


Field Summary
static int STATUS_SMPEG_ERROR
           
static int STATUS_SMPEG_PLAYING
           
static int STATUS_SMPEG_STOPPED
           
 
Constructor Summary
SDLMpeg()
           
SDLMpeg(java.lang.String fileName, boolean useAudio)
           
 
Method Summary
 void enableAudio(boolean enable)
           
 void enableVideo(boolean enable)
           
 int getHandle()
           
 SDLMpegInfo getInfo()
           
 int getStatus()
           
static SDLMpegVersion getVersion()
           
 void loop(int nbLoops)
           
 void pause()
           
 void play()
           
 void volume(int volume)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STATUS_SMPEG_ERROR

public static final int STATUS_SMPEG_ERROR
See Also:
Constant Field Values

STATUS_SMPEG_STOPPED

public static final int STATUS_SMPEG_STOPPED
See Also:
Constant Field Values

STATUS_SMPEG_PLAYING

public static final int STATUS_SMPEG_PLAYING
See Also:
Constant Field Values
Constructor Detail

SDLMpeg

public SDLMpeg()

SDLMpeg

public SDLMpeg(java.lang.String fileName,
               boolean useAudio)
Method Detail

getInfo

public SDLMpegInfo getInfo()

getHandle

public int getHandle()

getVersion

public static SDLMpegVersion getVersion()

play

public void play()

pause

public void pause()

volume

public void volume(int volume)

enableAudio

public void enableAudio(boolean enable)

enableVideo

public void enableVideo(boolean enable)

loop

public void loop(int nbLoops)

getStatus

public int getStatus()