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 8237477
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T19:28:53+00:00 2026-06-07T19:28:53+00:00

I got problem about play wav file in my application. This is my error:

  • 0

I got problem about play wav file in my application.

This is my error:

java.lang.IllegalArgumentException
 at javax.microedition.media.Manager.createPlayer(), bci=8
 at Tajwid.Tajwid.run(Tajwid.java:649)
 at Tajwid.Tajwid.actionPerformed(Tajwid.java:186)
 at com.sun.lwuit.util.EventDispatcher.fireActionSync(), bci=19
 at com.sun.lwuit.util.EventDispatcher.fireActionEvent(EventDispatcher.java:257)

This is my code:

public void run() {
    try {
        InputStream is = getClass().getResourceAsStream("/tes.wav");
        player = Manager.createPlayer(is, "audio/x-wav");

        player.realize();
        // get volume control for player and set volume to max
        vc = (VolumeControl) player.getControl("VolumeControl");
        if (vc != null) {
            vc.setLevel(100);
        }
        player.prefetch();
        player.start();
    } catch (Exception e) {
        e.printStackTrace();
    }

Device Configuration : CLDC-1.1
Device Profile MIDP 2.0

  • 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-06-07T19:28:54+00:00Added an answer on June 7, 2026 at 7:28 pm

    Error message you’ve got has sufficient information to figure what went wrong in the code.

    Look at it a bit closer:

        java.lang.IllegalArgumentException
         at javax.microedition.media.Manager.createPlayer()...
    

    It says something went wrong in Manager.createPlayer(). From your code, it is apparent that you use method Manager.createPlayer(java.io.InputStream stream, java.lang.String type).

    If you look into API documentation for the method you use (available online), you’ll find the explanation when this exception occurs:

        Throws:
            java.lang.IllegalArgumentException - Thrown if stream is null. 
    

    Above means that stream parameter (is in your code) passed to the method is null.

    You could add some logging right after initialization of the is to debug this issue easier:

    InputStream is = getClass().getResourceAsStream("/tes.wav");
    // add some logging to see if initialization was OK or not:
    System.out.println("input stream is null: [" + (is == null) + "]");
    

    That way, when running your MIDlet in emulator, you will see whether is was initialized as expected or not.

    Actually, looking at the code I would guess that you made a typo in file name passed to getResourceAsStream: “/tes.wav” looks like a mis-typed “/test.wav”.

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

Sidebar

Related Questions

I've hit an annoying problem in LaTeX. I've got a tex file of about
I got a problem about how to reverse a string containing this 'abcd汉字efg'. str_to_reverse
I got a problem about including a included file in PHP. Project functions(folder) has
I've got a problem about onbeforeunload recently that I need to pop up a
I have got a strange problem about in_array recently which I cannot understand. e.g.
I have got a performance problem about TextField.htmlText +=msg .And I know that TextField.appendText(msg)
I want to ask about strcpy. I got problem here. Here is my code:
I've got a problem where I need to know about all the bindings that
So I have a tiny problem. I got help here a while ago about
Trying to code a basic text editor to play around with Java's file objects

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.