Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6839537
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:43:50+00:00 2026-05-26T23:43:50+00:00

I am trying to Play MP3 and getting unexpected errors. I have tested my

  • 0

I am trying to Play MP3 and getting unexpected errors.
I have tested my app before 3 days

which was working perfect on my device

but now even that same jar file is giving me following error.

javax.microedition.midlet.MediaException:Sounds not allowed

error is coming when it executes this line
player.prefetch()

I am testing this app on Nokia 5200 and Nokia 5130

what could be problem?
Please guide me.
Following is my code.

public class PlayAudioMidlet extends MIDlet {

private Display display;
AudioPlayer ap;

public void startApp() {

display = Display.getDisplay(this);
ap = new AudioPlayer(this, display);
display.setCurrent(ap); // display a subclass of Form named as AudioPlayer
}

public void pauseApp() {
}

public void destroyApp(boolean unconditional) {
notifyDestroyed();
}
}

class AudioPlayer extends Form
implements CommandListener, PlayerListener {

PlayAudioMidlet midlet;
private Display display;
private Command play, stop, exit, forward, backward;
private Player player;

public AudioPlayer(PlayAudioMidlet midlet, Display display) {

super("");
this.midlet = midlet;
this.display = Display.getDisplay(midlet);

play = new Command("Play", Command.OK, 0);
stop = new Command("Stop", Command.STOP, 0);
exit = new Command("Exit", Command.EXIT, 0);

addCommand(play);
addCommand(stop);
addCommand(forward);
addCommand(backward);
addCommand(exit);

setCommandListener(this);
}

public void commandAction(Command c, Displayable d) {

if (c == play) {
try {
//System.out.println(System.currentTimeMillis());
playAudio();
} catch (Exception e) {
e.printStackTrace();
}
} else if (c == stop) {
player.close();
}
}

public void playerUpdate(Player player, String event, Object eventData) {
}

public void playAudio() {
int i = 0;
try {
**//Even this commented line doesn't work
//player = Manager.createPlayer(getClass().getResourceAsStream("/res/alert.mp3"), "audio/mpeg");
player = Manager.createPlayer("file:///E:/Sound/alert1.mp3");**
player.addPlayerListener(this);
// player.setLoopCount(-1);
player.prefetch();
player.realize();
player.start();
} catch (Exception e) {
Alert a = new Alert("");
a.setString("Error "+e.toString());
a.setTimeout(Alert.FOREVER);
display.setCurrent(a);

}
}
} 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T23:43:50+00:00Added an answer on May 26, 2026 at 11:43 pm

    I found the solution.

    due to some problem in my code, device was not able to play any kind of music.
    So I just restored my device with factory settings. And it is working.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm just trying to get a simple mp3 player working. I'm getting an error
I am trying to play an MP3 via AVAudioPlayer which I thought to be
I'm trying to use fmodex 4.30.03 to play an MP3 file under Mono/Ubuntu. My
I'm trying to play an mp3 in a Mac Application in Xcode 4.2. How
I'm trying to play a remote MP3 file in my Xcode project, however the
We are trying to develop an app for Android where you can play a
I have an application that needs to play some specifics audios(mp3) periodically. Let me
I'm trying to play a single mp3 file on my software when a button
I'm trying to play/stream a mp3 hosted on a website. The site requires a
I'm trying to play an mp3 file from a website. The following code gives

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.