Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Java media frame

  Asked By: Harry    Date: Feb 14    Category: Java    Views: 1052
  

i'm trying to learn Java media frame. I tried to write a audio
player that dosn't seem to work. Can anybody recommend a online JMF
tutorial besides what is on java.sun's website. i want to write a
program that caputures video from mutilple firewire cameras. could
somebody recommend a book or tutorial that would be helpful.
this is the sample code i wrote for a media player that will not work

import javax.media.*;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.net.MalformedURLException;

public class SimpleAudioPlayer {
private Player audioPlayer = null;

public SimpleAudioPlayer(URL url) throws IOException,
NoPlayerException,
CannotRealizeException {
audioPlayer = Manager.createRealizedPlayer(url);
}
public SimpleAudioPlayer(File file) throws IOException,
NoPlayerException,
CannotRealizeException {
this(file.toURL());
}

public void play() {
audioPlayer.start();
System.out.println("playing");}
public void stop() {
audioPlayer.stop();
audioPlayer.close();
}

public static void main(String args[]) throws IOException,

NoPlayerException,
CannotRealizeException{
File audioFile = new File(args[0]);
SimpleAudioPlayer player = new SimpleAudioPlayer(audioFile);
player.play();
player.stop();
}
}
i run it after i compile it buy using this command but i don't hear
any files playing.
java SimpleAudioPlayer SOUND43.WAV

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Eileen Carr     Answered On: Feb 14

I'm working with Java Media Framework and I've noticed some problem with
closing processor.
I have some application that gets video  stream from webcam and send it
over LAN (using RTPMenager) to other PCs.
When I try to close  transmission, just after transmission get started,
the transmission closed properly. But when I closed transmission after a
while it seems that aplcation get stucked in processor.close function !
Does anyone have some experience with this ?
Any suggestion ?

 
Didn't find what you were looking for? Find more on Java media frame Or get search suggestion and latest updates.




Tagged: