Mic Sampling - Smallest Sample size?

I presumed if I use line.read(), it will return as soon as it reads the number of bytes requested, however I'm finding that it won't return until a much larger sample has been taken.
I initialize AudioFormat: (rate = 44100)
return new AudioFormat(rate, 16, 1, true, false);
I run this in a full-out loop:
int available = line.available();
System.out.println(line.available());
int read = line.read(tmp, 0, 916);
What I see is that line.available will reach some number around 10k and then actually start returning samples, here's a typical output:
11016
10100
9184
8268
7352
6436
5520
4604
3688
2772
1856
940
24
(notice it decreases by 916 each time, as if no new samples are coming in)
Its apparently waiting until it has a certain number of samples and then "releasing" them to the line.read() method. Doing some testing, apparently if I wait until .available() >= 2756, I can actually obtain just that number of samples. I see that 2756 is 44.1k / 16. HOWEVER, if I put 2756 in the .read() line above, it still waits until it gets to about 10k samples before "releasing" the data, it only works if I test the .available() for having 2756 bytes.
I'm trying to do close to real-time data analysis, but if it waits to release the samples, I have to wait too, I'd really like to get to 916 sample frame (of the most recent data of course). Is this the API, my hardware, or is there a better way/API? Funny because on Android this is not a problem at all, it notifies me at the rate I choose.
Help!,
J

803100 wrote:
I realized that I could change the buffer size smaller by using line.open(..., bufferSize), that seems to do the trick. However, now that its so small, how do I know if I'm losing bytes?Why would you be losing bytes?

