Discussion Board

Results 1 to 5 of 5
  1. #1
    Hi sir,
    i am vinay, i want to play any audio file which is given by me...could u please help me ...
    1. How can i add my audio file to my application
    2. Is there any base code for this to help me....

    i have this code...my audio file name is "ring.MP3"

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

    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)
    {}
    }



    how should i give the path....

    please help....

  2. #2
    Nokia Developer Champion raj_J2ME's Avatar
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,314
    Hello,
    put the file in the res folder and add this folder to the project, depends upon the IDE you are using.
    And then you can read information over these links,
    http://developers.sun.com/mobility/m...mmapioverview/
    http://www.java2s.com/Tutorial/Java/...E/PlayMIDI.htm
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  3. #3
    Regular Contributor yatin.frankline's Avatar
    Join Date
    Mar 2010
    Location
    Ahemdabad
    Posts
    80
    Quote Originally Posted by srinivasreddy501 View Post
    Hi sir,
    i am vinay, i want to play any audio file which is given by me...could u please help me ...
    1. How can i add my audio file to my application
    2. Is there any base code for this to help me....

    i have this code...my audio file name is "ring.MP3"

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

    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)
    {}
    }



    how should i give the path....

    please help....
    hello

    you just putting your mp3 file in res folder of your project directory ok then use this
    code line in your code

    InputStream is = getClass().getResourceAsStream("/res/ring.mp3");

  4. #4
    Regular Contributor gaurav007's Avatar
    Join Date
    May 2007
    Location
    India
    Posts
    208
    Put the audio file in res folder so that it can be a part of jar file. For the reference code to play the file you can refer to the sample project "MobileMediaApi" that is supplied with Wireless Toolkit 2.5.1

  5. #5
    Nokia Developer Champion jitu_goldie's Avatar
    Join Date
    Sep 2008
    Location
    Noida, U.P.
    Posts
    1,330
    place the media file in resource, add the resource(if using netbeans). Lots of examples over web. Have a search on web.
    thanks,
    jitu_goldie..

    KEEP TRYING..

Similar Threads

  1. Problem in Playing Audio file from Descriptor!
    By manish.agarw in forum Symbian Media (Closed)
    Replies: 1
    Last Post: 2009-09-12, 10:18
  2. [split] mbm build error
    By mando222 in forum Symbian Tools & SDKs
    Replies: 1
    Last Post: 2009-03-29, 12:32
  3. How to edit resource file (.rss) in CW 3.1
    By madsum in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 8
    Last Post: 2009-01-16, 15:00
  4. [announce] PyUIQ. Python for UIQ 2.1 and 3.x
    By OscarBernabeu in forum Python
    Replies: 35
    Last Post: 2008-01-17, 09:12
  5. Problem in playing in an audio file.
    By PankajNeve in forum Symbian C++
    Replies: 3
    Last Post: 2007-03-09, 13:52

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved