How to get the length of a audio file without play it ?

Now I know a method to get the length of a audio file by play it:
1 Create a Player, and add a ControllerListener
2.Start the Player
3.In the ControllerListener's controllerUpdate method, use getMediaTime() by receiving a EndOfMediaEvent
However I think this method is not convenience, if I don't want to play it how I can get the length of the audio file?
Is anyone can help me?Really thanks a lot !

I got the answer here:
http://forum.java.sun.com/thread.jspa?threadID=5149132&tstart=15
I tried getDuration() before, but it always return a same time, I think maybe I didn't realize the player.

Similar Messages

  • How do I change the length of an audio file?

    How do I change the length of an audio file without changing the actual recording?
    I want to aligne start and end points to the rest of my project.

    Well, yes and no. I have tried the Bounce track in place function, but it did not do what I was after. However, today I got an idea that solved the problem. I copied the region I had punched in several times. Then I used the Bounce track in place function. This made a track that was just as long as all the other tracks. Finally I silenced the audio "clips" that I had used to make the region longer. I have now 24 tracks to transfer to the Alesis HD 24 that starts, and ends, at the exact same point. This will suit the Alesis software just fine, I think.
    Thanks for the tips.

  • How to get the length of apex_item in javascript?

    Hello all
    I am having a tabular report using apex_item, I want to know how can i get the length of the item in javascript? like we do in pl/sql using apex_application.g_f01.count().
    and one more thing, when I go to certain page, tab of that page is getting disabled, what should I do to make tab available always whether I am on that page or on any other page.
    Thanks
    Tauceef

    Hi Oli
    Thanks for replying, In my first question actually I am validating the report values in javascript for that I need the length of the apex_item to run the loop that many times.
    Like we can get the length using apex_application.g_f011.count in pl/sql process how to get the length in the javascript, is there a way for that?
    I got the answer for the second question, this is the one.
    Thanks
    Tauceef

  • How to get the content in embed swf file in Swf Loader on run time

    How to get the content in embed swf file in Swf Loader on run time
    [Bindable]
    [Embed(source="assets/index.swf")]
       private var SWFSRC:Class;
    <mx:SWFLoader id="_swfloader" source="{SWFSRC}" />

    Hi Flex harUI,
    Throw the error.
    Access of undefined property content

  • How to get the absolute path of a file from the local disk given the file n

    how to get the absolute path of a file from the local disk given the file name

    // will look for the file at the current working directory
    // this is wherever you start the Java application (cound be C: and your
    // application is located in C:/myapp, but the working dir is C:/
    File file = new File("README.txt"); 
    if (file != null && file.exists())
        String absolutePath = file.getAbsolutePath();

  • In Mac how to get the Full name of a file Programmatically?

    Hi Friends,
             I am doing one Mac application for displaying the contents of a file. I can able to get some information about the file by using this code below...
      NSDictionary *dict=[fileManager attributesOfItemAtPath:myPath error:nil];
    Now I want to get the some other informations also like Full Name, copyRight, version... So Please suggest me how to get the full name of a file Programmaticallly?

    Your question doesn't make sense.
    First off, if you are going to get the attributes of a file, you need its full name before you can do anything. So that's part one taken care of.
    This function returns a dictionary full of typical file information (type, size, mod dates, etc.) as well as some HFS data (creator code, type code) which, I strongly suspect, are not "pulled out of the file" but rather generated on the spot. (See NSFileManager for the full list of attribute keys.)
    The other items you hoped of retrieving are not part of the regular file system. Sure, a Truetype font has a copyright string and a version, but what about an HTML file? A PNG? A text file you just created?
    There simply are no standard functions to retrieve copyright and version.

  • I bought two films on my ipod tough 4g ( normally comes up on my ipad if i have bought something on my ipod) but i dont know how to get the two films on my ipad without paying for them.

    I bought two films on my ipod tough 4g ( normally comes up on my ipad if i have bought something on my ipod) but i dont know how to get the two films on my ipad without paying for them.

    Movies work differant than TV shows, music and apps. With movies, to get them from one device such as an iPod Touch to an iPad, you would need to connect the Touch to your computer first and in iTunes under the file menu, hit transfer purchases. Next connect the iPad and you can sync the movie to the iPad.
    While the iPad is connected to the computer, in iTunes, click on the iPad in the left pane and when the screen loads, click movies and from there, you can select the movie that you want to sync.

  • How can we get the artset from a .ai file without opening it?

    Hello All,
    I have one .ai file, lets say sample.ai file. located in C drive. so the complete file path is "C:\Sample.ai".
    and lets assume the sample.ai file has one traingle shape(3 path type arts) in it.
    Now I want to get the 3 path arts (artset)  from sample.ai file without opening it in AI.
    The function protoype is like below
    AIArtSet& artSet GetArtSetFromAFile( ai::FilePath& filePath );
    Is there any API like above function in AI? or is it possible to get the art(s) from a file without opening it in AI?

    Not to my knowlege. The API only operates on active documents as far as I know.

  • How to get the length of a field.

    Hi all,
    I m working on dynamic internal table.There is a need to get the length of a field, filled dynamically.How can we get it.
    Thanks in advance.
    Regards,
    Swati garg

    Swati,
    DATA: text(8) TYPE c,
          len TYPE i.
    DESCRIBE FIELD text LENGTH len IN CHARACTER MODE.
    Field LEN contains the value 8.
    ================================
    For ouput length :
      DATA: float TYPE f,
          out TYPE i,
          len TYPE i.
    DESCRIBE FIELD float LENGTH len OUTPUT-LENGTH out.
    This example results in the field LEN containing the value 8, while the field OUT contains the value 22.
    Don't forget to reward if useful.....

  • How to get the length in bytes of a string

    My string has both latin (1 byte) and chinese (2 bytes).
    My program is in unicode system.
    How to measure the length in bytes of the string?
    the xlen function does not work.

    Hello,
    parameters : p_str type string.
    data : len type i.
    len = strlen( p_str ).
    write : / len.
    With Regards,
    BVS
    Hi BSV, your code return the number of characters not bytes.
    Remember chinese character in US are encoded with 2 bytes.
    And my string contain both latin and chinese characters.
    thanks

  • How to get the length of a field value, not the length of DB's CHAR(20)

    Hello.
    I'm trying to handle a String from my DataBase and get its length:
    String myName;
    int i;
    PreparedStatement sql = Conn.prepareStatement("SELECT NAME FROM MY_TABLE");
    ResultSet results = sql.executeQuery();
    results.next();
    myName = results.getString("NAME");
    i = myName.length();
    out.println("The value is " + myName + " and the length is " + String.valueOf(i) );
    I get:
    " The value is Tom and the lengh is 20 "
    20 is the length of the field (it's a CHAR (20) ), but I would like to get the length
    of 'Tom'.
    On other hand, I would like to detect if this value is 'Tom' or not, but trying with:
    if (myName.equals("Tom")) {...}
    or
    if (myName == "Tom") {...}
    There is no response.
    Any experience?

    myName = results.getString("NAME");
    if(myName!=null) myName = myName.trim(); //Take out trailing spaces
    i = myName.length();Sudha

  • How to get the alv saved in background mode without modifying the program?

    Hi all,
    I have to run a standard report(IW39) in background and save the result ALV as excel or text file.
    How to get the result saved in excel / text format if I don't want to customize the standard program?
    (In the spool, there is an option to save list in file "Spreadsheet", but the saved format is not what we expected.
    It is expected the data to be put is separated in each column / tab-delimited in the text file....)
    Many Thanks!

    I don't have any ready made coding examples, but using the F1 help on SUBMIT statement will help to get you quite a way:
    DATA list_tab TYPE TABLE OF abaplist.
    SUBMIT 'RIAUFK20'
    USING SELECTION-SCREEN
    EXPORTING LIST TO MEMORY
                  AND RETURN.
    CALL FUNCTION 'LIST_FROM_MEMORY'
      TABLES
        listobject = list_tab
      EXCEPTIONS
        not_found  = 1
        OTHERS     = 2.
    IF sy-subrc = 0.
      CALL FUNCTION 'WRITE_LIST'
        TABLES
          listobject = list_tab.
    ENDIF.
    Edited by: Micky Oestreich on May 18, 2009 8:18 AM

  • How to get the Real Path of a file which is accessed  by URL?

    iam using tomcat6.0.
    I have a file xyz.xml at the top of the webapplication HFUSE which i can able to access by URL
    http://localhost:8080/HFUSE/xyz.xml
    My problem is how to get the realpath of the file "xyz.xml" for reading and writing purposes.
    I tried various things but i could not able to successfully solved the problem?
    1) File f = new File("/xyz.xml");
    print(f.getAbsolutePath()) ============== it is not fetching the file @ http://localhost:8080/HFUSE/xyz.xml rather it is creating a file
    at the root of the drive where eclipse is running.
    2) File f = new File("xyz.xml");============> this is also not working , it is creating the file xyz.xml in the eclipse directory ..................
    Can anyone please guide on this problem?

    RevertInIslam wrote:
    If you want your context root(i.e HFUSE)
    use this:
    request.getContextPath() //where request is HttpServletRequest object to get the needful path.
    e.g:
    File f = new File(request.getContextPath()+"/xyz.xml");//it will create the file inside HFUSE.
    Hope this helps.
    Regards
    BWrong. The File constructor expects an absolute filesystem path. The HttpServletRequest#getContextPath() doesn't return the absolute filesystem path, it only returns the relative path from the current context root. Use ServletContext#getRealPath() instead, it returns the absolute filesystem path for the given relative path from the current context root.
    File file = new File(servletContext.getRealPath("/"), "xyz.xml");

  • How to get the path of input type="file" tag

    -- im using <input type="file"> tag to get an input file from a local host, it returns only the filename but not the complete path of the filename,,,
    -- i need to know on how to get the compelete path /directory of the filename using <input type="file"> tag , or is there any other way to get an input file from a local host aside from <input type="file"> tag?
    thanks

    http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/input_file.asp?frame=true
    When a file is uploaded, the file name is also submitted. The path of the file is available only to the machine within the Local Machine security zone. The value property returns only the file name to machines outside the Local Machine security zone. See About URL Security Zones for more information on security zones.
    i need to know on how to get the compelete path /directory of the filename
    using <input type="file"> tag You can't. Its a security thing.
    is there any other way to get an input file from a local host aside from <input type="file"> tag?No. Not using just html.
    You could always go into activex components, but thats different again.
    Cheers,
    evnafets

  • How to get the encoding of a XML file ...

    Hi,
    How do you get the encoding of a XML file?
    For example,
    <?xml version="1.0" encoding="SJIS"?>
    I am trying to retrieve the above encoding="SJIS", but I can't seem to locate the API for doing so.
    Thanks in advance for any help,
    Eric

    Hi ddossot,
    Thanks for your suggestion.
    However, the xerces.jar file that comes with my old tomcat server is an old version and thus, the getEncoding method is not even present in the DocumentImpl class. The option to update to a newer version of tomcat and xerces is not available. What a pity... :-(
    Well, I just have to try to find a way around. Worst case scenario, parse the first line in the xml file myself.
    Regards,
    Eric

Maybe you are looking for

  • Panel is not localized

    Hi, I have quite a strange issue here. I´m just adding localization to my Mac App, and now there is the problem, that the main window is shown correctly, in the correct language. But a seperate panel is not shown in the correct language (German) it´s

  • Managing content manually on iPhone, iPad, and iPod

    Please if anyone can help I was able to add or erase my music without having to sinc it to my whole library, what should I do?

  • Creating a graph help!

    Hi, I am having problems with the ideas of graphs I think that an edge is a link and a node is the place where data is stored i want the node to contain a string data value and a node id which is used to connect to another node the problem is that th

  • Could not find installation information

    I tried to reinstall Lion through disk utilities and with I clicked on the reinstall option, it said"could not find installation information for this machine ,contact AppleCare".how can I fix this by not calling AppleCare and being on hold for15 minu

  • Upgraded to Mavericks yesterday. Cannot get iCloud or Mail, Contacts, etc. Pref Panes to open.

    Very odd behavior by several of the Pref Panes in the System Preferences app. I cannot get the iCloud pref pane to launch. There is no spinning beach ball and the Force Quit Applications box doesn't show that System Preferences is not responding. Sam