Results 1 to 9 of 9
  1. #1
    po0oker is offline Member
    Join Date
    Oct 2007
    Posts
    11
    Rep Power
    0

    Default uploading sound file in java

    hi there,

    i am trying to upload a sound file into my class .
    i am using this method
    Java Code:
    	string strFilename = args[0];
    		File	soundFile = new File(strFilename);
    but how do i specify the location of the song i want
    for example the song is in the desktop under name (song1.wav)
    and what if i want to upload mp3 ?

  2. #2
    po0oker is offline Member
    Join Date
    Oct 2007
    Posts
    11
    Rep Power
    0

    Default

    anyone plzzzzz

  3. #3
    JavaBean's Avatar
    JavaBean is offline Moderator
    Join Date
    May 2007
    Posts
    1,270
    Rep Power
    9

    Default

    Your problem is not clear. If you clearly describe your situation, someone may hep.. I did not understand your problem. You can just give the path of the file to your File object and it can be the arg[0] of your program as you described.

  4. #4
    po0oker is offline Member
    Join Date
    Oct 2007
    Posts
    11
    Rep Power
    0

    Default

    The problem is that i dont know how to give the path of the file i want to upload to arg[0] ...

    how do i do that in Eclipse ?
    someone told me this "enter the right parameter in argument section of the application configuration window."
    does this makes sense to anyone ?

  5. #5
    JavaBean's Avatar
    JavaBean is offline Moderator
    Join Date
    May 2007
    Posts
    1,270
    Rep Power
    9

    Default

    Yes it should be sth like that. But i dont use Eclipse. In netbeans, i right click to the project, select project properties, select run parameter tab and set the arguments there.

    I found this document for you. If it is not old, it might work:

    Help - Eclipse SDK

  6. #6
    po0oker is offline Member
    Join Date
    Oct 2007
    Posts
    11
    Rep Power
    0

    Default

    yes Thank you its very useful , but what arguments do i need to add for my case ?

  7. #7
    JavaBean's Avatar
    JavaBean is offline Moderator
    Join Date
    May 2007
    Posts
    1,270
    Rep Power
    9

    Default

    The path of the file. (e.g. c:\myfile.txt)

    As far as i remember, args[0] was the your application name. So you will use args[1] to access first argument like this:

    Java Code:
    java MyApplication c:\myfile.txt
    
    args[0] = MyApplication
    args[1] = c:\myfile.txt

  8. #8
    po0oker is offline Member
    Join Date
    Oct 2007
    Posts
    11
    Rep Power
    0

    Default

    i didnt get what u mean ??

    is that what i need to type in the command line ? cuz as u know i am using Eclipse !!

    where do i add these lines ?

  9. #9
    JavaBean's Avatar
    JavaBean is offline Moderator
    Join Date
    May 2007
    Posts
    1,270
    Rep Power
    9

    Default

    Yes, that is what you need to type in the command line.

    The thing i was describing is about how to get that input within your program.

Similar Threads

  1. Uploading a file with Servlet
    By farakhkhan@yahoo.com in forum New To Java
    Replies: 0
    Last Post: 03-10-2008, 09:02 PM
  2. File Uploading
    By aaliadhurue in forum Advanced Java
    Replies: 4
    Last Post: 01-16-2008, 07:56 PM
  3. Uploading files to FTP
    By javaplus in forum New To Java
    Replies: 0
    Last Post: 12-19-2007, 11:08 AM
  4. Make sound play in a java application
    By lenny in forum AWT / Swing
    Replies: 2
    Last Post: 08-13-2007, 12:45 PM
  5. Sound in applet Java
    By toby in forum Java Applets
    Replies: 1
    Last Post: 08-07-2007, 06:52 AM

Posting Permissions

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