Reputation: 615
In J2ME, How do I come to know that what is the capability of emulator to play certain media file though it is .mp3 or .wav or any other file
I am using Netbeans with WTK emulators & also nokia SDK 1.1.0 emulator....
Upvotes: 0
Views: 497
Reputation: 31045
Try this code. It uses the same Manager API that you used in your last question.
import javax.microedition.media.Manager;
...
String supportedTypes[] = Manager.getSupportedContentTypes(null);
for (int i = 0; i < supportedTypes.length; i++) {
if (supportedTypes[i].startsWith("audio")) {
System.out.println("Device supports " + supportedTypes[i]);
}
}
running this for me produced the following output on a BlackBerry 9550:
[0.0] Device supports audio/x-tone-seq
[0.0] Device supports audio/midi
[0.0] Device supports audio/mpeg
[0.0] Device supports audio/x-wav
[0.0] Device supports audio/amr
[0.0] Device supports audio/x-gsm
[0.0] Device supports audio/mp4
[0.0] Device supports audio/aac
[0.0] Device supports audio/x-ms-wma
Upvotes: 2