Hi all,
I try to play an audio file from the micro SD card in Nokia 6131. The following code is what I used:
try
{
FileConnection fileConnection = (FileConnection) Connector.open(path);
InputStream inputStream = fileConnection.openInputStream();
Player player = Manager.createPlayer(inputStream, mimeType);
player.realize();
String contentType = inputStream.getContentType();
player.setLoopCount(1);
player.start();
}
catch (Exception e)
{
...
}
However, I always get "Device Error" exception during start(). I have verified that getContentType() returns correctly.
I have also tried the MediaSampler midlet (original .jar as well as recompiled .jar), both give the same "Device Error" exception. What could be wrong? Any suggestion on the source code?

Reply With Quote

