JAVA Multimedia Support - PowerPoint PPT Presentation

1 / 14
About This Presentation
Title:

JAVA Multimedia Support

Description:

Java programme can manipulate and play audio clips. ... Giving support for video in java requires the some standard movie file format ... – PowerPoint PPT presentation

Number of Views:31
Avg rating:3.0/5.0
Slides: 15
Provided by: osirisSun
Category:

less

Transcript and Presenter's Notes

Title: JAVA Multimedia Support


1
JAVA Multimedia Support
  • Moinuddin Mohammed W.
  • MSc Network System
  • mmwaseem_at_hotmail.com

2
Multimedia
  • The Java Application Programming Interface (API)
    provides support for multimedia activities and
    Java Media API contains a set of multimedia
    classes that support a wide range of multimedia
    including audio, video, animation, images etc.

3
Audio Support in Java
  • Java programme can manipulate and play audio
    clips. There are two ways of playing sound in an
    Applet, one is Applets play( ) method and
    another the play( ) method from the AudioClip
    Interface. The first one load the audio clip and
    plays it once and second method allows audio to
    be stored in the program and can be reused
    throughout the program execution.

4
Audio Support in Java (Contd.)
  • We can create and play AudioClips from both
    Applets and Applications
  • Three methods are invoked when an AudioClip is
    loaded
  • play( ) method plays the audio once
  • loop( ) method continuously plays the audio
  • stop( ) method stop the audio clip

5
Audio Support in Java (Contd.)
  • //a simple program that play a audio file once
  • import java.applet.
  • Import java.awt.
  • public class Sound extends Applet
  • public void init( )
  • play(getCodeBase( ), music.au)

6
Audio Support in Java (Contd.)
  • Java supports Musical Instrument Digital
    Interface (MIDI), it is not a actual recording as
    .wav file is. MIDI files are computer programs
    that instruct a synthesizer to produce sound. It
    transmits information how music is produced. An
    advantage is very small file size but the
    disadvantage is the low specific sound control.

7
Images supported in Java
  • Java supports file format end with (Graphics
    Interchange Format ).gif and ( Joint Photographic
    Expert Group) .jpeg and .jpg
  • getImage( ) method loads the image, and to
    display a image one invokes the drawImage( )
    method of the Graphics object that is passed to
    the Applet paint( ) method

8
Images supported in Java (Contd.)
  • Every image is represented by a java.awt.Image
    object.
  • To display a image using Graphics object a method
    named g.drawImage(image, 0, 0, this) is invoked
    where g is object of Graphics.

9
Images supported in Java (Contd.)
  • imageIcon( ) method determines if image is
    completely loaded into memory and only completed
    images should be displayed. Java also support
    Image map, image that has hot areas that can be
    clicked as hyper-reference.

10
Java Media Player
  • Comes with JMF
  • Can support
  • Audio .au, .wav, .mid
  • Video .avi, .gsm, .mpg, .rtp

11
Animation Support in Java
  • Animation sequence in which a series of pre-drawn
    diagrams are displayed one after another that
    creates an animation.
  • Java API provides support for animation.
  • Java Development Kit (JDK) includes classes and
    methods that help to load and manipulate
    animation.
  • Classes like Applet, Image, Graphics play
    important role for making animations.

12
Video Support in Java
  • Basically there are two types of video
  • Standard video that must be downloaded before
    playing it on Internet.
  • These type of videos are depend upon size of
    the file and bandwidth available.
  • Instead of downloading large file frames of
    video are buffered and begin playing the video,
    as more frames are placed into the buffer.

13
Video Support in Java (Contd.)
  • Giving support for video in java requires the
    some standard movie file format like .au etc.
    Streaming video is best way for low bandwidth
    connections.

14
References
  • Http//sun.java.com
  • Cay S. Horstmann, Gary Cornell (2000), Core JAVA.
    Volume II-Advanced Features, Sun Mirosystems inc.
    Cal. U.S.
Write a Comment
User Comments (0)
About PowerShow.com