Reg: Java sound on wince using creme jvm - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Reg: Java sound on wince using creme jvm

Hi,


Im developing a java application using java sound api on wince platform. we have installed creme jvm resolve jvm need in wince platform. creme jdk version is 1.3.1. so now when i execute the application , frame open , but when i c my log file , ts gives a error such

-jar: jar file /SDMEM/jana/AudioPlayer.jar not found: java.lang.reflect.InvocationTargetException

Im bit confused, about wat the problem really is, even i searched in net to solve the problem, but i couldnt and no break for this problem.

Here is my java code

package audio;
import java.applet.Applet;
import java.applet.AudioClip;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.MalformedURLException;

import javax.swing.JFrame;
import javax.swing.JLabel;

public class Play extends JFrame
{
/**
*
*/
private static final long serialVersionUID = 1L;
JLabel label;
public Play()
{
log("1");
try
{
log("2");
//File file = new File("D:/1.wav");
File file = new File("file:///SDMEM/jana/helloworld.au");
log("3");
label = new JLabel();
log("4");
setTitle(file.toString());
log("5");
label.setText(file.toString());
log("6");
getContentPane().add(label);
log("7");
setSize(170,100);
log("8");
setVisible(true);
log("9");
AudioClip clip = Applet.newAudioClip(file.toURL());
log("10");
clip.loop();
log("11");
// Play
clip.play();
log("12");
Thread.sleep(30000);
log("13");
} catch (InterruptedException e) {
} catch (MalformedURLException e) {
}
}


public static void main(String args[])
{
Play play = new Play();

}
public static void log(String log)
{
DataOutputStream dos = null;
try
{
System.out.println("Log accessed >>> " + log);
//dos = new DataOutputStream(new FileOutputStream("D:/SoundLog.txt", true));
dos = new DataOutputStream(new FileOutputStream("/SDMEM/SoundLog.txt", true));
dos.writeBytes(log);
dos.close();
}
catch(FileNotFoundException ex)
{
ex.printStackTrace();
}
catch(IOException ex)
{
ex.printStackTrace();
}
}
}


Please help me,
Thanks in advance

Janardhan.B
Sign In or Register to comment.