Re: IllegalArgumentException: Illegal request to write non-integral

Description:
               Java sound library has been bundled with java1.4. There was a
               separate sound libraray in java1.3 (sound.jar). In java1.4
               com.sun.media.sound.* contains an inbuilt sound device configuration
               library.
               A JMF class (com.sun.media.protocol.javasound.JavaSoundSourceStream.class)
               uses javax.sound.sampled.TargetDataLine Interface for reading data from
               media device and defines a buffer size to read data for the method
               javax.sound.sampled.TargetDataLine.read(byte[] b, int off, int len)
               for the variable "len"
               The source for read method of the class
               javax.sound.sampled.TargetDataLine.read resembles like this:
               public int read(byte[] b, int off, int len) {
               if (len % getFormat().getFrameSize() != 0) {
                    throw new IllegalArgumentException("Illegal request to write non-integral number of frames (" + len + " bytes )");
               Clearly, this requires that the number of bytes to be read must
               be an integral number of sample frames, such that:
               [ bytes read ] % [frame size in bytes ] == 0
Solution:
               Buffer size defined in JavaSoundSourceStream should be proper
               and adjustable for device capability.
               Before defining buffer size, the getFrameSize() method of
               javax.sound.sampled.AudioFormat should be called to verify
               the frame size of the media device.
               The following code should be inserted in the file
               com/sun/media/protocol/javasound/JavaSoundSourceStream.java
               in the method openDev():
               int adjust_FrameBuffer_size = afmt.getFrameSize();
               bufSize = bufSize - (bufSize % adjust_FrameBuffer_size);
               before defining DataLine.Info buffersize.
*/

hello fellows!
In my case i am plugging in the JSPEEX into java sound API. I am getting this same exception when I have samplesizebits as 16 Bits (Depth sample) . But when I make it as 8 Bit(Depth sample) its executing without any exception. wat is the reason?
java.lang.IllegalArgumentException: illegal request to write non-integral number of frames (607 bytes, frameSize = 2 bytes)
My Input parameters:
float sampleRate = 44100.F;
int sampleSizeInBits = 16; //8,16
int channels = 1;//1,2
boolean signed = true;//true,false
boolean bigEndian = false;
OS: Windows NT server.

Similar Messages

  • Formatting Error.. illegal request...Buffer Underrun

    Hi All..
    I'm having trouble burning an FCP 5 to DSP 4. I have correctly exported the files to Mpeg-2, using both the File--Export--QuickMoive etc, and/or using Compressor.
    I usually get(something like this)
    Fomatting Failed. Unable to format disc, illegal request. Buffer Underrun (0x21, 0x20).
    I even tried using idvd instead and it happens there also..
    Out of 15-20 Tries with new DVD's each time, it only burned twice. Of those the disc would play but none of the menus worked(that could be a me problem, not linking an assest right)
    Is this a Super Drive failure, Hardware Failure
    I'm going to try the file on campus, and see if I can burn it there on a different MAC.
    I'm sorta new to the Mac Universe, so any guidance would be helpful.
    Oh yeah, I'm using a Dual Core 2.0 GHZ G5, with a 1GB of Ram, upgraded Graphic card, Latest Tiger...etc

    Are you doing anything else on the Mac whilst you are burning - network access, Internet surfing, screen savers, energy savers of any kind - anything that will demand CPU processing power? If so, don't!
    This question came up just about a week ago - run a search for buffer underrun in the forum. The situation occurs when the DVD writer is left waiting for data to be sent to it... it's buffer runs out of data. This is usually caused by the main processor being used by some other process and not being able to keep a steady stream of data being sent to the writer.

  • Getting a request in a non English character

    Hi ,
    In an attempt to solve a problem of getting a request in a non English character , i use the code , taken from O'Reilly's "Java Servlet programing" First edition:
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    public class MyServlet extends HttpServlet {
         public void doGet(HttpServletRequest req, HttpServletResponse res)
                                                                               throws ServletException, IOException {
              try {
                                                      //set encoding of request and responce
         req.setCharacterEncoding("Cp1255"); //for hebrew windows
         res.setCharacterEncoding("Cp1255");
         res.setContentType("Text/html; Cp1255");
         String value = req.getParameter("param");
                                                      // Now convert it from an array of bytes to an array of characters.
         // Here we bother to read only the first line.
                                                      BufferedReader reader = new BufferedReader(
         new InputStreamReader(new StringBufferInputStream(value), "Cp1255"));
                                                      String valueInUnicode = reader.readLine();
              }catch (Exception e) {
              e.printStackTrace();
    this works fine , the only problem is that StringBufferInputStream is deprecated .
    is there any other alternative for that ?
    Thanks in advance
    Yair

    Hi Again ..
    To get to the root of things , here is a servlet test and an http client test which demonstrates using the above patch and not using it :
    The servlet :
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.io.PrintWriter;
    import java.io.StringBufferInputStream;
    public class Hebrew2test extends HttpServlet {
         public void doGet(HttpServletRequest request, HttpServletResponse response)
         throws ServletException, IOException {
              request.setCharacterEncoding("Cp1255");
              response.setCharacterEncoding("Cp1255");
              response.setContentType("Text/html; Cp1255");
              PrintWriter out = response.getWriter();
              String name = request.getParameter("name");
              //print without any patch
              out.println(name);
              //a try with patch 1 DEPRECATED
              out.println("patch 1:");
              BufferedReader reader =
              new BufferedReader(new InputStreamReader(new StringBufferInputStream(name), "cp1255"));
              String patch_name = reader.readLine();
              out.println(patch_name);
              //a try with patch 2 which doesn't work          
              out.println("patch 2:");
              String valueInUnicode = new String(name.getBytes("Cp1255"), "UTF8");
              out.println(valueInUnicode);
    and now for a test client :
    import java.io.*;
    import java.net.*;
    public class HttpClient_cp1255 {
    private static void printUsage() {
    System.out.println("usage: java HttpClient host port");
    public static void main(String[] args) {
    if (args.length < 2) {
    printUsage();
    return;
    // Host is the first parameter, port is the second
    String host = args[0];
    int port;
    try {
    port = Integer.parseInt(args[1]);
    catch (NumberFormatException e) {
    printUsage();
    return;
    try {
    // Open a socket to the server
    Socket s = new Socket(host, port);
    // Start a thread to send reuest to the server
    new Request_(s).start();
    // Now print everything we receive from the socket
    BufferedReader in = new BufferedReader(new InputStreamReader(s.getInputStream(),"cp1255"));
    String line;
    File f = new File("in.txt");
    FileWriter out = new FileWriter(f);
    while ((line = in.readLine()) != null) {
    System.out.println(line);
    out.write(line);
    out.close();
         catch (Exception e) {
    e.printStackTrace();
    class Request_ extends Thread {
    Socket s;
    public Request_( Socket s) {
    this.s = s;
    setPriority(MIN_PRIORITY); // socket reads should have a higher priority
    // Wish I could use a select() !
    setDaemon(true); // let the app die even when this thread is running
    public void run() {
    try {
                        OutputStreamWriter server = new OutputStreamWriter(s.getOutputStream(),"cp1255");
                        //String query= "GET /userprofiles/hebrew2test?name=yair"; //yair in Englisg ..
                        String query= "GET /userprofiles/hebrew2test?name=\u05d9\u05d0\u05d9\u05e8"; //yair in hebrew - in unicode
                   System.out.println("Connected... your HTTP request is sent");
                        System.out.println("------------------------------------------");
                        server.write(query);
                        server.write("\r\n"); // HTTP lines end with \r\n
                        server.flush();
                        System.out.println(server.getEncoding());
         server =      new OutputStreamWriter(new FileOutputStream("out.txt"),"cp1255");
                        server.write(query);
                        server.flush();
    catch (Exception e) {
    e.printStackTrace();

  • How to write non-XML data to a file using an OSB FTP Routing?

    Hi --
    Situation ... I need to write non-XML data to a file using FTP. A proxy service retrieves XML and transforms it with XSLT to CSV format, then gives it to a Biz service to file it out, using FTP. Simple.
    Problem ... OSB sends the contents of $body to any service it calls. Because $body is a SOAP document, it has to contain XML. So therefore I have to put my CSV data into an XML element, in order to put it into $body; and this inner element then gets written to the file, which I don’t want. But if I don't enclose my CSV content in a tag, I get "Unexpected CDATA encountered" trying to assign it to a variable.
    There has to be away around this!
    Thanks for your help.
    John Taylor

    Solved. Steps:
    -- Transform the XML to CSV using an XSL transform. Put the CSV data inside enclosing XML elements, and use a Replace action to put the XML element + CSV contents back into *$body*.
    -- Define an MFL transform that only knows about the enclosing XML elements. Use a delimiter of "\n" (hard return).
    -- Route from the proxy service to a Biz service that has Service Type = Messaging Service and Request Message Type = MFL; specify the MFL transform, which will receive the incoming *$body* variable, strip off the enclosing XML element within it, and pass the CSV contents to the FTP service.
    Edited by: DunedainRanger on Nov 29, 2011 9:03 AM

  • How to update request of write-optimised ODS to other ODS or Cube by DTP?

    Hi,gurus here.
    I've tried to update write-optimized ODS request to another ODS by DTP in both full and delta mode, bit it's futile.
    So is that possible? how to do?
    Thanks.

    Hi..
    Please check the below things.
    1. Is the request 'Green" in Write-Optimized DSO?
    2. Does your target DSO already contains the request? Write-Opt DTP sends Delta based on request , so if one request has been loaded once to target, next time it will not be loaded with Delta DTP.
    3. Is there any filter settings in DTP? Suppose you have a Filter on CALYEAR 2008 but in your W-O DSO you do not have any data for 2008.
    If the above does not solve your problem , please paste the DTP monitor log .
    Regards
    Anindya

  • The recording device reported the illegal request: Unknown device

    Has anybody any idea? I am not able to output a dvd-9 (dvd + dl). there is always the message: the recording device reported the illegal request: unknown device. The layersize is ok and the dual layer brake is set.

    I don't have the exact error message with me, but that sounds similar. I bought a new DVR-115 for my Mac Pro and put the existing DVR-112 in the bottom slot. The DVR-115 worked fine for a month or so, then started getting that or a similar error. I replaced it under warranty and soon got the same thing. Then I Googled the error message an found many people having the same problem, even people with PCs. Now I just burn with the DVR-112, not worth resolving. BUT, I could be remembering the error message incorrectly, so Google and see what you get.

  • WLC 5508 - Ignoring Primary discovery request received on non-management interface (2) from AP

    Hello,
    Im receving this error on my syslog server:
    capwap_ac_sm.c:1443 Ignoring Primary discovery request received on non-management interface (2) from AP
    already checked the configuration and everything seems ok. They are registered and with clients associated.
    What could be the cause?
    Thanks in advance,
    Chris

    Thanks Scott for your fast response.
    No, I'm not using LAG.
    What do you mean with separate AP Managers?
    I have one AP Manager on vlan 100 (10.100.0.25) and the Management interface on the same Vlan (10.100.0.26)
    And users use vlan 150 (10.150.0.x).
    The switch port where the AP is plugged is configured with:
    interface GigabitEthernet2/0/20
    switchport access vlan 100
    switchport mode access
    spanning-tree portfast
    On WLC I can also check the AP history:
    Last Error Occurred Reason            Layer 3 discovery request not received on management interface

  • Recording device reported illegal request: buffer underrun

    "Errors found during the burning process....illegal request: Buffer underrun (0x21, 0x02)"
    Any suggestions?
    Thanks, Kim

    Hello Kim,
    a buffer underrun occurs when the data stream to the burner is interrupted (i.e. the data is not coming fast enough). As the burner cannot interrupt the burn process, it is being aborted.
    This error is commonly associated with burn speed and/or incompatible DVD media. You might want to try to create a disk image and burn that with either Disk Utility or Toast (both apps allow you to control burn speed - iDVD does not).
    iDVD 4 disc image burning can be enabled through the patch HPfurz:
    http://homepage.mac.com/geerlingguy/macsupport/mac_help/pages/0015-burn_idvdother.html
    burn at slow speed (2x) and use high quality DVD-R media (e.g. Verbatim)
    hope this helps
    mish

  • "physical writes non checkpoint" is low, but increase redo doesn't help.

    We have a very busy database, the physical write is so high that we want to reduce the physical write. From the statspack, we could see "physical writes non checkpoint" is low in comparison with "physical write", so I think the physical write resulted from checkpoint is high, then I increased the redo size from 2G to 4G (now the log file switch every 4 minutes). I hope this could reduce the physical write, but the fact is the increased redo is helpless.
    Statistic                                      Total     per Second    per Trans
    physical writes                            8,298,681        9,210.5        249.8
    physical writes non checkpoint             3,229,321        3,584.2         97.2We are using oracle 10.2.0.3 on solaris 10, parameters related to checkpoint are
    fast_start_io_target                          0                 
    fast_start_mttr_target                        0                 
    log_checkpoint_interval                       5000000           
    log_checkpoint_timeout                        0     Thanks,
    Edited by: user646745 on Aug 18, 2009 1:24 AM

    Your log_checkpoint_interval is still at 2.5GB. So, even though you have increased the redo log file sizes, a checkpoint will occur at every 2.5GB of Redo. The rate of checkpointing has moved from "every 2GB of redo" to "every 2.5GB of redo".
    You could set log_checkpoint_interval to 0 to disable the intermediate checkpoints.
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/initparams109.htm#i1129193
    Note : However, FAST_START_MTTR_TARGET will still cause Incremental Checkpoints.

  • EIM 4.3.2 - Non Integrated Priority

    Hello,
    We have decided to move one of our business unit's to a non-integrated solution, and I had a question on priorities.
    Does anyone know if priority 1 is the highest or lowest setting?
    If an email comes in with no priority set, is it lower than the lowest setting, or is there a default?
    When you setup routing, you can setup the default for emails to be answered based on priority, however you can't say, "answer based on priority first, then time in queue". Is this an assumed setting if you route based on priority?
    Hope someone can help!
    Barry

    There is no need to open a TAC case for this as this was advised as not supported configuration since it overrides intentional behavior to honor max task. If it is fully supported then I guess Karthik and Gaurav would be able to publish the solution directly instead of asking for TAC cases to be opened
    Personally, I think this should have been enabled by default but the conclusion which was made by BU and eGain apparently takes something more into account and confirms the initial decision not to include this in the available options. Nevertheless, I would still like to be proved otherwise as honestly I didn't find any additional technical details 'what can go wrong' but I also welcome that part from Karthik/Gaurav as well if that still stands.

  • Integrated and Non-Integrated Facility

    Can a facility be both Integrated and Non-Integrated?

    Dear Jeannie,
    I assume your question is related to the questions in the survey you received. This is a bit to specific to be discussed here. You should have received an email from PSN-Support.
    Best Regards,
    Jonas

  • EIM 4.3 - Integrated vs. Non-Integrated

    Hello,
    Looks like the ability for our supervisors to be able to pull emails out of the queue is starting to out weigh their descision to remain integrated! Has anyone had to do a comparison chart that they could share with me?
    Even if you have a few points and can share them, that would be great. Once I have everything in order, I can post a complete list. For now, I'm back to reading the 'non-integrated' parts of the manual, that I skipped last time!
    Barry

    Integrated
    -> Universal queue is possible. Voice & Chats are non-interruptible while Emails are interruptible.
    -> Only push method is possible
    -> Supervisor/Agents cant pull/pick from other queues or from other agents
    -> ICM needs to take care of wait period when agents are unavailable
    Non-integrated
    -> Routing of voice and email/chats are done independently.
    -> Both push and pull are possible
    -> Supervisor/Agent can pull/pick from other queues or from other agents
    -> ICM straight away dumps the email into the queue regardless of available agents
    -JT-

  • Integreated Versus Non integreated system of accounting

    Hello experts
    I want to know whether integreated and non integreated system of accounting can be followed concurrently in SAP.
    that is to have the separate system for cost accouting and financial accouting and to have the separate trial balance as per cost accouting and financial accounting. is it possible?
    Basically because of the inherent differences in these two types of accouting, there will be different profits .
    Hence i want to know whether it is possible to have the different trial balance as per these two systems?

    Within SAP you can produce a P&L statement both in FI (finance) and CO (controlling).  Trial balance exists in FI.  The answer to your question is yes.  

  • How to send a http request to a non java appln

    I have one legacy web application running which can handle only http request . So I need to connect (using http request) and send my request and get the response, without opening that application in browser.
    Any idea
    1) How to connect to non - java appln from a java appln ?
    2) How to use the Httprequest without displaying the page using browser?

    You can try one of three routes:
    Open a socket and write the HTTP request and parse the HTTP response yourself
    Use java.net.URLConnection
    Use Jakarta Common's HttpClient at jakarta.apache.org- Saish

  • Report Writer Excel integration

    I have a serious issue here that I am unable to resolve in report writer or painter.
    I want the report to export to excel with some formatting.
    The formatting that I want is that.
    My report has 1 row of profit center which is variablized for user selection, when a user wants to see a report for a certain range of profit centers, he will enter that in the selection criteria, the report comes out looking fine how I want it but when I turn the excel integration on , I want all the profit centers that were selected in the selection screen to appear in a seperate tab in excel..
    So one tab per profit center chosen , How do i do that?
    please help, urgent.
    thanks.

    Hi,
    Use section option,
    Edit--- sections-New section (with profit center range).
    Thanks
    Jagannadh

Maybe you are looking for

  • Deleted itunes by accident and now can't reinstall it due to error message

    I deleted Itunes on my Windows 7 computer by accident and when I went to reinstall it, I got an error message saying "There is a problem with this windows installer package. A program required for this install to complete could not be run. Contact yo

  • In "development" i can no longer see the "basic" option. how can i get it back

    In "development" I can no longer see the "Basic" option. How can I get it back?

  • Reader 9.3.0 and Photoshop Elements 2.0

    I have a new computer with Windows 7, 64 bit, etc.  I loaded Adobe Reader 9.3.0.  I also have Adobe Photoshop Elements 2.0.  Whenever I want to open a PDF file, Photoshop tries to open it, which doesn't work.  What did I do wrong and how do I get Rea

  • Logging WLDF

    Hi all, This had probably been answered so apologies. Can't seem to find out how I can grab a simple log of JDBC Connection Pool info, Session info, and THread Usage while we are stressing our system our system, without having to look at the admin co

  • Mic volume probl

    hi, i have a Creative Sound Blaster Audigy SE 7.. i never really wanted to use a mic on it until now. I plugged it in and spoke on Teamspeak. The other poeple say sound comes out, but the volume is really really low. I tried searching for a mic boost