×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Aug 2007
    Posts
    5

    Help me Playing Wave File

    I'm trying to Play Wave File Using This code

    InputStream is=this.getClass().getResourceAsStream("/file.wav");

    try {
    player=Manager.createPlayer(is,"audio/x-wav");
    player.addPlayerListener(this);
    player.realize();
    player.prefetch();
    player.start();

    } catch (MediaException ex) {
    ex.printStackTrace();
    } catch (IOException ex) {
    ex.printStackTrace();
    }
    and i get this exception

    javax.microedition.media.MediaException: Failed to realize Player: Malformed wave media: expected 'RIFF'
    at com.sun.mmedia.WavPlayer.doRealize(+160)
    at com.sun.mmedia.BasicPlayer.realize(+84)

    Thanks in advance

  2. #2
    Regular Contributor
    Join Date
    Jul 2007
    Location
    Malaysia
    Posts
    126

    Re: Help me Playing Wave File

    Hi,
    I have no idea to track the error, may be a complete code will do. Anyway I found a source that might help you in this situation. Go to apress website and download this book source code:
    http://www.apress.com/book/downloadfile/2790

    Good luck.

  3. #3
    Super Contributor
    Join Date
    Nov 2003
    Location
    Bangalore , India
    Posts
    4,429

    Re: Help me Playing Wave File

    I guess its the problem with the Wav file you are using. Give a try with some other Wav file for eg: those samples available along with Sun WTK \WTK23\apps\Audiodemo\res\audio or try with a different Wav file. How did you create the current Wav file ?

    Regards
    Gopal

Similar Threads

  1. Replies: 1
    Last Post: 2006-11-30, 04:16
  2. Replies: 0
    Last Post: 2006-11-28, 16:39
  3. Replies: 1
    Last Post: 2006-11-15, 04:43
  4. S60 theme questions
    By Nokian_Spb in forum Symbian Media (Closed)
    Replies: 3
    Last Post: 2006-08-17, 06:11
  5. amr file is not playing properly
    By S.S.Sudhakar in forum Symbian
    Replies: 3
    Last Post: 2004-10-07, 06:19

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×