×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Mar 2008
    Posts
    13

    Question image and audio in background - simultaneous?

    hello everybdy....

    am developing a small application wherein I need to display a image in foreground and play audio in background....Is it possible to do so in J2ME using media API and 2 threads in bkgnd?

    On same lines is it possible to display text with audio in background?

    any tips will be quite helpful...
    tx

  2. #2
    Nokia Developer Champion
    Join Date
    Sep 2007
    Posts
    915

    Re: image and audio in background - simultaneous?

    Frist create image using method createImage() and then display it and then create new theread in which you should write the code for audio.

    Write following code to play audio.

    try
    {
    InputStreamin=getClass().getResourceAsStream("/honesty.wav");
    Player player=Manager.createPlayer(in,"audio/X-Wav");
    player.start();

    }
    catch(Exception e)
    {
    System.out.println("In Catch");
    }

  3. #3
    Registered User
    Join Date
    Mar 2008
    Posts
    13

    Re: image and audio in background - simultaneous?

    hi honest_success...

    thnx 4 a quick reply .......i was just wondering that we can display an image in canvas and play audio thru the player....is this wat u mean..right?

  4. #4
    Nokia Developer Champion
    Join Date
    Sep 2007
    Posts
    915

    Re: image and audio in background - simultaneous?

    Ya you can definitely do that. Draw the image in paint() using following code

    public void paint(Graphics g)
    {
    g.drawImage(paramiters);

    }

    and do audio part by other therad.

Similar Threads

  1. Sending Image and audio comment to server from MIDlet
    By pauspling in forum Mobile Java Networking & Messaging & Security
    Replies: 3
    Last Post: 2008-02-18, 23:36
  2. Simultaneous audio stream and image download
    By disgustipated23 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2004-02-16, 18:56
  3. Simultaneous audio stream and image download
    By disgustipated23 in forum Symbian
    Replies: 0
    Last Post: 2004-02-16, 18:50
  4. Storing Audio/ image files as byte arrays in flat files(eg. bin files)
    By anantharaj1999 in forum Mobile Java General
    Replies: 0
    Last Post: 2003-06-09, 11:57

Posting Permissions

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