Capturing the output of a javax.sound.midi.Synthesizer

Hallo,
since i can�t convert a MIDI-Sequence to a WAV-File directly, i want to play back the Sequence and capture the sound somewhere "between" the sound-generating synthesizer and the speakers. As far as i understand, i have to obtain a TargetDataLine from an output mixer, so i can read the sound data, since ports aren�t implemented yet. My problem is: How can i obtain such a TargetDataLine?
With something like
info = new DataLine.Info(TargetDataLine.class, format);
line = (TargetDataLine)AudioSystem.getLine(info);
i get a line to capture microphone input.
i managed to get a mixer that is opened and started, when the synthesizer is opened, but that mixer only provides com.sun.media.sound.MixerSourceLines.
Any help will be greatly appreciated.

Not a reply, I'm afraid.
I want to combine Midi output with audio output, which is exactly the same question as this thread. The whole thrust of Java sound is to 'unify' Midi and Audio, and yet I've fallen at the first hurdle.
This thread was opened in Nov last year, yet is still unanswered. Is this right?

Similar Messages

  • Author       "javax.sound.midi.InvalidMidiDataException: cannot get soundbank from stream" after java update

    Not sure where to post this issue.
    I am noticing this error since I did the Mac update. The Mac update included the java update. Right now the java version is 1.6.0_31. My Mac OS X version is 10.7.3. I am seeing the problem for all the soundfont files that I am trying to load. The error i get is.
    javax.sound.midi.InvalidMidiDataException: cannot get soundbank from stream
         at javax.sound.midi.MidiSystem.getSoundbank(MidiSystem.java:565)
         at myPackage.MyMusicApp.main(MyMusicApp.java:14)
    Below is a small program I built that shows the code.
    package myPackage;
    import java.io.File;
    import javax.sound.midi.*;
    public class MyMusicApp {
        public static void main(String[] args) {
            try {
                Synthesizer synth = MidiSystem.getSynthesizer(); synth.open();
                File f =  new File("/Users/poorav/eclipseGIT/myApp/soundbanks/1247_KitDRY.sf2");
                Soundbank soundbank = MidiSystem.getSoundbank( f);
                synth.loadAllInstruments(soundbank);
            } catch (Exception e)
                e.printStackTrace();
    I am not sure what the previous build of java I was on, but i know that it was a 1.6 version. Any ideas of what could have caused this?
    thanks

    No satisfactory progress!
    I submitted a bug for this using the Apple bug reporter on 9th April (#11208868) and despite asking for an update, it has been completely ignored (even now). I'm not impressed.
    I then issued a (paid for) Developer Technical Support issue which was credited back to my account a few days later with no explanation. When I asked why, I eventually got: "At this time DTS does not provide code-level support for Java"!
    So, Apple are assuming to responsibility for this problem. I realise that Oracle is mostly responsible for Java but Apple took this crippled version (how much testing did they do?) and updated our customers' machines with it. This has effectively disabled a key feature of our product and has cost us damage to our company's reputation. Still Apple don't care and they rely on the fact that we are too small to sue them. You can see I'm not happy! I naively thought Apple would make some attempt to assist their developers.

  • Javax.sound.midi and external synths?

    Since I don't have a USB-to-MIDI adapter (and I lost my MIDI cables long ago), I gotta just ask: if I had an external MIDI device connected to my computer, would javax.sound.midi.getMidiDeviceInfo() theoretically return a MidiDevice object describing it? Or is javax.sound.midi really just for the computer's own music synthesizer?
    --Chris (invalidname)

    see bug 4356787. MIDI for external devices is broken.
    Add it to your bug parade votes. Let's get Sun to
    address this.will do... not like they're going to fix my other favorite bug (4119391 - RMI in real-world networks)
    Thanks.
    --Chris

  • How to capture the output of another program into a File/String

    I needed to capture the output of a dos program in an String/file I tried doing Runtime.getRuntime.exec("ipconfig /all >tmp.txt");
    but still I am unable to capture the output frm the program which I would like to capture in a file or String.Can anyone help

    When you use the Runtime.exec() method, it returns a Process object, that process object has access to the streams; stdout, stdin, and stderr of the application you just executed. what you'll want to monitor is the stdout or stderr streams using the
    p.getInputStream() or p.getErrorStream(), where p = the process object returned via the Runtime.exe() method.

  • Capturing the output of a os command line

    I need to capture the output of a os command line executed from one java program and I don't know how can do it.
    For example:
    Runtime.getRuntime().exec("hostid");

    Your suggestion worked very well, just in case that this could interest somebody, this is the complete solution
    Thanks for your help
    import java.io.*;
    public class HostID
    public static void main(String args[]){
    try{
    InputStream in = (Runtime.getRuntime().exec("hostid")).getInputStream();
    byte[] arreglo= new byte[200];
    int cantidad = in.read(arreglo);
    System.out.println(new String(arreglo,0,cantidad));
    } catch (IOException ioe){System.out.println(ioe.getMessage());}
    }

  • Capturing the output of a jsp page and save that output in a WORD .doc file

    Hi,
    This is Naveen. I got stuck up with a problem/doubt. URGENT ! URGENT !
    My doubt is how to capture the output of a jsp page(the content is dynamic generated) and save that output to a MS-Word doc file.
    I know that therez an option of using Servlets Filters, but this concept is supported by Servlet 2.3 spec. and not earlier. And we are working on previous spec. and our web-servers also supports the prev. version and not the 2.3 version.
    If incase, therez a third-party utility for free usage, suggestions are appreciated.
    Hope most of them came across this kind of functional requirement. If anyone of them succeeded in this, please express ur bitter experience if any, faced during the coding.
    Thanks in Advance for help.
    Naveen

    You can set the MIME content type as .doc and try to open the Page.
    res.setContentType("application/vnd.ms-excel"); to generate the Page output as Excel
    res.setContentType("application/vnd.ms-word"); to generate the Page output as MS Word doc
    Hope this helps..

  • Capturing the Output of a webservice on an APEX form

    Hi,
    I have created an application that calls a Webservice (BPEL process). The application has a single form that takes in a single field (ReviewDate) and calls the Webservice. The Webservice does its thing and returns a mesage "The review date has been accepted".How do I capture this message in my form? I have the placeholders for input and output parameters but the output is not returned to the form. What do I need to do capture this message?
    Also, please note that the webservice does its thing successfully. I only need to capture the output of the webservice in my form.
    Thanks
    Vijay

    You can set the MIME content type as .doc and try to open the Page.
    res.setContentType("application/vnd.ms-excel"); to generate the Page output as Excel
    res.setContentType("application/vnd.ms-word"); to generate the Page output as MS Word doc
    Hope this helps..

  • Capturing the output from jsp selvlet

              Hi,
              I have a requirement where I need to capture the output of the JSP generated servlet
              , and do something with it before it get's to the client side.
              Has someone done something like this before.Any ideas, suggestions .
              Thanx,
              Tajdar
              

    You can set the MIME content type as .doc and try to open the Page.
    res.setContentType("application/vnd.ms-excel"); to generate the Page output as Excel
    res.setContentType("application/vnd.ms-word"); to generate the Page output as MS Word doc
    Hope this helps..

  • To capture the output

    Hi all ,
    I Wish You A Happy New Year!!!!!!!!
    I am trying to capture the output of a java program into a file i.e,when I run the java program at command prompt and get the output, the output must be automatically captured into a file is this possible using java code
    Please help me
    Thanks,
    raghu

    And Mac OS/X is a unix variant, so it works there too.
    You can also redirect standard output in Java itself by using System.setOut, but once you're altering the Java code, I'd suggest refactoring the code so that it doesn't send all its output to standard output necessarily.

  • Capturing the output of a JSP page as HTML

    Hi,
    Can anyone tell me if this is possible. I have a JSP page that contains
    information about an order that was just entered (Essentially a
    confirmation page). What I want to do is somehow intercept the output
    stream inside the JSP page and write it to a file, as plain html, which
    I
    will later attach to an email and send to someone.
    Thanks,
    Jordi
    Jordi Pinyol Essi Projects
    Ingeniero de Desarrollo
    [email protected] t +34 977 221 182
    http://www.essiprojects.com f +34 977 230 170

    You won't be able to "intercept" the output since it is the JSP page itself that is doing the writing.
    Will the file that you write the output to reside on the client side or the server side? It sounds like you want to receive the HTML output not as something to view on the browser, but a file you can save and send and use later. If this is the case, one technique that might work is to take advantage of the servlet name mapping feature that is available for registered JSP pages.
    Assuming your JSP pages are registered, you would map your JSP page like:
    <servlet>
    <servlet-name>confirmation</servlet-name>
    <jsp-file>confirmation.jsp</jsp-file>
    </servlet>
    <servlet-mapping>
    <servlet-name>confirmation</servlet-name>
    <url-pattern>/confirmation.out</url-pattern>
    </servlet-mapping>
    What happens is that a request for the URL /NASApp/myapp/confirmation.out gets mapped to the confirmation.jsp JSP page. If you set your MIME type correctly in the JSP page, the HTML output from the JSP page is not properly recognized by the browser causing it to prompt you to save the file.
    I have used this technique to generated CSV files from a JSP page. The browser is completely fooled.
    JC
    Jordi Pi?ol wrote:
    >
    Hi,
    Can anyone tell me if this is possible. I have a JSP page that contains
    information about an order that was just entered (Essentially a
    confirmation page). What I want to do is somehow intercept the output
    stream inside the JSP page and write it to a file, as plain html, which
    I
    will later attach to an email and send to someone.
    Thanks,
    Jordi
    Jordi Pinyol Essi Projects
    Ingeniero de Desarrollo
    [email protected] t +34 977 221 182
    http://www.essiprojects.com f +34 977 230 170

  • Capture the output of ExceptionDescribe

    I have some C++ code which calls Java code through the Invocation API:
    jType type = env->SomeJNICall();
    if ( type == NULL || env->ExceptionOccurred() )
         env->ExceptionDescribe();Instead of spitting out the exception description to stdout (or stderr?) is there a way of capturing the text and putting it into a std::string or copying it into a memory location pointed to by a char *?
    Thanks!

    I believe the API can be used to return the actual exception. With that, you can get its class, and with its class you can call methods of the exception object. (All, of course, via JNI.)

  • Is there any way to capture the output of a trnsaction

    Hi EXPERTS,
    i TRIED TO CAPTURE O/P OF TRANSACTION IW3M USING SUBMIT,
    IT WASNT SUCCESSFUL
    pLEASE SUGGEST ME SOME OTHER WAY TO DO.

    Hi,
    Did you check  spool requests -> SP02.Could you elaborate on how you came to the conclusion that it wasnt sucessfull?

  • Javax.sound.midi: Processing MIDI events

    Hello,
    I've been wondering if there is any way to process MIDI events without using
    a Sequencer, for example to take information of the file without play-back?
    greets

    Cool... Thanks! That was really simple to fix... wish
    I would have known that before...You're welcome. You may need to find a good MIDI reference via google (or scroogle if you're a commie) to supplement the info in Sun's documentation.

  • Need to capture the output of parseEscapedXML() function in a variable

    Hi All,
    In my BPEL process, I am fetching the XML data from the database which is stored in a CLOB column, using the database adapter. As it is in a string type I am using parseEscapedXML() function to get the XML data out.
    I have done the following:
    Imported the XSD to the project. Created a variable of element type and in the type explorer , navigated to 'Project Schema Files' -> My .XSD file -> complex XML element. But when I use this variable in any of my process activities, I get the following compilation error:
    Error(58):
    [Error ORABPEL-10010]: unresolved element
    [Description]: in line 58 of "<bpel procedure path>", XML element "{http://schemas.xmlsoap.org/ws/2003/03/business-process/}OutboundPaymentInstruction" of variable "Variable_2" is not defined.
    [Potential fix]: Make sure the XML element "{http://schemas.xmlsoap.org/ws/2003/03/business-process/}OutboundPaymentInstruction" is defined in one of WSDLs that are referenced by the deployment descriptor.
    Which WSDL file is the error referring to (I use empty BPEL process as the template)
    Could anyone please let me know how do I create a variable which is of my XSD type and use the variable for further transformation.
    Thanks a lot.
    Regards,
    Prad

    Prad,
    Did you get this resolved? I am having the same issue and can not get it to work.
    Thanks
    Troy
    Message was edited by:
    user641994

  • Capturing audio through applet using Java Sound

    hi fellows i need ur help.
    I am working on a voice project to Capture & Play the sound using java sound API instead of JMF. I can capture , play and transmit the sound through application. It works pretty fine but when i convert it to the applet, it is not working.
    I got the full system permissions and also signed the applet for Internet Explorer. Also i packed the
    javax.sound.midi.*
    javax.sound.sampled.*
    classes in the signed cab.
    After doing all this i am getting the AudioFormat not supported exception. I changed the format and used all the combinations but still getting this error
    No line matching interface TargetDataLine supporting format PCM_SIGNED, 16000.0 Hz, 16 bit, mono, big-endian, audio data is supported.
    java.lang.IllegalArgumentException: No line matching interface TargetDataLine supporting format PCM_SIGNED, 16000.0 Hz, 16 bit, mono, big-endian, audio data is supported.
         at javax/sound/sampled/AudioSystem.getLine (AudioSystem.java:312)
         at com/vsoft/voice/VoiceRecord.run (VoiceApplet.java:93)
         at java/lang/Thread.run (Thread.java)plz help me to sort out this problem.

    plz have a look over this problem

Maybe you are looking for

  • Viewing at 100% no longer "snapping" into focus

    I have Elements 9 and when viewing a photo at 100% it would "snap" into focus after a brief period. Now, however, no matter how long I wait it never goes beyond the large, individual pixel state (hope I'm making sense). Have I set something wrong som

  • Billing and shipping address changes

    I have tried to change my billing and shipping address from my New Zealand address to my Canadian address but there isn't an option to change the country from new Zealand to Canada. HELP I want to send a book I have created to my sister for Christmas

  • Trouble need help?

    when I Hotsync my palm lllxe, my MEMO'S are noy transferring to my pc? Post relates to: Palm IIIxe

  • Pins at a PCI MIO-16E-1 to Measure Frequency(DAQ-STC).vi?

    I want to measure frequency with the "Measure Frequency(DAQ-STC).vi". Can't find the appropriate connector pins in the manual of my PCI MIO-16E-1. Can someone confirm or correct me? Signal - PFI1/GPCTR1_SOURCE SignalGND - PFI9/GPCTR0_GATE PFI8/GPCTR0

  • Do not copy -old po price .. parameter EVO?

    Hi in price adoption in default value for buyers.. do not copy settings is made, even then previous PO price is copied to the PO.. and the parameter EVO is also maintained in user profile.. and i have assigned parameter value as X... even then previo