Java Question How to Open URL link using File in Java Eclipse

Discussion in 'Libraries developers questions' started by walterf25, Jul 29, 2015.

  1. walterf25

    walterf25 Well-Known Member Licensed User

    Hello everyone, i'm trying to wrap a library which converts videos to audio, the syntax for the library is this:

    Code:
    public void ConvertToAudio(File video){
    File = Audio new File("target location where audio file will be saved");
    AudioAttributes audio = new AudioAttributes();
    audio.setCodec(
    "pcm_s241e");
    audio.setBitRate(new Integer(
    128000));
    audio.setChannels(new Integer(
    2));

    EncodingAttributes attr = new EncodingAttributes();
    attr.setFormat(
    "mp3");
    attr.setAudioAttributes(audio);
    Encoder encode = new Encoder();
    encode.encode(video, Audio, attr);
    }
    As you guys can see the video parameter is of File type, but i need to figure out how to convert an online video stream to mp3, would it be possible, i'm sure it can be done, but i'm not an expert in Java.
    Does anyone have any suggestions? any advice will be greatly appreciated.

    Thanks,
    Walter
     
  2. DonManfred

    DonManfred Expert Licensed User

    File need an local exiting File
    IT will Not Work with this library i believe...
     
  3. walterf25

    walterf25 Well-Known Member Licensed User

    Yes i know that much, but isn't there a way to pass an inputstream to a file type?
     
  4. DonManfred

    DonManfred Expert Licensed User

    The Problem is:
    The library need to allow an Stream as input :)

    I dont know but maybe it is possible.
     
  5. walterf25

    walterf25 Well-Known Member Licensed User

    I have the library source, i'll see if i can change the File to type to inputstream instead.
     
Loading...