Requested buffer too large - but data is already in memory

Hello all,
I am writing a program that generates sound and then uses the Java Sound API to play it back over the speakers. Until recently, using clips have not led to any problems. On two computers I can play the sound without a hitch. However, on the newest computer (and also with the largest specs and especially more RAM), I am getting an error while trying to play back the sound. The exception that is thrown is:
javax.sound.sampled.LineUnavailableException: Failed to allocate clip data: Requested buffer too large.
I find this odd because the buffer already exists in memory: I don't have to read in a .wav file or anything because I am creating the audio during the course of my program's execution (this is also why I use Clips instead of streaming - the values are saved as doubles during the calculations and then converted into a byte array, which is the buffer that is used in the clip.open() method call). It has no problems allocating the double array, the byte array, or populating the byte array. It is only thrown during clip.open() call. I also find it strange that it would work on two other computers, both of which have less RAM (it runs fine on a machine with 512MB and 2GB of RAM, both XP 32-bit). The only difference is that the computer with the issue is running Windows 7 (the RTM build), 64-bit with 6GB of RAM. I am running it through Netbeans 6.7.1 with memory options set to use up to 512MB - but it's never gone up that far before. And I've checked the size of the buffer on all three computers and they are all the same.
Does anyone know what the issue could be or how to resolve it? I am using JDK6 if that matters. Thank you for your time.
Edited by: Sengin on Sep 18, 2009 9:40 PM

Thanks for your answer. I'll try that.
I figured it had something to do with Windows 7 since it technically hasn't been released yet (however I have the RTM version thanks to a group at my univeristy in cahoots with Microsoft which allows some students to get various Microsoft products for $12).
Edit: I just changed the Clip to a SourceDataLine (and the few other necessary changes like changing the way the DataLine.Info object was created) and wrote the whole buffer into it, drained the line and then closed it. It works fine. I'll mark the question as answered, however that may not be the "correct" answer (perhaps it does have something to do with Windows 7 and not being completely tested yet). Thanks.
Edited by: Sengin on Sep 21, 2009 8:44 PM
Edited by: Sengin on Sep 21, 2009 8:46 PM

