Question

I get a MediaException (Prefetch error: -5) when executing the following code on a Nokia N73. It runs fine in the emulator and I have tried the same thing before on the same phone successfully. The only difference now is that I am using NetBeans to build and deploy rather than Eclipse.

inputPlayer = Manager.createPlayer("capture://audio?encoding=pcm&rate=4000&bits=16&channels=1");
inputPlayer.realize();
inputPlayer.prefetch();
inputPlayer.start();

I am wondering whether it is security related, as with Eclipse I always got a security prompt on the phone. With NetBeans I do not get any prompt, just the Exception.

Was it helpful?

Solution

-5 is Symbian error code KErrNotSupported.

The N73 is based on Symbian OS v9.1

Native (from Symbian C++) error codes are sometimes propagated into Java exceptions when the JSR-135 implementation couldn't find a nicer way to express the error.

OTHER TIPS

Make sure that you do not have any other player references held. That is, you are not attempting to prefetch the second player object, while the first one is not yet released/closed. Also, esp on the Nokia, try releasing it on a separate thread, as closing/releasing the player on the same thread is know to cause some problems. Same with creating too.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top