Fragmented sound when using Java Synthetizator

Hi,
What is the reason for sound fragmentation when using
Java synthetizator in playing midi files:
ByteArrayInputStream mididata = new ByteArrayInputStream(data);
AudioStream as = new AudioStream(mididata); //pre fragment? Priority problem?
mididata.close();
p.start(as);
as.close();}
catch (IOException f){System.out.println("error - " + f.toString());}
And why there is a "blob" in loadspeakers a few seconds before
the music starts?
See the whole source:
http://users.skynet.be/belgia/musitives/Synestesia.html
Regards,
LG
Metacomposer GR�HN http://users.skynet.be/belgia/midi/gallery.html
SYNESTESIA Open Source Java code generates music from any pictures

Not sure about the fragmentation, but I guess the Blob is because you have crap in your buffer before you start to play. I don't remember what the fix is for it, but I think there is some way of clearing out the buffer.

Similar Messages

  • App crash when using JAVA callbacks from native threads in solaris

    Hi all,
    Sorry for putting the thread here. I did use the native methods forum, I wasnt lucky. I Hope more people would look into this forum, which brings me here.
    I have a solaris application which crashes when I try to callback the JAVA methods and variables from the native code. The description of the problem is below
    Written a native library, the library is multithreaded (i.e) I create a thread using pthread_create() in the native code which performs the operation of calling a JAVA method from the native code. The routine of calling the JAVA method works perfectly elsewhere outside the new thread.
    There are two scenarios I've tested it in
    1. I created a thread (say X) from the main thread (say Y) and made the y to wait until the X is complete using the pthread_join(). The JAVA callbacks works fine when called from Y but the app crashes if done from X.
    2. Did not make the Y to wait until the X is complete, hoping that both will run paralelly and even the the App crashes.
    And to be precise the Y is the thread where the native method is called from JAVA.
    I have tested for any memory leaks or stack corruption by removing the JAVA callbacks and bulding a executable and using purify, the report doesnot hint any such occurances.
    The linker options used for building the shared library is as follows
    ${GPP} ${INC} -G ${LIB} -mt -g -lCstd -lCrun -lpthread ${OBJS} -o <lib-name>
    I wonder if we can create threads in the native code when using JAVA callbacks and even if we can whether it would be appropiate to use the callbacks with in the threads
    Looking forward for any help.
    Regards,
    Vamsi

    Guys... can't any one help me with this problem :(

  • My Apple TV lacking sound when using iplayer etc

    Can get sound when using Airplay from some web sources but not others. Any reasons why?
    Nick

    Hmm, rebooted the mac and now works! had only tried rebooting Apple Tv before. strange, as sound was fine on mac when not using airplay
    thanks all
    Nick

  • How do I stop system sounds when using AirPlay on my MacBook Pro?

    Hi all,
    Probably a quick question, but I'm fairly new to Macs. I've a Macbook Pro 13 Late 2011 and now I've got an Apple TV, I use AirPlay. But how do I stop system sounds when using AirPlay?
    Many thanks in advance, Jon.

    Open AirPort Utility located in HD > Applications > Utilities
    From the AirPort Utility menu bar click AirPort Utility > Preferences
    Deselect:   Monitor AirPort base stations for problems

  • I have a HP610-1150f. not recording sound when using webcam in touchsmart screen.

    I have a HP610-1150f. not recording sound when using webcam in touchsmart screen.  I have looked thru this forum and I don't see anyone else having this problem. (unless I missed it).  The recording works in Notes, but not when I open Webcam and try to record from there. video recording works fine. I have had this computer less than a month and I am having a couple of problems with it. Still loving it though.

    Hello schae731: Welcom to HP Forum and your new Touchsmart. You need to contact HP Direct Support on line your Touchsmart comes  with one year warranty so use it why you can. You can contact them through your HP Support Assistant or on line. They will help you with trouble shoot the web-cam software. Goto your computers model and make support web-site. They will also help you with your other issues as well.
             I am using the older version software so I won't be much help. Please repost if HP direct support is un able to help you resolve your issues. While you are chatting with them have them check out your computer do it before your 1 year warranty expires. Have fun with your new computer.

  • How do I have my phone Make sound when using "Find my phone" app

    How do I have my iPhone make sound when using "find my. Phon" app?

    You can have the app send you an email when it is found, and you can set your email tone under settings-> sounds

  • Strange class error when using java

    I've been attempting to use java.awt.robot to simulate a key press when a button is clicked however I'm getting a couple of errors that I can't figure out but I'm not so good when it comes to scripts. When the button "LetterButton" is pressed it should simulate a keypress, ideally to the desktop/operating sytem but the errors I'm getting are:-
    1071: Syntax error: expected a definition keyword (such as function) after attribute public, not static.
    1084: Syntax error: expecting rightbrace before leftbrace.
    1131: Class must not be nested.
    Here's the code:-
    <?xml version="1.0" encoding="utf-8"?><mx:WindowedApplicationxmlns:mx="
    http://www.adobe.com/2006/mxml" layout="absolute">
    <mx:Script>
    <![CDATA[
    import java.awt.Robot; 
    import java.awt.event.KeyEvent; 
    public class Main { 
    public static void main(String[] argv) throws Exception { 
    Robot robot =
    new Robot(); 
    robot.keyPress(KeyEvent.VK_A);
    robot.keyRelease(KeyEvent.VK_A);
    ]]>
    </mx:Script>
    <mx:VBox x="359" y="262" horizontalCenter="0" verticalCenter="0">
    <mx:Button id="LetterButton" label="Button" click=""/>
    <mx:TextInput id="txt"/>
    </mx:VBox></mx:WindowedApplication>

    Sounds tricky. I may ask them to look for an alternative way of doing it as Java really isn't my thing, I'm merely just a flex beginner at the moment.
    The reason I've been looking for this is that my app will be installed on a digital tv that also has a system connected to it using a Linux operating system so the user can switch between watching digital tv and the application seamlessly and at the moment a Linux professional who I'm working with has the Digital TV bound to the F12 key which is bound to a handheld remote control (being a tv there is no keyboard, just an 'air mouse' and the remote control).
    So my client and my Linux guy have asked me to come up with a way of getting the app to communicate with the desktop/operating system. I have seen flex apps in the past where a user can drag and drop videos on their desktop into an air application from which they will be played so I thought it would be possible to interact with the exteral OS/Desktop from within an AIR app by using just flex but it doesn't seem so easy through my research.
    Thanks for your help though.

  • JMStudio locks up playing sound file - using java 1.5.0_02 - HELP!

    I'm using the jmf 2.1.1e cross platform version on Windows XP SP2. I have java 1.5.0_02 installed.
    When I open the sound file using JMStudio it locks up. It plays videos that don't have sound fine, so it's not the video. It's the sound that is killing it.
    Does anyone have any suggestions?

    Hi,
    yeah it's possible to play sound on Windows but you have to use the Windows Performance Pack instead of the crossplatform-version of JMF.
    This has to do with the JavaSound Architecture of Java 5.0. They made changes and now the JavaSound Renderer didn't work under Windows but the DircetSound Renderer works fine.
    So be sure that your application uses the DirectSound Renderer!
    This is one of the main problems of JMF but now Sun gets interested in JMF and they would build a new version of JMF. If this is true they have to fix this problem!
    Best regards, thomas

  • ORA-04030: out of process memory when using Java Stored Procedures

    Hello,
    I have a problem using Java Stored Procedures in Oracle 10g.
    My Java application performs http posts to a webservice and the response is parsed in order to populate some DB tables.
    There is a scheduled job which calls the Java Stored Procedure every x minutes.
    No matter of the 'x minutes' values - after about 160 - 200 calls I get this error:
    ORA-04030: out of process memory when trying to allocate 1048620 bytes (joxp heap,f:OldSpace)
    ORA-04030: out of process memory when trying to allocate 2097196 bytes (joxp heap,f:OldSpace)
    The job stops just while is posting the http request. The weird thing is that almost each time the first http post request I get this error:
    java.net.ConnectException: Connection refused
         at java.net.PlainSocketImpl.socketConnect(Native Method)
         at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
         at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
         at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
         at java.net.Socket.connect(Socket.java:426)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(DashoA6275)
         at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:140)
         at org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSocket(SSLProtocolSocketFactory.java:130)
         at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
         at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
         at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
         at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
         at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
    and the second try works fine.
    So, The out of process memory occured each time just before getting such an error, and I suspect to be a connection between these errors.
    Tech details:
    1. OS: WinXP
    2. Oracle 10.1.0.2.0
    3. To perform http post I use HttpClient 3.1 from Apache.
    4. I checked the http connection to be closed each time, and this is done.
    5. I checked the oracle statement and connection to be closed each time and this is done
    6. The JVM error (logged in .trc files of Oracle) is:
    java.lang.OutOfMemoryError
         at java.lang.Thread.start(Native Method)
         at sun.security.provider.SeedGenerator$ThreadedSeedGenerator.run(SeedGenerator.java:297)
    DB Settings details:
    Starting up ORACLE RDBMS Version: 10.1.0.2.0.
    System parameters with non-default values:
    processes = 200
    sessions = 225
    shared_pool_size = 159383552
    large_pool_size = 8388608
    java_pool_size = 104857600
    nls_language = AMERICAN
    control_files = C:\ORACLE\PRODUCT\10.1.0\ORADATA\XXXXXX\CONTROL01.CTL, C:\ORACLE\PRODUCT\10.1.0\ORADATA\XXXXXX\CONTROL02.CTL, C:\ORACLE\PRODUCT\10.1.0\ORADATA\XXXXXX\CONTROL03.CTL
    db_block_size = 8192
    db_cache_size = 29360128
    compatible = 10.1.0
    fal_client = XXXXXX
    fal_server = XXXXXXs
    log_buffer = 524288
    log_checkpoint_interval = 100000
    db_files = 70
    db_file_multiblock_read_count= 32
    db_recovery_file_dest = C:\oracle\product\10.1.0\flash_recovery_area
    db_recovery_file_dest_size= 2147483648
    standby_file_management = AUTO
    undo_management = AUTO
    undo_tablespace = undotbs_01
    undo_retention = 14400
    remote_login_passwordfile= EXCLUSIVE
    db_domain =
    dispatchers = (PROTOCOL=TCP) (SERVICE=XXXXXXXDB)
    remote_dependencies_mode = SIGNATURE
    job_queue_processes = 4
    parallel_max_servers = 5
    background_dump_dest = C:\ORACLE\PRODUCT\10.1.0\ADMIN\XXXXXX\BDUMP
    user_dump_dest = C:\ORACLE\PRODUCT\10.1.0\ADMIN\XXXXXX\UDUMP
    max_dump_file_size = 10240
    core_dump_dest = C:\ORACLE\PRODUCT\10.1.0\ADMIN\XXXXXX\CDUMP
    sort_area_size = 1048576
    sort_area_retained_size = 1048576
    db_name = XXXXXX
    open_cursors = 500
    optimizer_mode = FIRST_ROWS
    pga_aggregate_target = 25165824
    Any help would be appreciated. Thanks.
    Can be a problem with JVM threading under Oracle ?

    The server prcess failed to allocate more memory for large objects ( in Oldspace).
    If you Google ORA-04030, you will see several recommendations to work around this.
    The Java VM in the database already has HttpClient, i don't know why you are loading the Apache HttpClient but this might not be the surce of the problem.
    Kuassi http://db360.blogspot.com

  • No Sound when Using HDMI from ATT DVR to TV

    I have a 52xv645u TV.  When I connect it to my ATT UVerse DVR using HDMI I get picture but no sound.  Using Composite everything works fine.  I've tried several HDMI cables.  If I use HDMI to my Surround Sound amp, I get both picture and sound (even with the amp volume muted).  The problem seems to be the connection between the DVR and the TV.  Does this TV support HDSC?  I believe that the DVR requires it to support it on the TV.  
    I see that there is an upgrade for the firmware for this TV.  I have a Mac so the instructions don't work right.  I've downloaded the files to a flash drive but I am not sure if they are correct because there is no list of files available.  Does anyone know what files are needed so I can be sure that my flash drive has everything it needs?
    Any help with these problems would be appreciated!  
    Thanks,
    Mark 

    Is there a list of things that are fixed in the update?   I can get sound and picture through component but I fear that it's not the same quality as it would be through HDMI.  But again, it's only when I watch TV without going through my surround sound amp.  I can watch TV through my apm and watch my Bluray DVDs through the amp and it goes via HDMI.  

  • How do i change default sound when using AirPlay Display on Mavericks

    So i am using a TV with Apple TV attached as a second display for watching movies etc in the background
    Everytime i turn on the setting to enable to the display, it sets the Apple TV as my default sound and i have to go to settings to manually re-select my speakers attached to my iMac. Is there anyway to change this so it leaves the sound from my Mac as the default sound when enabling the screen.

    I looked into this a little more carefully.  It's not the Guest account.  It clearly indicates "Managed".
    Searching for more information, this is something related to Parental Control, but I can't seem to get this account to take on the characteristics of either an administrator or user role.

  • Invalid SOAP action when using java ws WebService

    Hi all,
    this is a slightly more detailed error for a problem i posted recently. I am connecting to a web service that was generated from WSDL. It has two methods "HelloWorld" and "HelloSayFirstName". As defined in the WSDL, the methods use the SOAP action document style. I want to add a cookie to the http header, so after the port is created, I use the following to add the header to the requestContext:
              BindingProvider bindingProvider = (BindingProvider) servicePort;
              Map<String, Object> requestContext = bindingProvider.getRequestContext();
              List<String> cookies = new ArrayList<String>();
              cookies.add("mycookie=mytoken");
              HashMap<String, List<String>> httpHeaders = new HashMap<String, List<String>>();
              httpHeaders.put(HTTPConstants.HEADER_COOKIE, cookies);
              requestContext.put(MessageContext.HTTP_REQUEST_HEADERS, httpHeaders);
    This works when I call the first method (HelloWorld) - the first activity message sent to the server contains the following:
    <HttpRequest>
    <Method>POST</Method>
    <QueryString></QueryString>
    <WebHeaders>
    <Cache-Control>no-cache</Cache-Control>
    <Connection>keep-alive</Connection>
    <Pragma>no-cache</Pragma>
    <Transfer-Encoding>chunked</Transfer-Encoding>
    <Content-Type>text/xml; charset=UTF-8</Content-Type>
    <Accept>*</Accept>
    <Cookie>mycookie=mytoken</Cookie>
    <Host>exampleHost</Host>
    <User-Agent>Java/1.5.0_14</User-Agent>
    <SOAPAction>"http://tempuri.org/IMyService/HelloWorld"</SOAPAction>
    </WebHeaders>
    </HttpRequest>
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <s:Header xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
    <To s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://exampleHost/WebServices/WCFService/Service.svc</To>
    <Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://tempuri.org/IMyService/HelloWorld</Action>
    </s:Header>
    <soap:Body>
    <HelloWorld xmlns="http://tempuri.org/" xmlns:ns2="http://schemas.datacontract.org/2004/07/" xmlns:ns3="http://schemas.microsoft.com/2003/10/Serialization/">
    <myValue1>world</myValue1>
    </HelloWorld>
    </soap:Body>
    </soap:Envelope>
    However, after this method, the httpHeaders in the requestContext object have been updated to include the "Accept" header and the "SOAPAction" header - which is the incorrect action! Now, when I call the method "HelloSayFirstName" I get the following:
    <HttpRequest>
    <Method>POST</Method>
    <QueryString></QueryString>
    <WebHeaders>
    <Cache-Control>no-cache</Cache-Control>
    <Connection>keep-alive</Connection>
    <Pragma>no-cache</Pragma>
    <Transfer-Encoding>chunked</Transfer-Encoding>
    <Content-Type>text/xml; charset=UTF-8</Content-Type>
    <Accept>*</Accept>
    <Cookie>mycookie=mytoken</Cookie>
    <Host>exampleHost</Host>
    <User-Agent>Java/1.5.0_14</User-Agent>
    <SOAPAction>"http://tempuri.org/IMyService/HelloWorld"</SOAPAction>
    </WebHeaders>
    </HttpRequest>
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <s:Header xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
    <To s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://exampleHost/WebServices/WCFService/Service.svc</To>
    <Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://tempuri.org/IMyService/HelloWorld</Action>
    </s:Header>
    <soap:Body>
    <HelloSayFirstName xmlns="http://tempuri.org/" xmlns:ns2="http://schemas.datacontract.org/2004/07/" xmlns:ns3="http://schemas.microsoft.com/2003/10/Serialization/">
    <dataContractValue></dataContractValue>
    </HelloSayFirstName>
    </soap:Body>
    </soap:Envelope>
    It seems that the SOAPAction in the http header and the soap header is incorrect. Is there any reason why the requestContext would keep hold of the action that was previously called, and not use the new action? I'm stumped here - any help would be greatly appreciated.
    Cheers.

    Does not only happen when using JAX-WS.
    the following servlet code is enough to reproduce the problem :
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    response.setContentType("text/xml;charset=\"utf-8\"");
    It only occurs on 10.1.3.4.0 (works fine on 10.1.3.3.0 and 11.1.1.1.0 TP4)
    Regards

  • Custom classloader fails when using Java Web Start

    Hope you can help me with a problem that is driving me nuts. I have implemented my own classloader to support plugins. This classloader works as follows:
    1. The classloader is configured to access a plugin components jar file downloaded by jws.
    2. The plugin components jar file contains other jar files which contains the actual plugin code to be loaded using my own classloader.
    3. Upon initialization - my classloader extracts all jar files contained in the plugin components jar file into temporary files.
    4. These temporary files are used by my classloader when defining plugin classes.
    The classloader works fine when not using java web start. Then I launch the application using java web start with security policy in .jnlp file set to:
    <security>
    <all-permissions/>
    </security>
    After a while (it was able to load some of the classes) it fails with the following stack-trace:
    Regards,
    Terje
    java.security.AccessControlException: access denied (java.io.FilePermission C:\DOCUME~1\TEOES\LOCALS~1\Temp\activity61102.jar read)
         at java.security.AccessControlContext.checkPermission(Unknown Source)
         at java.security.AccessController.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkRead(Unknown Source)
         at java.util.zip.ZipFile.<init>(Unknown Source)
         at java.util.jar.JarFile.<init>(Unknown Source)
         at java.util.jar.JarFile.<init>(Unknown Source)
         at my.plugin.ActivityClassLoader.getJarFileEntry(ActivityClassLoader.java:258)
         at my.plugin.ActivityClassLoader.search(ActivityClassLoader.java:244)
         at my.plugin.ActivityClassLoader.loadClass(ActivityClassLoader.java:99)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    Does anyone have source code for implementing a simple class loader that can be used with Java Web Start (preferrably with all jar files to be used by the classloader wrapped into a jar file)

    If you implement your own classloader, and then still run with a SecurityManager installed, then your ClossLoader is responsible for asigning the permissions to the code it loads.
    You need your ClassLoader to extend SecureClassLoader, and implement the method :
    SecureClassLoader.getPermissions(CodeSource cs) to return the PermissionCollection you want.
    /Andy

  • Fizzy and hissing sound when using earphone...

    I have a Macbook Pro 13 inches 2009. I use my earphone to listen music. However, when I don't play music, I can hear a fizzy and hissing sound from my earphone. I tried to use another one but there is still fizzy and hissing sound when no music is playing. I can hear that even clearer when my room is silent. I feel really annoyed about that sound.
    If anyone knows how to fix it, please let me know. Any helps are appreciating...
    Thanks.
    Vu Dinh
    P/S: I'm not sure if it's a software issue or hardware issue.

    The problem is when I dont play music, there is still fizzy and hissing sound on my earphone. Only when I play music, the music is louder than that sound so I just hear music in that time. However, when I dont play music, there is always fizzy sound on my earphone. I already said it always happens when I put my earphone jack on Macbook Pro.
    I want to know if there are any ways to fix that... It's really annoying. It's not silent at all even there is no music. Always a fizzy sound on my earphone.

  • No sound when using programs

    My curve does not make any sounds when i'm using VZ Nav or when i'm using AIM.  it rings for phone calls and text and BB messenger. It won;t even make a sound in vz nav when i press the talk button.   any ideas??

    Backup your Blackberry and Wipe Handheld and test again before restoring from the backup. If its still failing, you may need to upgrade or reload the current o/s.
    New to a Blackberry? Check out http://www.discoverblackberry.com

Maybe you are looking for

  • Desktop App hangs at Loading...

    I have a desktop application that I have been using for a while now.  Now when I start, I get the "Loading..." white screen and then it hangs.  I did the usual--Reboot, Clean Solution, etc.  I also searched for other users suggestions, but it seems t

  • Workflow integration with other BPM software?

    Any idea on how workflow engine, integrates with other business process management software?

  • Include XML payload as URL query string

    Hello Gurus - I have a business requirement that I'm hoping you all can help me with: Scenario: Send XML message from SAP XI to a third party system via the Receiver Plain HTTP Adapter I need to include the actual XML message as a query string in the

  • My ipod touch wont connect to my network anymore.

    it was working fine and then started to disconnect and reconnect so i reset the network settings and now i cant join the network at all. it shows the wifi icon but wont join network. help!?!?

  • Third party email abuse/scam

    I have just received an email on my macbook pro which is apparently from a name who is in my address book, but it most definitely was NOT from that individual. Instead it was a scam asking me to send money to Madrid of all places via Western Union !