Similar Messages

  • Playing a large Clip and "Requested buffer too large" exception

    Hi All.
    Through JavaSound, I am trying to reproduce a WAV audio file that I create within my application. Also the recording/acquisition of the audio file is performed through JavaSound.
    The WAV audio file that I am trying to play has the following features:
    - 44 Khz, 8-bit, mono
    - Length = 1min 36sec
    - File size = 4.04 MB
    Here is a fragment of my code:
    // Get the input stream from the input audio file
    audioInStream = AudioSystem.getAudioInputStream(inputFile);
    AudioFormat audioFormat = audioInStream.getFormat();
    // Compute the buffer size (for a 0.25 seconds buffer)
    float bufferTime = 0.25F; // 0.25 seconds of buffer
    int frameSize = audioFormat.getFrameSize();
    float frameRate = audioFormat.getFrameRate(); // frames per second
    int numOfBufferedFrames = (int)(frameRate * bufferTime);
    int bufferSize = frameSize * numOfBufferedFrames;
    // Create the output data line
    DataLine.Info sourceDataLineInfo = new DataLine.Info(Clip.class, audioFormat, bufferSize);
    sourceClip = (Clip)AudioSystem.getLine(sourceDataLineInfo);
    sourceClip.addLineListener(this);
    // Prepare the output line for playing
    sourceClip.open(audioInStream);
    // Start playing
    sourceClip.start();This code works perfectly fine on Windows (I am testing on a Windows XP Pro 32-bit machine).
    On the other side, this code throws the following exception on Mac OS X:
    javax.sound.sampled.LineUnavailableException: Failed to allocate clip data: Requested buffer too large.
         at com.sun.media.sound.MixerClip.implOpen(MixerClip.java:561)
         at com.sun.media.sound.MixerClip.open(MixerClip.java:165)
         at com.sun.media.sound.MixerClip.open(MixerClip.java:256)
         at mypackage.AudioPlaybackThread.run(AudioPlaybackThread.java:70)
         at java.lang.Thread.run(Thread.java:637)The exception is thrown upon the sourceClip.open(audioInStream); call.
    Googling around, I discovered that the MixerClip implementation seems to have some inherent buffer size limitation of 1 MB... Isn't it ridiculous?
    But why this is working perfectly fine on Windows - even with clips of 4 megabytes -, while not working with larger clips on Mac OS X?
    Also, will the following code line influence the size of the buffer used by MixerClip?
    DataLine.Info sourceDataLineInfo = new DataLine.Info(Clip.class, audioFormat, bufferSize);I know that I could use a SourceDataLine class, and write() data into it in order to reproduce my long audio clip, but I need support for pausing, seeking audio to a specific position, seeking forward, etc., and using a Clip would be absolutely perfect for this purpose!
    Any help or suggestion would be greatly appreciated.
    Thanks,
    Marco

    Googling around, I discovered that the MixerClip implementation seems to have some inherent buffer size limitation of 1 MB... Isn't it ridiculous?
    But why this is working perfectly fine on Windows - even with clips of 4 megabytes -, while not working with larger clips on Mac OS X?Because Apple changes stuff in the JRE and Microsoft doesn't... and I personally believe Mac specifically strips down the JavaSound stuff because of iTunes (anti-competition and such).
    Also, will the following code line influence the size of the buffer used by MixerClip?Probably not, no.
    I know that I could use a SourceDataLine class, and write() data into it in order to reproduce my long audio clip, but I need support for pausing, seeking audio to a specific position, seeking forward, etc., and using a Clip would be absolutely perfect for this purpose!You can program that functionality yourself, and if you want to open large files in Mac, it sounds like you'll have to.

  • (413) Request Entity too large intermittent error

    I have page in a SharePoint 2013 website which is viewed over https. The page has several input fields including two file upload controls. I am trying to upload a sample picture less than 1MB for each of the controls.
    I am calling a BizTalk WCF service on Submit. Sometimes, when I try to submit I get ‘413 Request Entity Too Large'. This error happens intermittently though because if I try submitting the same data a number of times, it fails sometimes and works other times.
    The binding settings for the service are set in code (not in Web.Config) as shown below ...
    var binding = RetrieveBindingSetting();
    var endpoint = RetrieveEndPointAddress(“enpointAddress”);
    var proxy = new (binding, endpoint);
    proxy.Create(request);
    public BasicHttpBinding RetrieveBindingSetting()
    var binding = new BasicHttpBinding
    MaxBufferPoolSize = 2147483647,
    MaxBufferSize = 2147483647,
    MaxReceivedMessageSize = 2147483647,
    MessageEncoding = WSMessageEncoding.Text,
    ReaderQuotas = new System.Xml.XmlDictionaryReaderQuotas
    MaxDepth = 2000000,
    MaxStringContentLength = 2147483647,
    MaxArrayLength = 2147483647,
    MaxBytesPerRead = 2147483647,
    MaxNameTableCharCount = 2147483647
    Security =
    Mode = BasicHttpSecurityMode.Transport,
    Transport = { ClientCredentialType = HttpClientCredentialType.Certificate }
    return binding;
    I have also set the uploadReadAheadSize in applicationHost.config file on IIS as by running the command below, as suggested here ...
    appcmd.exe set config "sharepoint" -section:system.webserver/serverruntime /uploadreadaheadsize:204800 /commit:apphost
    Nothing I do seems to fix this issue so I was wondering if anyone had any ideas?
    Thanks

    Sounds like it's not a SharePoint problem, does the page work correctly if you don't call the BizTalk WCF service? And what happens if a console app is calling the WCF service independently of SharePoint, does it fail then as well? In both cases, it would
    limit the troubleshooting scope to the WCF service, which gets you a step further.
    Kind regards,
    Margriet Bruggeman
    Lois & Clark IT Services
    web site: http://www.loisandclark.eu
    blog: http://www.sharepointdragons.com

  • When editing a wiki page, get a 'request entity too large' error message.

    [https://stbeehive.oracle.com/teamcollab/wiki/Sales+Playbooks:Demonstrating+Differentiators|https://stbeehive.oracle.com/teamcollab/wiki/Sales+Playbooks:Demonstrating+Differentiators] I'm trying to edit one of my wiki pages that has been static for about 5 months now, and when I try and save the page, I get the following message (note I cropped some because of formatting issues when posting):
    *413 Request Entity Too Large*
    HTTP/1.1 413 Request Entity Too Large Date: Tue, 18 Oct 2011 15:35:41 GMT Server: Oracle-Application-Server-10g Connection: close Transfer-Encoding: chunked Content-Type: text/html; charset=iso-8859-1
    Request Entity Too Large
    The requested resource
    /teamcollab/wiki/<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta content="text/html; charset=utf-8" http-equiv="Content-Type" /><script type="text/javascript"> var U = "undefined"; var gHttpRelativeWebRoot = "/ocom/"; var SSContributor = false; var SSForceContributor = false; var SSHideContributorUI = false; var ssUrlPrefix = "/splash/"; var ssUrlType = "2"; var g_navNode_Path = new Array(); g_navNode_Path[0] = '1790'; g_navNode_Path[1] = 'splash_collabsuite'; var g_ssSourceNodeId = "splash_collabsuite"; var g_ssSourceSiteId = "splash";</script><script id="SSNavigationFunctionsScript" type="text/javascript" src="/ocom/websites/splash/sitenavigationfunctions.js"></script><script id="SSNavigationScript" type="text/javascript" src="/ocom/websites/splash/sitenavigation.js"></script><script type="text/javascript">var g_strLanguageId = "en";</script><script type="text/javascript" src="/ocom/resources/wcm/sitestudio/wcm.toggle.js"></script><script type="text/javascript" src="/ocom/resources/sitestudio/ssajax/ssajax.js"></script> <script id="ssInfo" type="text/xml" warning="DO NOT MODIFY!"> <ssinfo> <fragmentinstance id="fragment1" fragmentid="universal-metatag" library="server:UNIVERSAL-FRAGMENTS"> </fragmentinstance> <fragmentinstance id="fragment2" fragmentid="ExternalSiteCatalystFragment" library="server:EXTERNALSCFRAGMENTLIB"></fragmentinstance> </ssinfo> </script> <meta name="GENERATOR" content="MSHTML 8.00.6001.18904" /><!--SS_BEGIN_SNIPPET(fragment1,head_tags)--><title>Collabsuite Outage</title><meta name="Title" content="Collabsuite Outage"><meta name="Description" content="Collabsuite Outage"><meta name="Keywords" content="Collabsuite Outage"><meta name="robots" content="NOINDEX, NOFOLLOW"><meta name="country" content=""><meta name="Language" content="en"><meta name="Updated Date" content="4/12/11 10:38 AM"><!--SS_END_SNIPPET(fragment1,head_tags)--> </head><body> <!--SS_BEGIN_SNIPPET(fragment1,code)...
    does not allow request data with GET requests, or the amount of data provided in the request exceeds the capacity limit.
    Additionally, a 413 Request Entity Too Large error was encountered while trying to use an ErrorDocument to handle the request.
    The page, should you wish to eyeball it, is at:
    https://stbeehive.oracle.com/teamcollab/wiki/Sales+Playbooks:Demonstrating+Differentiators

    Duane,
    This looks like the URL has the content of a wiki page as an attachment to the URL which is blowing up the get request. Can you go to the earlier version - the history should allow you to backtrack changes - if you access this earlier version and change something small - does it save OK. If so then maybe the change you made is the problem.
    I cannot access the workspace without being given explicit access so this is a guess.
    Phil

  • SP01 - display spool request, buffer too short

    Dear all,
    when trying to display spool request in transaction SP01, we are getting the error: internal error 0000000040/ 32 in spooler (buffer too short)
    But the same request could be displayed via transaction SPO10.
    R/3 4.6C.
    Any idea ?
    Thank you for the answer.
    Pavol Simko
    Edited by: Pavol Simko on Nov 3, 2009 3:18 AM

    In SM37:
    Goto>Display Requests>Settings...
    Then in "Display area"-->"From page"
    Set it to from page 1 - "no of pages" then try to display
    the spool again.

  • Keep getting 413 Request Entity too large for only one website

    When I go to www.stapleseasyrebate.com my computer goes nuts and then I get a 413 Request entity too large. It only seems to be this one website.

    This issue can be caused by corrupted cookies or cookies that are blocked.
    *check the permissions on the about:permissions page and in "Tools > Page Info > Permissions"
    Clear the cache and remove cookies only from websites that cause problems.
    "Clear the Cache":
    *Firefox > Preferences > Advanced > Network > Cached Web Content: "Clear Now"
    "Remove Cookies" from sites causing problems:
    *Firefox > Preferences > Privacy > "Use custom settings for history" > Cookies: "Show Cookies"

  • Sync error: Uploading records failed: "client issue: request body too large"

    1328917629619 Sync.Engine.AdblockPlus DEBUG Uploading records failed: "client issue: request body too large"
    This happens from 2 Win 7 computer and 1 Win XP computer sync'd. Without the Add Block Plus being sync'd everything works.

    Hi!
    That's a problem with the Add Block Plus sync engine. It seems that they have issues on their servers.
    Try to ask the same question in their forum: https://adblockplus.org/forum/
    Good luck!

  • Time Machine says the backup is too large but it is not

    Time Machine says the backup is too large but it is not.
    While it is true my hard drive is very full (150 Gb used of the available 160Gb), this is way less than 42 Pb!!!!
    I have tried numerous time to reset it and still the same issue.
    Here is the reoccurring message:
    Advice?

    PB.. what the heck is a PB.. I kind of thought TB are still in fairly low digits.
    Do a disk verify.. something is seriously stupidly wrong.. Otherwise ring Apple support and give them an earful about nonsense popups.
    http://pondini.org/TM/Troubleshooting.html  A5

  • Invoking service from OSB throws Request Entity Too Large fault

    Invoking .net service with large(>1M) base64Binary field from OSB returns "BEA-380000:Request Entity Too Large" error.
    How to enlagre the maximum message size?

    You have to slightly adjust WebLogic configuration:
    http://download.oracle.com/docs/cd/E12840_01/wls/docs103/config_wls/web_server.html#wp1059784

  • Request Entity Too Large?

    What does "Request Entity Too Large" mean? It keeps preventing me from seeing ANY of the posts I try to open.

    Try clearing your cache and cookies in the browser.  That should temporarily fix the problem until lithium comes up with a permanent fix.
    WyreNut
    I am a Volunteer here, not employed by HP.
    You too can become an HP Expert! Details HERE!
    If my post has helped you, click the Kudos Thumbs up!
    If it solved your issue, Click the "Accept as Solution" button so others can benefit from the question you asked!

  • Request-URI Too Large

    Hi, I am working on a project that involves exporting excel spreadsheets to a JSP script for special charting and as a result the URLs can be very long like: http://preview.tinyurl.com/p9vykm (full URL shown in tinyurl preview). As a result of this, servers typically complain about the URL being too large to process even though browsers like Firefox will happily accept such long URLs. So obviously a alternative method of passing this data to my JSP script must be saught, and it must be a manageable method able to be performed with VBA which is unfortunately being used to interact between the excel spreadsheet and this script. My thought was base64 encrypting the parameters, passing that to the JSP script and then having the JSP script decrypt the encrypted parameters and process them. Is that possible and if so how? If not, how would you think it best to approach this issue? Thanks!

    Yes, it's true. Servers are allowed to put a limit on the length of a URL when it's used for a GET request. There's nothing you can do about that. However if you use a POST request, then the parameters are passed differently and they don't count as part of the length. I have no idea whether VBA can be made to use POST instead of GET.
    I don't see why Base64 encoding would help, since it's guaranteed to increase the size of the string by one third. You need something which reduces the size of the string.

  • HT3275 my time machine says the backup is too large but it should only be incremental

    I have time machine trying to back up my mac (OSX10.6) to a time capsule but it gives the error:
    "This backup is too large for the backup disk. The backup requires 240.66 GB but only 8.25 GB are available."
    This time capsule is used for backups on multiple macs in our house and has previously performed a successful full backup for this mac. I thought it would just delete old backups to create space for new ones, but it doesn't seem to want to do this.
    How can I fix this?

    TM often seems unable to fix the old backups if the disk is used by several computers.. so this is not unusual.
    You either need to delete the sparsebundle for your computer and start a fresh backup.. 240GB is a lot of stuff btw.. is it restarting or corrupted an old backup and needs to restart.
    The alternative is to use a USB drive connected to the TC and use that as the TM target. A local external disk would do the same thing of course.

  • Error: Backup too large, but I have more than it needs

    Today I started getting a funny Time Machine Error:
    "This backup is too large for the backup volume. The backup requires 4.3 GB but only 4.6 GB are available."
    Yes, you read that right. It requires less than is available and still fails with this error. What's going on?
    More to the point, how do I fix this short of excluding items to backup? I thought TM would start dumping the old backup items to make room for the new. This obviously isn't happening.

    Exactly. I captured two of the screens with that type of error message. Here's a link to one of them.
    http://www.dt-concepts.com/images/error3.png
    Also, why doesn't the system just remove the oldest backup? I thought that was supposed to happen automatically.
    Randy

  • Very large file 1.6 GB..sports program for school. lots of photos, template where media spots saved and dropped photos in..trying to get it to printer swho says its too large but when reduces size loses all quality...HELP??

    Please help...large file my sons Athletic program. Had noto problem with Quality last year..this new printer said file is too large..too many layers, can I FLATTEN..He reduced size and photos look awful. It is 81 pages. Have to have complete before next friday!! Help anyone??

    At that size it sounds like you have inserted lots of photos at too large a size and resolution.
    Especially for a year book style project, first determine your image sizes and crop and fix the resolution to 300 dpi, then drag them into the publication. Pages does not use external references to files and rapidly grows to quite large size unless you trim and size your images before placement.
    Peter

  • Project too large but under 2 hrs...how do i fit?

    Compiled project is 108.5 MB too large for currently selected disc media.
    How do I lower the bitrate or quality to fit?

    http://dvdstepbystep.com/faqs_7.php
    Make the audio AC3 if you have not done so and you probably do not have to reencode video
    FWIW another thread with more info/links if needed
    http://discussions.apple.com/thread.jspa?messageID=5127726

Maybe you are looking for

  • Sharing Preference Pane no longer works.

    Hi, I can no longer open my Sharing pref pane. When I try to open it I have a message telling that pane loading failed. In console.log I have this : 2006-09-03 01:08:00.023 System Preferences[22750] * -[NSBundle load]: Error loading code /System/Libr

  • System recovery on Sattelite M70-204 PSM71E. The CD/DVD drive does not work

    Hello! Can you please give me some help and advice on the way to resolve the following issues: I have had over the last three months minor problems with Windows Installer: software updates could not always be performed successfully, an error message

  • Shipping ATO order PO directly to customer's SHIP TO site

    Hi, Initially posted in Order Management forum but didn't receive any answer. Posting it here since the question involve both PO and OM - For ATO sales orders, my customer prefers to use SHIP TO address defined in the sales order as SHIP TO address o

  • What is the keyboard shortcut to open Options window?

    This shortcut used to be Alt+O (Windows), but this is not working anymore! There is no listing of this shortcut even in the FF shortcut help page. Am not able to set it also. How to enable it back?

  • Thumbnails enlarge when hovered over

    Hi all, I'm trying to create an archive page for the past issues of a newsletter. I've tried creating one with CSS, which looks fine in Firefox but tweaks out in IE6. So I'm trying to create an archive page using Flash. I'd like to create a page simi