How to get the amplitude of a sound as a float number in Java

Hi, I would like to create a program which plays an audio file(it may be a midi, probably) and it returns
the amplitude of the sound in terms of float number.
I mean, is it possible to obtain this number, since every sound file is actually a sequence of float number like
110.010110101 etc.
Can you help me with suggestions and details about the way to take.
Regards
Frank

For sampled sound, the answer might be seen in [ this thread|http://forums.sun.com/thread.jspa?messageID=10636576#10636576]. For MIDI it is different in that you will only be able to get it as sampled sound once it has been synthesized, and as I recently found out, to get the audio coming through the regular sound lines will take nothing less than a physcical or software 'audio loopback' being installed, on most PCs.
Of course, if it is MIDI, you might just cheat by calculating a 'volume' from the note velocities in the MIDI score.

Similar Messages

  • Getting the amplitude of a sound Clip

    Hi, I'm having problems with the javax.sound.sampled package, specifically, the Clip interface.
    I want to get the current amplitude of a Clip object. I set up the Clip and then call getLevel () on it, but it returns -1 (i.e., it doesn't know how loud it is)
    The Clip is set up fine, and it plays OK, I just need the volume level of it. (By the way, the Clip is created from a .wav file).
    This is what I do at the moment:
    try {
       // clipURL is the URL of the .wav file
       AudioInputStream inputStream = AudioSystem.getAudioInputStream (clipURL);
       DataLine.Info info = new DataLine.Info (Clip.class, inputStream.getFormat ());
       if (!AudioSystem.isLineSupported (info)) {
          System.out.println ("There are no installed mixers that support this file type. System exiting");
          System.exit (-1);
       try {
          clip = (Clip) AudioSystem.getLine (info);
          clip.open (inputStream);
       } catch (LineUnavailableException lue) {
          // Handle exception
    } catch (UnsupportedAudioFileException usafe) {
       // Handle exception
    } catch (IOException ioe) {
       // Handle exception
    } catch (Exception e) {
       // Handle exception
    }Once I get this far, I play the Clip and try to get the current amplitude:
    clip.start ();
    float clipLevel = clip.getLevel ();
    clip.stop ();
    clip.close ()All of the above works, except for the fact that clipLevel is always -1, when it should be between 0.0 and 1.0.
    Any help would be much appreciated. Cheers.

    This is a known bug, see:
    http://developer.java.sun.com/developer/bugParade/bugs/4297101.html
    If this issue is important to you, please add your vote. It was originally reported in 1999 and has not been resolved as of 1.4.

  • How to get the page numbers of a word/mpp/execl doc using Java?

    Hi,
    I meet a problem in Java programming. I want to get the page numbers of a Word/MPP/EXECL/PDF document. For exmaple, if a PDF docment have 10 pages, I need get the 10 . How to get it using Java?
    Please advise me as soon as possible if you have any good suggestions! Thanks!
    Yin

    There are several good tools that allow you to access COM objects from Java. Here are two of the better ones:
    Bridge2Java
    http://www.alphaworks.ibm.com/tech/bridge2java
    J-Integra
    http://www.linar.com/
    Both of these tools will allow you to access MS Office products (including Word and Excel) via COM interfaces.

  • [E2010][EWS-XML][JAVA]How to get the properties of meeting rooms in Exchange 2010 using EWS Java API

    When you look at meeting room properties in Outlook 2010, you can see 'City', 'Country/Region' and 'Department' information.
    Is there any way to get this information using EWS Java API? 

    Hi Glen,
    I am able to understand what u have said, but do not know how to implement it with meeting rooms....
    If i am implementing
    "Get all appointments between startDate and endDate in the specified folder, including recurring meeting occurrences" in ews-java-api, as you have mentioned above, i am able to get only my appointments from the start date to end date , as i
    have given my email id and password, how to get my organization meeting room details, booked or not.
    static ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010_SP2);
    public static void main(String[] args) throws Exception {
    // TODO Auto-generated method stub
    ExchangeCredentials credentials = new WebCredentials("[email protected]", "zzzz");
    service.setCredentials(credentials);
    try {
    System.out.println("Check");
    service.autodiscoverUrl("[email protected]",new RedirectionUrlCallback());
    } catch (Exception e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    NameResolutionCollection nameResolutions = service.resolveName("SDB1",ResolveNameSearchLocation.DirectoryOnly, true);
    System.out.println("nameResolutions==="+nameResolutions.getCount());
    for(NameResolution nameResolution : nameResolutions)
    System.out.println("NAME==="+nameResolution.getContact().getDisplayName());
    The above code gives me the output like, the meeting room in my organization with word SDB1 are
    Output:
    nameResolutions===2
    NAME===SDB1- TELCON - 1
    NAME===SDB1-TELCON - 2
     for. eg. I need to know today at what are the appointments in the room SDB1-TELCON2 and who all have booked the room.
    I do not know how to implement for the meeting room can you please help me how to give it.
    Thanks in advance.

  • How to get the shared name of a folder in my PC through java code.

    Hi,
    I have a shared folder in my PC adn its shared name is different. Is there any way to get the shared name of that folder from java code. I have the absolute path of that dir. Can I get the shared name from that path in java or is there any other method.
    Thanks.
    Edited by: pavanspecial on Nov 28, 2007 11:34 PM

    Hi, Thanks for your reply. I have even tried through 'net share' , but i could not the share name from the path i have. For the 'net share' i need to give the share name itself.

  • Im connectioning my macbook to my hdmi port in tv.  I am getting no sound through the tv only the macbook speakers.  anyone know how to get my tv to read sound?

    Im connectioning my macbook to my hdmi port in tv.  I am getting no sound through the tv only the macbook speakers.  anyone know how to get my tv to read sound?

    The Mini DisplayPort to HDMI doesn't carry audio unless you have the Mid 2010 model 7,1 and there're no audio plugs on most TVs to work with HDMI since it's expecting audio with the HDMI. But check your TV manual to see if it has audio plugs that work with one of the HDMI ports.
    If you have the Late 2008 model 5,1 Aluminum Unibody or Late 2009 model 6,1 White Unibody with the Mini DisplayPort rather than the Mini-DVI there is an adapter that uses the Mini DisplayPort and a USB port to combine video and audio to HDMI. It's only 2 channel stereo not 5.1 Dolby Surround.
    http://www.monoprice.com/products/product.asp?c_id=104&cp_id=10428&cs_id=1042802 &p_id=5969&seq=1&format=2
    The Mini-DVI port doen't carry audio at all. The Late 2008 model 5,1 Aluminum Unibody and the Late 2009 model 6,1 and Mid 2010 model 7,1 White Unibody have a Mini DisplayPort. The Early 2006 model 1,1 through Early 2008 model 4,1s plus the Early and Mid 2009 model 5,2s have Mini-DVI ports.
    To see which model you have go to the Apple in the upper left corner and select About This Mac, then click on More Info (and then System Report if you’re running 10.7 Lion or 10.8 Mountain Lion). When System Profiler comes up check the Model Identifier and post it back here.

  • How to get the values from repeated frame?.

    Hi
    how to get the values from repeated frame?. i have to disply the first 3 digits in another place in my report.
    i have field empno in repeated frame and i want to disply first 3 digits in another place in the same report.
    thanks

    How often do you need to display it? It sounds like you might want to base a summary on that formula with a function of first or last. If it's a per page basis, it can be a page level summary. If it's at a higher level repeating frame, then you can create the summary at that level. I'd suggest taking a look at the online help for summaries using the first/last functions.
    Hope that helps,
    Toby

  • How to get the current page URL

    HI All
    I am working in oracle apps 4.0
    I have one page called history in that i have one page item called Application url. My application id is 122 but its a copy of application 106
    How to get the current page url for the page item.
    Any steps should be help ful
    Thanks & Regards
    Srikkanth.M

    I'm not 100% clear on what the requirement is from the description, however it does sound like you are making things unnecessarily complicated.
    If you want permanent/ID-independent links then use application and page aliases.
    so here we used to display the url like this: <tt>{noformat}http://81.131.254.171:8080/apex/f?p=122{noformat}</tt>
    Do you mean that the URL is displayed like that? If so that doesn't seem particularly helpful. How is anyone supposed to know what it is?
    There are many ways to provide links in APEX&mdash;including lists and nav bars.
    Where the link is to another resource located on the same server (such as another page in the same app, or a different app in the workspace), relative addressing can be used, making it unecessary to include scheme, domain and port information in the URL. For example, if the page to be linked to has a page alias <tt>ABOUT</tt> in an application with alias <tt>UNITY</tt>, and the apps share an authentication scheme/cookie to permit shared sessions, then the link URL is simply
    f?p=UNITY:ABOUT:&APP_SESSION.

  • [Win VC++ 6.0 ]How to get the number of files count in a folder using VC++ 6.0?

    Hi all,
    Can any one tell how to get the number of files(.EPS) count inside a folder when the folder path is specified in VC++ 6.0?
    Thanks in Advance.
    Regards
    myriaz

    I'm a little confused by the question, but it sounds like you're asking how to count the number of files with a particular extension in a given directory? That's not really an AI SDK question, but it's a fairly easy one to find if you google it. If you're trying to use Illustrator to do it, AI doesn't have a general purpose file API. It has a few functions to do some things that Illustrator needs, but I don't think enumerating directories is one of them.

  • How to get the FILE COUNT from File directory

    Hello,
    i have to develop a scenario like, get  the file count from source file directory and validate whether the file count is 5 or not. if 5 files exist i need to process those 5 files to DB tables. if file count is not equal to 5 then i need to send a mail to customer that files are missed at source directory. (subject as files were missed at source directory and in content i need to display the file names exist at source file directory. So that missed file will be generated by the customer based on this mail).
    Could you please let me know how to get the count of files from source file directory. if it is possible only with UDF please provide the Java code
    Best Regards,
    SARAN

    Do these files have some fixed names?
    Can you try to use the option Advanced Selection For Source File to make XI  pick all 5 files in one shot?
    Check this blog on the same -
    /people/mickael.huchet/blog/2006/09/18/xipi-how-to-exclude-files-in-a-sender-file-adapter
    If this is not a option - BPM sounds the only possible way.
    Regards,
    Bhavesh

  • HT2931 I am trying to figure out how to get the pre made "beats" with my garage band for my MacBook Air can u help

    I am trying to figure out how to get the pre made "beats" with my garage band for my MacBook Air can u help

    Hello Mattxy2,
    Thank you for the question. It sounds like you would like to add some Apple Loops to your project.  I recommend reviewing the following sections in Garageband Help:
    GarageBand Help - Search for Apple Loops
    http://help.apple.com/garageband/mac/10.0/#gbnd3002ab64
    GarageBand Help - Add Apple Loops to your projects
    http://help.apple.com/garageband/mac/10.0/#gbndc1d3db81
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

  • I have deleted by mistake the site bar and I don't know how to eneter a site that I want to do, does anybody knows how to get the site bar back?

    i made a right click and by mistake i deleted the site bar and i don't know how to get it back. :/

    It sounds like you have hidden the navigation toolbar. To bring it back, in the View menu select Toolbars, then click on "Navigation Toolbar" in the list of toolbars to display it. Active toolbars will have a tick by their name.
    If the menus themselves are missing, press either Alt or F10 to temporarily display the menus. You can then Select View > Toolbars and then click on "Menu Bar" in the list to permanently display it.

  • How to get the values from popup window to mainwindow

    HI all,
       I want to get the details from popup window.
          i have three input fields and one search button in my main window. when i click search button it should display popup window.whenever i click on selected row of the popup window table ,values should be visible in my main window input fields.(normal tables)
       now i am able to display popup window with values.How to get the values from popup window now.
       I can anybody explain me clearly.
    Thanks&Regards
    kranthi

    Hi Kranthi,
    Every webdynpro component has a global controller called the component controller which is visible to all other controllers within the component.So whenever you want to share some data in between 2 different views you can just make it a point to use the component controller's context for the same. For your requirement (within your popups view context) you will have have to copy the component controllers context to your view. You then will have to (programmatically) fill this context with your desired data in this popup view. You can then be able to read this context from whichever view you want. I hope that this would have made it clear for you. Am also giving you an [example|http://****************/Tutorials/WebDynproABAP/Modalbox/page1.htm] which you can go through which would give you a perfect understanding of all this. In this example the user has an input field in the main view. The user enters a customer number & presses on a pushbutton. The corresponding sales orders are then displayed in a popup window for the user. The user can then select any sales order & press on a button in the popup. These values would then get copied to the table in the main view.
    Regards,
    Uday

  • How to get the table of value field? and can we expand the technical limits

    Dear
    I have created value field in COPA with KEA6. And now, I need the table which the value fields are saved. Yet, I have tried a lot to find it and get failure? Can any guy help me? Please tell me how to get the table of a value field.
    And another question is that, can we extend the technical limits for the number of value field for ECC6.0?
    We have a note for R.4.x Please see below:
    OSS note 160892
    You can display the length of a data record using Transaction KEA0 ('Maintain Operating Concern'). After you have navigated to the 'Characteristics Screen' or to the 'Value field Screen' choose menu path 'Extras -> Technical Limits'.
    The maximum displayed here under 'Length in bytes on the DB' is the maximum length permitted by the Dictionary. The reserve required for the release upgrade must be subtracted from this value.
    To increase the allowed number of the value fields, increase the value that is assigned to field ikcge-bas_max_cnt (FORM init_ikcge_ke USING fm_subrc, approx. line 165) in Include FKCGNF20. It specifies the number of the possible value fields. The corresponding part of the source code is attached to the note as a correction.
    David Sun
    Regards!

    how to extend the limit of value numbers? please see the original question.

  • I downloaded and bought a movie from iTunes on my iPad and now want the same movie on my MacBook Pro but its not offering me to download it, it giving me the options of buying it which I already did. How I get the movie onto my MacBook?

    I downloaded and bought a movie from iTunes on my iPad and now want the same movie on my MacBook Pro but its not offering me to download it, it giving me the options of buying it which I already did. How I get the movie onto my MacBook?

    You can connect the iPad to your Mac's iTunes and do File > Devices > Transfer Purchases, that should copy it over to the Movies part of your library.
    Depending upon what country that you are in, and whether the film studio allows it, you might also be able to re-download it on your Mac via the Purchased link under Quicklinks on the right-hand side of the iTunes store home page.

Maybe you are looking for

  • Retain video dimensions?

    Hello all, I am trying to make a DVD compilation of some very short, and very small movies. They are in the public domain (early films from the turn of the century) and have been "ripped" from celluloid by the Library of Congress at a very low defini

  • Error in CRM Leasing Quotation regarding Financing Option

    Hi All, I created one financing option with financing character by entering neccessary data for periodic payments. And also assigned this opiton to one financing product. But when i am using the above financing product in the Leasing Quotation, i am

  • Photo access

    Receiving error -  App does not have access to photos & videos.   I have tried changing the settings but still no luck.  I am working on an iPad.  Please help. Love the app just need access to my photos.

  • Orcale installation

    I recently tried installing Oracle 9i Release 2. Once installed Oracle Database Configuration Assistant gets an error each time I run it. Invalid entry size (expected 419438592 but got 419440806 bytes). Does anyone have any input?

  • How to turn off "wake on clamshell open" ?

    Hi, The hinge on my Mab Book Pro is a little warped or something and when I close the lid it won't stay asleep, it keeps re awaking every 30 seconds or so. So how do I turn this off? Can't find that settings page. Thanks