Hello everyone,


When running the following block of source codes (the MMAPI library I am using is downloaded from http://www.sun.com/software/communitysource/j2me/mmapi/)

public static void main(String[] args) {
	
	try {
		Player player = Manager.createPlayer"http://localhost/sample.wav");
		player.start();
	} catch (MediaException e) {
		e.printStackTrace();
	} catch (IOException e) {
		e.printStackTrace();
	}
}

java.lang.UnsatisfiedLinkError will be thrown,

Exception occurs in thread “main java.lang.UnsatisfiedLinkError: com/sun/mmedia/WaveOut.nOpen(IIIII)I
	at com.sun.mmedia.WaveOut.open(Unknown Source)
	at com.sun.mmedia.WavPlayer.doPrefetch(Unknown Source)
	at com.sun.mmedia.BasicPlayer.prefetch(Unknown Source)
	at com.sun.mmedia.BasicPlayer.start(Unknown Source)

I am wondering how to solve this issue?


Thanks in advance,
George

public static void main(String[] args) {
	
	try {
		Player player = [B]Manager.createPlayer"http://localhost/sample.wav");[/B]
		player.start();
	} catch (MediaException e) {
		e.printStackTrace();
	} catch (IOException e) {
		e.printStackTrace();
	}
}

could the problem be leaving out a parenthesis?

public static void main(String[] args) {
	
	try {
		Player player = Manager.createPlayer("http://localhost/sample.wav");
		player.start();
	} catch (MediaException e) {
		e.printStackTrace();
	} catch (IOException e) {
		e.printStackTrace();
	}
}

Thanks server_crash,

public static void main(String[] args) {
	
	try {
		Player player = [B]Manager.createPlayer"http://localhost/sample.wav");[/B]
		player.start();
	} catch (MediaException e) {
		e.printStackTrace();
	} catch (IOException e) {
		e.printStackTrace();
	}
}

could the problem be leaving out a parenthesis?

public static void main(String[] args) {
	
	try {
		Player player = Manager.createPlayer("http://localhost/sample.wav");
		player.start();
	} catch (MediaException e) {
		e.printStackTrace();
	} catch (IOException e) {
		e.printStackTrace();
	}
}

Your reply is very helpful. I think you are very careful. ;) It is a copy&paste mistake of myself. My actual source codes are the same as you have correctly written. But it still has the exceptions which I quoted. I am wondering what is the cause of this issue and how to solve it.


regards,
George

Is this for a mobile device? The library you downloaded is:
Micro Edition Mobile Media API Reference Implementation Version 1.0 (MMAPI)
You may be experiancing problems because you are trying to run the app as a PC app, and the library is not designed for the PC environment. Hence the Link error.

If you simply want to play a .wav file, there are much simplier ways of doing this. That is of course, if your wanting to do this on a pc....

Thanks jerbo,

Is this for a mobile device? The library you downloaded is:
Micro Edition Mobile Media API Reference Implementation Version 1.0 (MMAPI)
You may be experiancing problems because you are trying to run the app as a PC app, and the library is not designed for the PC environment. Hence the Link error.

I am writing an application for Foundation profile of J2ME. It is not running on PC (J2SE). Do you know how to solve this issue?


regards,
George

Unfortunatly, I have not done any development work using J2ME. Sorry I couldn't help; it was a shot in the dark.

Thanks server_crash,

Check out this:

http://www.javakb.com/Uwe/Forum.aspx/java-programmer/14139/re-playing-sound-in-J2ME

I don't know if this will help or not. I haven't had any experience working with j2me either.

I have read this discussion and it is very helpful. But I think this discussion is not similar to my issue. My issue is that the sound can not be played, and the discussion is dealing with how to solve delay issue (the sound can be played in this discussion). I am wondering your comments.


regards,
George

Never mind jerbo,

Unfortunatly, I have not done any development work using J2ME. Sorry I couldn't help; it was a shot in the dark.

Your previous replies are very helpful. Thanks all the same.


regards,
George

Thanks server_crash,


I have read this discussion and it is very helpful. But I think this discussion is not similar to my issue. My issue is that the sound can not be played, and the discussion is dealing with how to solve delay issue (the sound can be played in this discussion). I am wondering your comments.


regards,
George

I knew it was a little different, but I was hoping you could use their methods of playing sound in your app.

Thanks for all the people who helped me on this thread.


regards,
George

had any luck in solving the error...is there any workaround for it..please let me know..
-agal

Thanks agal,

had any luck in solving the error...is there any workaround for it..please let me know..
-agal

The issue is still not solved. Do you have similar issue? Please let me know if you have solved the issue.


regards,
George

If you downloaded the source code and it's suppose to work, my only guess would be that some kind of "library" is missing which is operating system independent.

Thanks server_crash,

If you downloaded the source code and it's suppose to work, my only guess would be that some kind of "library" is missing which is operating system independent.

Your reply is very helpful. Do you know what libraries are missing or how to detect what libraries are missing?


regards,
George

This article has been dead for over six months. Start a new discussion instead.