Java Beginners

Moderators: zibadian
Number of threads: 1233
Number of posts: 2675

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Reg: Java sound on wince using creme jvm Posted by janabesseti on 11 Nov 2009 at 8:31 AM
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



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.