views:

2057

answers:

2

File formats I would like to play include wav, mp3, midi.

I have tried using the Wireless Toolkit classes with no success. I have also tried using the AudioClip class that is part of the Samsung SDK; again with no success.

Thanks

A: 

Without source code to review, I would suggest using the wireles toolkit (from http://java.sun.com)first. It contains the standard J2ME emulator for windows and example code that will allow you to play a wav file. assuming that works OK for you, try the same code on your Samsung device (of course, the location of the wav file will probably change so you have a tiny modification to make in the example code). Assuming that works, compare your code that doesn't with the example code.

QuickRecipesOnSymbianOS
+2  A: 

If this device supports audio/mpeg you should be able to play mp3 use this code inside your midlet...

This works on my nokia symbian phones

// Code starts here put this into midlet run() method

public void run()
{
  try
  {
    InputStream is = getClass().getResourceAsStream("your_audio_file.mp3");
    player = Manager.createPlayer(is,"audio/mpeg");

//  if "audio/mpeg" doesn't work try "audio/mp3"

    player.realize();  
    player.prefetch();
    player.start();
  }
  catch(Exception e)
  {}
}

As for emulators my nokia experience is that I couldn't make it emulate mp3 player but when I put application on phone it works...

Irfan Mulic