Similar Messages

  • Sample management & Sample determination

    Hello Experts,
    What is the difference between Sample determination and Sample management in Quality Management?
    Please explain this with the simple example for better understanding.
    Thanks in advance,
    Anitha Pauline

    Sample determination we define the following parameters,
    Sampling types - Rules for determining the sampling instruction, The sampling type defines the basic conditions for determining the sample size for each inspection characteristic. A distinction is made between certain basic forms, such as:
    100% inspection
    Fixed sample
    Percentage sample
    Sample according to the sampling scheme
    Adapt Rules for Sample Determination :To define or adapt the rules for determining samples, integrate the function module responsible for determining the sampling plan in your system. These rules form part of the function that supports the sampling type and are therefore dependent on the same parameters as this sampling type.
    Sampling ProcedureA sampling procedure defines the rules that specify how the system calculates the sample size and it contains information about the valuation of an inspection characteristic during results recording (attributive, variable, manual, etc.).
    Sampling procedures are usually used at characteristic level of a task list or material specification. You can however determine the sample size, without reference to task lists. To do this, you define a sampling procedure in the settings at plant level or for the inspection type in the material master.

  • Quality management( difference between sampling procedure & sample drawing)

    Hi Experts,
    I am very new to quality management module & working in united states. i am trying to find difference between sampling procedure & sample drawing procedure.
    I see that sample drawing procedure is assigned to Inspection Plan & sampling procedure is assigned to characteristics, But i don't know the difference between these two, Please help me.
    Regards,
    Seshu

    Hi,
    SAMPLING PROCEDURE :
    A procedure that contains the rules for determining the sample size for an inspection. The sampling procedure also specifies the type of valuation to use for results recording (attributive, variable, or manual).
    Use
    You assign a sampling procedure to each characteristic in an inspection plan to calculate the sample size.
    Integration
    In a sampling procedure, you must activate the function for inspection points based on a sample-drawing procedure if you assigned a sampling procedure and a sample-drawing procedure to an inspection plan at the characteristic and header levels respectively.
    SAMPLE DRAWING PROCEDURE:
    Definition
    A master data object in which you plan the drawing of physical samples. In the sample-drawing procedure, you specify:
    Which categories of physical samples must be drawn
    How many physical samples must drawn
    The size of each physical sample
    Whether the drawing of physical samples must be confirmed
    Use
    The system uses the information in the sample-drawing procedure together with the information in the inspection plan to calculate the physical sample sizes, and to create physical-sample records when an inspection lot is created.
    Structure
    A sample-drawing procedure contains the following types of information:
    Header data
    The sample drawing header contains the following information fields and control indicators:
    Key that identifies the sample-drawing procedure
    Short text description for the sample-drawing procedure
    Authorization group that limits the access to the sample-drawing procedure
    Text for matchcode searches
    Long text indicator
    Indicator for calculating the number of physical samples on the basis of number of containers in the inspection lot (as opposed to the base unit of measure)
    Confirmation indicator to activate or deactivate the confirmation requirement
    Lock indicator to prevent the sample-drawing procedure from being used
    Usage indicator that shows whether the sample-drawing procedure is currently used in an inspection plan
    Sample-drawing item(s)
    A sample-drawing item contains specific instructions for creating physical samples with respect to a specific inspection lot container type and specific partial-sample numbers in the inspection plan. In a sample-drawing item, you can also specify:
    Which categories of physical samples you want to create (primary samples, pooled samples, and reserve samples)
    The physical sample container you use to draw each category of physical sample
    A factor to increase the quantity of physical samples to be created (for example, if you need to carry out more than one inspection)
    The number of physical samples to be created (fixed number or variable number based on a sampling scheme)
    Integration
    The sample-drawing procedure interacts with the following planning objects:
    Inspection plan
    You assign a sample-drawing procedure to an inspection plan to activate the functions for sample management.
    Sampling scheme (optional)
    If you want the system to determine the number of physical samples automatically on the basis of a sampling scheme, you can reference sampling schemes in a sample-drawing procedure.
    Hope it helps...
    Regards,
    Priyanka.P
    AWARD IF HELPFULL

  • How can I auto export a PDF File using the "Smallest File Size" preset and set the Exported File Name based on information from an Imported PDF?

    Greetings all,
    I am trying to create a script to automate a PDF export process for my company for inDesign. I’m fairly new to inDesign itself and have no previous experience with javascript, although I did take C++ in high school and have found it helpful in putting this code together.
    We have an inDesign template file and then use the Multi-page PDF importer script to import PDF files. We then have to export two version of each file that we import, then delete the imported file and all of the pages to reset the template. This has to be done for nearly 1000 pdf files each month and is quite tedious. I’m working on automating the process as much as possible. I’ve managed to piece together code that will cleanup the file much quicker and am now trying to automate the PDF exports themselves.
    The files are sent to us as “TRUGLY#####_Client” and need to be exported as “POP#####_Client_Date-Range_North/South.pdf”
    For example, TRUGLY12345_Client needs to be exported as POP12345_Client_Mar01-Mar31_North and POP12345_Client_Mar01-Mar31_South.
    There are two templates built into the template file for the north and south file that are toggled easily via layer visibility switches. I need to get a code that can ideally read the #s from the imported Trugly file as well as the Client and input those into variables to use when exporting. The date range is found in the same place in the top right of each pdf file. I am not sure if this can be read somehow or if it will have to be input manually. I can put North or South into the file name based on which template layer is visible.
    I am not sure how to go about doing this. I did find the following code for exporting to PDF with preset but it requires me to select a preset and then type the full file name. How can I set it to automatically use the “Smallest File Size” preset without prompting me to choose and then automatically input some or preferably all of the file name automatically? (If the entire filename is possible then I don’t even want a prompt to appear so it will be fully automated!)
    PDF Export Code (Originally from here: Simple PDF Export with Preset selection | IndiSnip [InDesign® Snippets]):
    var myPresets = app.pdfExportPresets.everyItem().name;
    myPresets.unshift("- Select Preset -");
    var myWin = new Window('dialog', 'PDF Export Presets');
    myWin.orientation = 'row';
    with(myWin){
        myWin.sText = add('statictext', undefined, 'Select PDF Export preset:');
        myWin.myPDFExport = add('dropdownlist',undefined,undefined,{items:myPresets});
        myWin.myPDFExport.selection = 0;
        myWin.btnOK = add('button', undefined, 'OK');
    myWin.center();
    var myWindow = myWin.show();
    if(myWindow == true && myWin.myPDFExport.selection.index != 0){
        var myPreset = app.pdfExportPresets.item(String(myWin.myPDFExport.selection));
        myFile = File(File.saveDialog("Save file with preset: " + myPreset.name,"PDF files: *.pdf"));
        if(myFile != null){
            app.activeDocument.exportFile(ExportFormat.PDF_TYPE, myFile, false, myPreset);
        }else{
            alert("No File selected");
    }else{
        alert("No PDF Preset selected");
    So far my code does the following:
    1) Runs the Multi-Page PDF Import Script
    2) Runs PDF Export Script Above
    3) Toggles the Template
    4) Runs #2 Again
    5) Deletes the imported PDF and all pages and toggles template again.
    It’s close and much better than the original process which was almost 100% manual but I’d like to remove the Preset prompt from the PDF script and have it automatically select the “Smallest File Size” preset. and then if there’s a way to have it auto-fill in the file name so no user input is required at all other than selecting each file to import. (If there’s a way to setup a batch action for the multi-import script that would be even better!)
    Thanks in advance and if there’s anything else I can provide that would help please let me know! Even a nudge in the right direction will be a big help!

    If you hold down the option key, it will typically show the location. Or you can often hit option-return on the file and it will reveal the file in the Finder, instead of opening it.
    Final option is to open it, and just option-click the filename in the toolbar of Preview and it should show you the location.
    It's probably an attachment to an email you've received. If you have Mail set to cache emails and their attachments it'll be stashed in a subdirectory of ~/Library/Mail. Which is fine.

  • How to create a smallest file size pdf from indesign CS4 document

    How to create a smallest file size pdf (suitable for upload to a website) from indesign CS4 document which contains multiple illustrator CS4 illustrations.
    I have chosen the "smallest file size option" but the pdf file is over 30MB, can anyone help please.
    Thank you

    One trick is to
    Set the placed graphics to have a transparency of 99.9% (you can do this with Find/Change and select Objects)
    This is enough to force the graphics throught the Transparency Flattener
    Next set the Transparency Blend Space to RGB (Edit>Transparency Blend Space)
    Next set a custom Transparency Flattner Preset Edit>Transparency Flattner
    Next
    Use File>Export and choose
    Smallest file size
    PDF Compatibility Acrobat 4 (PDF 1.3)
    In Advanced Section - go to transparency and selec the new Flattener Preset you created.
    *this will convert your vectors to raster, but it should reduce your file size

  • Export to PDF (smallest file size) is giving me a very large file

    Hi all,
    I got 2 document with around 100 pages (same size), with a picture or two in each page.
    I've been using the Export to PDF (smallest file size) and export it.
    first file became 5MB, which is fine
    second file became 30MB, this is much too much.
    I have used the exact same setting for both files and have no idea why the big difference between them.
    The only difference between them is that first file contains CMYK photos, and second one - RGB.
    Can this be the difference?
    Any suggestions?
    thanks,
    shlomit

    That's certainly part of the difference. Additional font information if one of the documents uses more fonts or additional glyphs could be some of it, too. Swatches and styles might also be a factor. Vectors don't compress like bitmaps, either.
    Have you opened the optimizer and done a space usage audit to see what is taking up all the space? Did you do a Save AS before export?

  • When bouncing- what's best method for smallest file size/highest quality?

    I am in the process of embedding 3 mp3's into a PDF to submit as a portfolio. The PDF also has text, and two scores included, and with the 3 embedded mp3's it can't be more than 10mb.
    So my question is: When bouncing a project out of Logic, what is the best method for getting the smallest file size, but retaining the best audio quality? And once it's out of Logic and it is an mp3 or other type of audio file, is there a best format for compressing it further, and still maintaining the relative quality?
    I bounced out the three projects into wav's. Now I am using Switch for Mac to compress them down to smaller Mp3's. I basically need them to be about 3 mb each. Two of the recordings sound OK at that size, but they are just MIDI(one project is piano and string quartet, the other is just piano- all software instruments. The recording that combines MIDI and Audio and has more tracks (three audio tracks and 10 Midi/software instrument tracks)and sounds completely horrible if I get it under 5 mb as an mp3. The problem is that I need all three to equal around 9mb, but still sound good enough to submit as a portfolio for consideration into a Master's program.
    If anyone can help I would really appreciate it. Please be detailed in your response, because I am new to logic and I really need the step by step.
    Thank you...

    MUYconfundido wrote:
    I am in the process of embedding 3 mp3's into a PDF to submit as a portfolio. The PDF also has text, and two scores included, and with the 3 embedded mp3's it can't be more than 10mb.
    So my question is: When bouncing a project out of Logic, what is the best method for getting the smallest file size, but retaining the best audio quality?
    The highest bitrate that falls within your limits. You'll have to calculate how big your MP3's can be, then choose the bitrate that keeps the size within your limit. The formula is simple: bitrate is the number of kilobits per second, so a 46 second stereo file at 96 kbps would be 96 x 46 = 4416 kbits / 8* = 552 kBytes or 0.552 MB. (*8 bits = 1 Byte)
    So if you know the length of your tracks you can calculate what bitrate you need to keep it within 10 MB total.
    I consider 128 kbps the lowest bearable bitrate for popsongs and other modern drumkit based music. Deterioration of sound quality is often directly related to the quality of the initial mix and the type of instruments used in it. Piano(-like) tones tend to sound watery pretty quickly at lower bitrates, as do crash and ride cymbals. But don't take my word for it, try it out.
    And once it's out of Logic and it is an mp3 or other type of audio file, is there a best format for compressing it further, and still maintaining the relative quality?
    You can only ZIP the whole thing after that, but that is just for transport. You'll have to unzip it again to use it. And no, you cannot compress an MP3 any further and still play it.
    I bounced out the three projects into wav's. Now I am using Switch for Mac to compress them down to smaller Mp3's.
    That is silly, you could have done that in Logic, which has one of the best MP3 encoders built in. And how good encoders are will especially come out at bitrates around or below 128, which you might be looking at.
    I basically need them to be about 3 mb each.
    So, one more scrap of info we need here: how long are those three pieces, exactly? I'll calculate the bitrate for you - but please bounce 'm directly out of Logic as MP3's. They will very probably sound better than your WAV-conversions made with Switch.
    !http://farm5.static.flickr.com/4084/4996323899_071398b89a.jpg!
    Two of the recordings sound OK at that size, but they are just MIDI(one project is piano and string quartet, the other is just piano- all software instruments. The recording that combines MIDI and Audio and has more tracks (three audio tracks and 10 Midi/software instrument tracks)and sounds completely horrible if I get it under 5 mb as an mp3. The problem is that I need all three to equal around 9mb, but still sound good enough to submit as a portfolio for consideration into a Master's program.
    Length of the piece? And does the .Wav bounce you have sound OK?

  • Re-Linking EXS Sampler Instruments & Samples

    1 - Curious what you think of this concept:
    I have an external drive that I'd like to be able to move to several computers and use as my samples drive. To keep things consistent, I thought it best to keep BOTH EXS Sampler Instruments & Samples on this drive. Then I can just create aliases of the EXS Sampler Instruments and drop them in the main logic support folder. That way I can easily just move the drive to either computer for the greatest flexibility.
    Is this ok to do? Is there a better way?
    2 - I'd like to re-link many EXS Sampler Instruments to their samples. I used to use the ExsManager Pro.app but that stopped working a while back. Is there another way to have logic do all the re-linking instead?

    revDAVE wrote:
    I have an external drive that I'd like to be able to move to several computers and use as my samples drive. To keep things consistent, I thought it best to keep BOTH EXS Sampler Instruments & Samples on this drive. Then I can just create aliases of the EXS Sampler Instruments and drop them in the main logic support folder. That way I can easily just move the drive to either computer for the greatest flexibility.
    Yes, you can do this.
    2 - I'd like to re-link many EXS Sampler Instruments to their samples. I used to use the ExsManager Pro.app but that stopped working a while back. Is there another way to have logic do all the re-linking instead?
    I highly suggest that you contact Redmatica and get an update to get it working again.

  • Can you change X Pro default settings to save all PDFs using "smallest file size" job option?

    Is there a way to change Acrobat X Pro's default PDF Save settings to use the settings in Distiller's "smallest file size" job options, or adjust Acrobat's default save settings to a close match?

    In Windows you select the printer in the Start>Printers menu and right click to get the properites. You can then go to the settings tab and select the smallest file size job options. When you do it in the printer settings, you have set the default. Be very careful with this choice. It typically reduces the image resolution and embeds no fonts. If you are not distributing the file, then probably not an issue. However, with distribution you risk many folks not being able to read the PDF because of strange characters and low-res image.

  • EXS Sampler getting samples in?

    Ive been chopping live drum audio files saving to desk top then into ESX.
    Is there a better way?

    revDAVE wrote:
    I have an external drive that I'd like to be able to move to several computers and use as my samples drive. To keep things consistent, I thought it best to keep BOTH EXS Sampler Instruments & Samples on this drive. Then I can just create aliases of the EXS Sampler Instruments and drop them in the main logic support folder. That way I can easily just move the drive to either computer for the greatest flexibility.
    Yes, you can do this.
    2 - I'd like to re-link many EXS Sampler Instruments to their samples. I used to use the ExsManager Pro.app but that stopped working a while back. Is there another way to have logic do all the re-linking instead?
    I highly suggest that you contact Redmatica and get an update to get it working again.

  • Smallest File Size not so small

    Hi in CS2 here..
    Exporting a .pdf. The InDesign file has 3 colored rectangles, some text, a few lines at 1pt. & two copied vector logos from Illustrator (no images or tiffs). In Pagemaker the smallest file size was always like 30K or something.... In InDesign I am getting almost 200k. What am I doing wrong?
    Do I have to change something in the export dialog? I made the Bicubic Downsampling to 72, Compression JPEG & Image Quality - Minimum.
    (Also, why do Small File .pdfs print different in color than regular ones from Reader?)
    Thanks.
    Jules

    > two copied vector logos from Illustrator
    Get rid of them, then File > Place to import the Illustrator artwork.
    Minimize your use of transparency.
    You can knock a bit off that by editing the Output section of the export dialogue. Change Profile Inclusion Policy to Don't Include Profiles.
    Try printing to a PostScript file and distilling in Acrobat Distiller.
    > Also, why do Small File .pdfs print different in color than regular ones from Reader
    Define "regular ones".

  • When using the Save Layer Comps to PDF Script, can you change the PDF settings. I need both Smallest File Size and Press Quality?

    When using the Save Layer Comps to PDF Script, can you change the PDF settings. I need both Smallest File Size and Press Quality? Thanks in advance to the group for assisting with this matter.
    — John

    No, there isn't. The way you're using the file is not recommended. You
    should use a review tracker to avoid getting in the way of one another.

  • Export smallest file size best quality

    Hi,
    I need to export a video and get the best quality with the smallest file size preferably under 100 mb. It's a 4 min video that's about 4 GB. Thanks in advance.
    Kerry

    See those links. Ignore Compressor application but all settings are available from FCE quicktime conversion.
    http://www.kenstone.net/fcphomepage/youtube_compressorgary.html
    http://www.kenstone.net/fcphomepage/you_tube_reduxgary.html
    http://www.kenstone.net/fcphomepage/you_tube_hdgary.html
    Michel Boissonneault

  • 16.0.4 update now saves "smallest file size" pdf's the same size as "illustrator default"

    16.0.4 update now saves "smallest file size" pdf's the same size as "illustrator default" ...anyone else?
    I have to save the file, open it in acrobat, then resave using "reduced file size"
    this is since I updated to 16.0.4 yesterday I think....there was some update
    what happened?

    I used default setting each time...now that its updated, I cannot compare it to before the date
    can anyone check these settings?

  • Quality Inspection - Sampling procedure, Sampling scheme & Dyn. Mod. rule

    Hi Experts,
    I am impementing QM process to our group of company. Can you please help me?
    How to link Sampling procedure, Sampling scheme & Dynamic modification rule??
    It is very helpful for me, if you give a brief on this at the earliest.
    reg,
    RPV

    Dear Velu,
    Please go through the following link..........
    http://help.sap.com/erp2005_ehp_04/helpdata/EN/44/fb8928a95e11d2839e0000e829fdb3/frameset.htm
    Regards,
    VB

Maybe you are looking for

  • Problems in r/3

    what are the problems in r/3 system?

  • How do I mark complete based on slide views only and not report a score

    I am having a problem with the e-learning modules that I am producing in Captivate 4 (and previously 3). The modules do not contain any quiz and I am only interested in having them report a complete/incomplete based on if the user have viewed 80% of

  • Color Differences Between Vendors

    I have a CMYK formula of 10-25-60-25 that I use as a background color for a client. I don't "convert" those colors, they are in fact the exact same formula in whatever application is being used. I have printed banners, table covers, posters, flyers,

  • What is the best way to back up Acrobat?

    I was told by a computere specialist that the pieces of Adobe programs are scattered all over the place. I need to learn the best way to backup all of my Adobe applications.  I have an un-numbered version of Acrobat from early 2004 and don't want to

  • "bonjour service" error message when installing-HELP!

    I have tried installing iTunes 7.6 about 5 times in 3 days. Each time I get this message: "Service 'Bonjour Service' (Bonjour Service) failed to start. Verify that you have sufficient privileges to start system services." I am using the administrator