Structure of sampled sound data

Hi,
What is the structure of the byte[] that is gathered from AudioInputStream when reading a wav-file? How do I get the amplitude at one specific moment? How is the sound organized into Stereo?
Regards,
Pingen

Don't have B1 on this machine just now so the following is from memory.  Might not be 100% accurate but should give you a good start:-
To understand the XML schema it is first important to consider the database structure and the existing DI API object structure.  "ONIV" contains the invoice header, associated with this there can be multiple lines "INV1", and also other associated files (eg INV2, INV3 etc).  The XML schema uses this same structuring.
The <BO> element encapsulates the entire invoice object - header and all line details for a single invoice.  I think this stands for "Business Object" and can include anything such as an invoice, order etc.
The first section in the <BO> object is the <AdmInfo> - this tells you what type of "Business Object" it is.  In this case it is type=13 which is an invoice.
As it is type=13, you can then expect to see <OINV>, <INV1>, <INV2> etc elements which will contain the actual data.  If it had been for example type=17, then this would have represented a sales order and you would get <ORDR>, <RDR1>, <RDR2> etc elements instead of the <OINV> ones.
If you had 3 invoices in the file you would see 3 <BO> elements, each of them would have their own <INV1>, <INV2> etc. elements inside them.
The schemas themselves can be generated for reference purposes out of the DI-API itself.  I can't recall the exact method name and I don't have B1 on this machine just now.  If you search in the DI help file for "schema" you probably find it.  Examining the schemas should also help to clarify their structure.
Hope this helps,
John

Similar Messages

  • Display sound data value from ByteArrayOutputStream

    hi People,
    Can advise what is the function that i can use to retrieve or display the data that i stored in ByteArrayoutputStream buffer?
    So far i can only store the data in... but how can i retrieve and display them on output panel?
    Many Thanks

    Hi again,
    I have modify my code and found the error.. But this time i can't display the value correctly. Please advise...
    //This method captures audio input from a microphone and saves it in a ByteArrayOutputStream object.
    private void captureAudio(){
    try{
    //Get and display a list of available mixers.
    Mixer.Info[] mixerInfo = AudioSystem.getMixerInfo();
    System.out.println("Available mixers:");
    for(int cnt = 0; cnt < mixerInfo.length; cnt++){
    System.out.println(mixerInfo[cnt].getName());
    }//end for loop
    //Get everything set up for capture
    audioFormat = getAudioFormat();
    DataLine.Info dataLineInfo = new DataLine.Info(TargetDataLine.class,audioFormat);
    //Select one of the available mixers.
    Mixer mixer = AudioSystem.getMixer(mixerInfo[3]);
    //Get a TargetDataLine on the selected mixer.
    targetDataLine = (TargetDataLine)mixer.getLine(dataLineInfo);
    //Prepare the line for use.
    targetDataLine.open(audioFormat);
    targetDataLine.start();
    //Create a thread to capture the microphone
    // data and start it running. It will run
    // until the Stop button is clicked.
    Thread captureThread = new CaptureThread();
    captureThread.start();
    } catch (Exception e) {
    System.out.println(e);
    System.exit(0);
    }//end catch
    }//end captureAudio method
    public int[] ConvertSoundData (byte[] SoundData, int SampleTotal){
    //Determine the original Endian encoding format
    boolean isBigEndian = audioFormat.isBigEndian();
    //this array is the value of the signal at time i*h
    int x[] = new int[SampleTotal];
    int value;
    //convert each pair of byte values from the byte array to an Endian value
    for (int i = 0; i < SampleTotal*2; i+=2) {
    int b1 = SoundData;
         int b2 = SoundData[i + 1];
         if (b1 < 0) b1 += 0x100;
         if (b2 < 0) b2 += 0x100;
         //Store the data based on the original Endian encoding format
         if (!isBigEndian) value = (b1 << 8) + b2;
         else value = b1 + (b2 << 8);
         x[i/2] = value;
    return x;
    //This method creates and returns an
    // AudioFormat object for a given set of format
    // parameters. If these parameters don't work
    // well for you, try some of the other
    // allowable parameter values, which are shown
    // in comments following the declartions.
    private AudioFormat getAudioFormat(){
    float sampleRate = 8000.0F;
    //8000,11025,16000,22050,44100
    int sampleSizeInBits = 16;
    //8,16
    int channels = 1;
    //1,2
    boolean signed = true;
    //true,false
    boolean bigEndian = false;
    //true,false
    return new AudioFormat(
    sampleRate,
    sampleSizeInBits,
    channels,
    signed,
    bigEndian);
    }//end getAudioFormat
    //=============================================//
    //Inner class to capture data from microphone
    class CaptureThread extends Thread{
    //An arbitrary-size temporary holding buffer
    byte tempBuffer[] = new byte[10000];
    public void run(){
    byteArrayOutputStream = new ByteArrayOutputStream();
    stopCapture = false;
    try{//Loop until stopCapture is set by another thread that services the Stop button.
    while(!stopCapture){
    //Read data from the internal buffer of the data line.
    //targetDataLine.read(byte[] b, int off, int len)
    int cnt = targetDataLine.read(tempBuffer, 0, tempBuffer.length);
    if(cnt > 0){
    float sample_rate = audioFormat.getSampleRate();
    float T = audioFormat.getFrameSize() / audioFormat.getFrameRate();
    int n = (int) (sample_rate * T ) / 2;
    System.out.println(n); ---------> to print the number of sample
    //Save data in output stream object.
    byteArrayOutputStream.write(tempBuffer, 0, cnt);
    int[] SoundData = ConvertSoundData(tempBuffer,n);
    for(int index = 0; index < SoundData.length; index++){
    System.out.println(index + " " + SoundData[index]); ----------> to print the ALL sound data in the returned array.
    }//end if
    }//end while
    byteArrayOutputStream.close();
    }catch (Exception e) {
    System.out.println(e);
    System.exit(0);
    }//end catch
    }//end run
    }//end inner class CaptureThread
    The result i got during i sing "hmmm" to my microphone is as below:
    1
    0 1281
    1
    0 61184
    1
    0 24830
    1
    0 25598
    1
    0 33279
    1
    0 25350
    1
    0 19728
    1
    0 54537
    Below is my question:
    1) Why the number of sample keep on remained as 1? Since the sampling frequency is 8000Hz..
    2) Why my index variable remained as 0? I suppose i will have 8000 values since my sampling rate is 8000Hz... Is it impossible to print 8000 data within 1 sec?
    Is it advisable if i transfer the obtained numeric array directly for FFT analysis?
    (I wish to do a real time frequency analyzer. With MATLAB, I can only do an analyzer by retrieving the .wav data content.)
    I am shame to say i am still not clear enough with the sampling and data retrieve algorithm. Thats why i will have difficulties to delliver correct idea.
    Appreciate if you have any tutorial can share with me so that i can understand more.
    Thank you again.

  • Switching among opened songs VInst plugs every time reload sound data!!!

    Why does this happen? Every time I switch between 2 opened songs I have to wait reloading sound data of plugs with waste of time. Isn't there a workaround to this?
    Thanks

    if they have similar sound samples, then make sure you have keep common samples in memory when switching songs.
    if not, then don't have 2 large songs up at the same time - it's bad for your health anyway. if you need to transfer lots of nitty-griity data between the 2 songs then disable the audio driver. that'll speed up switching. when you're finished re-enable the driver and away you go.

  • Build XML for Custom Nested Accordian (like Tree View Structure) for SharePoint List Data

    Expected output in Xml:
    <?xml version="1.0" encoding="utf-8" ?>
    - <TopRoot>
    - <Root id="1" Name="Department">
    - <Type id="2" Name="IT">
    - <SubType id="3" Name="Technology">
      <SubSubType id="4" Name="Sharepoint" />
      <SubSubType id="5" Name="ASP.NET" />
      <SubSubType id="6" Name="HTML 5" />
      </SubType>
      </Type>
    </Root>
    </TopRoot>
    List Details:
    list details for storing category / sub category data and code to build tree structure for the same.
    1.Create Custom List named “CategoryDetails”:
    2.Create Column “Category Name” of type single line of text. Make it as required field and check Yes for Enforce Unique values.
    3.Create column “Parent Category” of type lookup. under Additional Column Settings.
    Get information dropdown, select “CategoryDetails”.
    4.Choice column ["SRTypeName"] 1.Root,2.SRTYPE,3.SubSRTYPE, 4.SUBSUBSRTYPE
    In this column dropdown, select “Category Name”:  
    Referance:
    http://www.codeproject.com/Tips/627580/Build-Tree-View-Structure-for-SharePoint-List-Data    -fine but don't want tree view just generate xml string
    i just follwed above link it work perferfectly fine for building tree view but i don't want server control.
    Expected Result:
    My ultimate goal is to generate xml string like above format without building tree view.
    I want to generate xml using web service and using xml i could convert into nested Tree View Accordian in html.
    I developed some code but its not working to generate xml /string.
    My modified Code:
    public const string DYNAMIC_CAML_QUERY =
            "<Where><IsNull><FieldRef Name='{0}' /></IsNull></Where>";
            public const string DYNAMIC_CAML_QUERY_GET_CHILD_NODE =
            "<Where><Eq><FieldRef Name='{0}' /><Value Type='LookupMulti'>{1}</Value></Eq></Where>";
            protected void Page_Load(object sender, EventArgs e)
                if (!Page.IsPostBack)
                 string TreeViewStr= BuildTree();
                 Literal1.Text = TreeViewStr;
            StringBuilder sbRoot= new StringBuilder();
            protected string BuildTree()
                SPList TasksList;
                SPQuery objSPQuery;
                StringBuilder Query = new StringBuilder();
                SPListItemCollection objItems;
                string DisplayColumn = string.Empty;
                string Title = string.Empty;
                string[] valueArray = null;
                try
                    using (SPSite site = new SPSite(SPContext.Current.Web.Url))
                        using (SPWeb web = site.OpenWeb())
                            TasksList = SPContext.Current.Web.Lists["Service"];
                            if (TasksList != null)
                                objSPQuery = new SPQuery();
                                Query.Append(String.Format(DYNAMIC_CAML_QUERY, "Parent_x0020_Service_x0020_Id"));
                                objSPQuery.Query = Query.ToString();
                                objItems = TasksList.GetItems(objSPQuery);
                                if (objItems != null && objItems.Count > 0)
                                    foreach (SPListItem objItem in objItems)
                                        DisplayColumn = Convert.ToString(objItem["Title"]);
                                        Title = Convert.ToString(objItem["Title"]);
                                        int rootId=objItem["ID"].ToString();
                                        sbRoot.Append("<Root id="+rootId+"
    Name="+Title+">");
                                        string SRAndSUBSRTpe = CreateTree(Title, valueArray,
    null, DisplayColumn, objItem["ID"].ToString());
                                        sbRoot.Append(SRAndSUBSRTpe);
                                        SRType.Clear();//make SRType Empty
                                        strhtml.Clear();
                                    SRType.Append("</Root>");
                catch (Exception ex)
                    throw ex;
                return SRType.ToString();
             StringBuilder strhtml = new StringBuilder();
            private string CreateTree(string RootNode, string[] valueArray,
          List<SPListItem> objNodeCollection, string DisplayValue, string KeyValue)
                try
                    strhtml.Appends(GetSRType(KeyValue, valueArray, objNodeCollection);
                catch (Exception ex)
                    throw ex;
                return strhtml;
            StringBuilder SRType = new StringBuilder();
            private string GetSRType(string RootNode,
            string[] valueArray, List<SPListItem> objListItemColn)
                SPQuery objSPQuery;
                SPListItemCollection objItems = null;
                List<SPListItem> objNodeListItems = new List<SPListItem>();
                objSPQuery = new SPQuery();
                string objNodeTitle = string.Empty;
                string objLookupColumn = string.Empty;
                StringBuilder Query = new StringBuilder();
                SPList objTaskList;
                SPField spField;
                string objKeyColumn;
                string SrTypeCategory;
                try
                    objTaskList = SPContext.Current.Web.Lists["Service"];
                    objLookupColumn = "Parent_x0020_Service_x0020_Id";//objTreeViewControlField.ParentLookup;
                    Query.Append(String.Format
                    (DYNAMIC_CAML_QUERY_GET_CHILD_NODE, objLookupColumn, RootNode));
                    objSPQuery.Query = Query.ToString();
                    objItems = objTaskList.GetItems(objSPQuery);
                    foreach (SPListItem objItem in objItems)
                        objNodeListItems.Add(objItem);
                    if (objNodeListItems != null && objNodeListItems.Count > 0)
                        foreach (SPListItem objItem in objNodeListItems)
                            RootNode = Convert.ToString(objItem["Title"]);
                            objKeyColumn = Convert.ToString(objItem["ID"]);
                            objNodeTitle = Convert.ToString(objItem["Title"]);
                            SrTypeCategory= Convert.ToString(objItem["SRTypeName"]);
                           if(SrTypeCategory =="SRtYpe")
                              SRType.Append("<Type  id="+objKeyColumn+" Name="+RootNode+ ">");
                             if (!String.IsNullOrEmpty(objNodeTitle))
                              SRType.Append(GetSRType(objKeyColumn, valueArray, objListItemColn));
                          if(SrTypeCategory =="SRSubTYpe")
                              SRType.Append("<SRSubType  id="+objKeyColumn+" Name="+RootNode+
    ">");  
                             if (!String.IsNullOrEmpty(objNodeTitle))
                              SRType.Append(GetSRType(objKeyColumn, valueArray, objListItemColn));
                          if(SrTypeCategory =="SubSubTYpe")
                              SRType.Append("<SubSubType  id="+objKeyColumn+" Name="+RootNode +"
    ></SubSubType");  
                        SRType.Append("</SubType>");
                        SRType.Append("</Type>");
                catch (Exception ex)
                    throw ex;
                return SRType.ToString();
                // Call method again (recursion) to get the child items

    Hi,
    According to your post, my understanding is that you want to custom action for context menu in "Site Content and Structure" in SharePoint 2010.
    In "SiteManager.aspx", SharePoint use MenuItemTemplate class which represent a control that creates an item in a drop-down menu.
    For example, to create or delete the ECB menu for a list item in
    "Site Content and Structure", we can follow the steps below:
    To add the “My Like” menu, we can add the code below:      
    <SharePoint:MenuItemTemplate
    UseShortId=false
    id="OLListItemLike"
    runat="server"
    Text="My Like"
    ImageUrl="/_layouts/images/DelItem.gif"
    ClientOnClickNavigateUrl="https://www.google.com.hk/"
    />
    To remove the “Delete” menu, we can comment the code below:
    <SharePoint:MenuItemTemplate
    UseShortId=false
    id="OLListItemDelete"
    runat="server"
    Text="<%$Resources:cms,SmtDelete%>"
    ImageUrl="/_layouts/images/DelItem.gif"
    ClientOnClickScript="%SmtObjectDeleteScript%"
    />            
    The result is as below:
    More information:
    MenuItemTemplate Class (Microsoft.SharePoint.WebControls)
    MenuItemTemplate.ClientOnClickScript property (Microsoft.SharePoint.WebControls)
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • Differrences between structure and table in data dictionary in ABAP?

    What is the differrences between structure and table in data dictionary in ABAP?
    are they same?

    Tables :
    1. The place where the data is stored so that you can retrieve at any time.
    2. There can be more than one record stored
    Structures :
    1. The data / info stays only during the runtime of the application and will not get stored at all during the run time ....
    2. Only one record can be stored at the runtime .....
    A structure forms the skeleton of the table.
    A structure comprises components i.e., fields. Types are defined for the components A component can refer to an elementary type (via a data element or by directly specifying the data type and length in the structure definition), another structure or a table type. A structure can therefore be nested to any depth
    Tables can be defined independently of the database in the ABAP Dictionary. The fields of the table are defined with their (database-independent) data types and lengths.
    When the table is activated, a physical table definition is created in the database for the table definition stored in the ABAP Dictionary. The table definition is translated from the ABAP Dictionary to a definition of the particular database.

  • Problem with content: 7 - Bad sound Data

    When I do the following...
    Voice = new Sound();
    Voice.loadSound("test.mp3", true)
    I get the error...
    Problem with content: 7 - Bad sound Data
    AND
    Problem with content: 7 - The sound data format is not
    recognized.
    I am using the test.mp3 files that comes with Flash8.
    Thanks!
    Bob

    OK. This combo works!
    version flash Player 8
    action script 2.0
    Audio Stream: MP3, 128 kbps, Stereo best
    Audio event: MP3, 128 kbps, Stereo best
    Override sound settings (unchecked)
    But this combo does not!!
    version flash lite 2.0
    action script 2.0
    Audio Stream: MP3, 128 kbps, Stereo best
    Audio event: MP3, 128 kbps, Stereo best
    Override sound settings (unchecked)
    Still get the error on all Nokias except Nokia 90 which gets
    no error but just does not play the file

  • I need a sample excel data for practicing Dashboards

    Hi Experts ,
                        I am new to SAP  BO  Dashboards. i need sample excel data for practicing and designing a dash boards . kindly help me to get sample excel files from any where .Please suggest me where i can get sample excel files.
    Regards
    Abhi

    Hi,
    open the samples in the dashboard which come with source data as excel.or search on google you will get the dashboard files with sample excel data.or try to create own sample data and use in dashboard for learning.
    Amit

  • I need some sample customer data

    Hi all,
    I need some sample customer data along with order details (for any product) for a mining application. Can anyone help me in this regard....
    thanks,
    swathi.

    Hi all,
    I need some sample customer data along with order details (for any product) for a mining application. Can anyone help me in this regard....
    thanks,
    swathi.

  • Creating Sample XML data to view Reports

    Hi All,
    I have the following:
    RTF Report Templates
    XML definition files - i.e. format
    <parameters> parameter names = .... </parameters>
    <dataQuery> Sql statement in here </dataQuery>
    <dataStructure> element names... </dataStructure>
    and translated xliff files for each reports.
    What I want is to review each report to see what it looks like translated but to do this I need some sample xml data to populate the report (I dont have access to a live build).
    Can anyone tell how I can create the sample xml data so I can review these reports. I have installed the BIP Reports server but have not been able to find a way of completing this.
    Many thanks in advance for your help.

    Hello David
    I refered your other posts on xsl fo style sheets for Purchase Orders.
    Sorry for intervening you here..
    I need some help in getting xml tags for PO releases.
    When I refer metalink they gave me the following for Std PO.
    Create a new Standard Purchase Order and DO NOT approve it. Let it be in Incomplete status. Go to
    concurrent requests and run the 'PO Output for Communication' concurrent
    program will the following parameters:
    Print Selection: All
    Purchase Order Number From: The PO # you just created
    To: The PO # you just created
    Test: Debug
    May I know for PO releases what are additional parameters.I tried to enter release numbers in addition to the above.Bit it did not work,..
    I am having issue in getting buyer contact phone for PO releases.So I am trying to see if the work_tele_phone is available for Po releases xml tags.
    Can you please advise
    prasanna

  • Structure of the sender Data Type

    hi;
    i have two tables and want to fetch data from both in one go using sender JDBC adapter.
    Can any one tell me the structure of the sender Data Type
    if Table1 has A1,A2,A3 as fields and Table2 has B1,B2,B3 as fields.
    i want to fetch only A1,A2 fields from Table1 and B1,B3 fields from Table2.

    Hi,
    Just use Select statement in the Sender JDBC adapter , and your structure should have simple structure with required number of fields.
    configuring jdbc adapter with multiple tables
    Regards,
    Moorthy

  • HT201808 "...nor may they be repackaged in whole or in part as audio samples, sound effects or music beds." So does this mean I can't make a song with just remixed loops and publish it on SoundCloud for example?

    If I've made a song with remixed loops, can I post it on SoundCloud to share with facebook friends and stuff? Regarding this statement from the software license agreement: "...however, individual audio loops may not be commercially or otherwise distributed on a standalone basis, nor may they be repackaged in whole or in part as audio samples, sound effects or music beds."

    momomikes,
    Would you mind continue reading the document you quoted?
    Read the last sentence, please. It goes:
    ”So don't worry, you can make commercial music with GarageBand, you just can't distribute the loops as loops.“
    https://support.apple.com/en-us/HT201808
    P

  • I need sample basic data file containing Product,Market,Measures etc

    I need sample basic data file containing Product,Market,Measures etc to load data in to Sample Basic applications. Where can I get this?

    As I am the World Domain Lead for Sample.Basic (this is a joke, btw, it's sort of like being King of my front stoop, and besides, I just made it up) I will note two things about CALCDAT.TXT.
    1) It is not in columnar format, but instead in Essbase free-form data load format as user2571802 notes. This means if you take a look at it with a text editor, it's a bit confusing to read till you realize that it contains all dimensional information in the data file itself. See the DBAG's section on [Data Sources That Do Not Need A Rules File|http://download.oracle.com/docs/cd/E10530_01/doc/epm.931/html_esb_dbag/ddlintro.htm#ddlintro1029529].
    2) CALCDAT.TXT contains level 0 and calculated results. Just load it -- there's no need to calculate it.
    Regards,
    Cameron Lackpour

  • "Sound" Data Help

    1. How to get the data points out of the waveform type sound file?
    2. How to highlight the sound data on a waveform graph in real time as the sound file is playing?
    Thank you.

    PS_N,
    You can use the standard sound VI's that come with LabVIEW to read a .WAV file and plot the data on a Waveform graph. Please look at the attached example for your reference. You can find the VI's at Graphics and Sound » Sound. As far as highlighting the plotting on in real-time, I am using a property node to set the color of the graph to yellow.
    The example finder in LabVIEW is also a great resource for getting started with new applications. You can find the example finder by clicking Find Examples... on the Help menu.
    Eli S.
    National Instruments
    Applications Engineer
    Attachments:
    example1.vi ‏19 KB

  • Collecting samples of data for analysis

    I’m afraid I am quite new to labview so excuse the simple line of questioning. I am receiving values from a plc and I am looking to collect two different samples of data for analysis:
    I would like to collect 40 values and once collected, rotate the sample so the oldest value is replaced by the new one, but maintaining an array of 40 values. This is to calculate the rolling average of the latest 40 values for the duration of the while loop.
    Secondly, I would like calculate the average of all values collected for the duration of the while loop. This means the sample will keep growing for the duration of the while loop and I will need an array of increasing size to be analysed.
    I know the array functions can do this, however I am unable to figure out how. Any assistance or examples to help achieve this would be greatly appreciated.
    Best regards,
    Stuart Wilson

    Here is a quick (and dirty) way. I know that there are more elegant ways, can't look at them at the moment, but this may give you ideas.
    P.M.
    LabVIEW 7.0
    Putnam
    Certified LabVIEW Developer
    Senior Test Engineer
    Currently using LV 6.1-LabVIEW 2012, RT8.5
    LabVIEW Champion
    Attachments:
    rotate values.vi ‏31 KB

  • Sampled sounds/Aiff/Wav

    Is it possible to have a sampled sound, and trigger it? I'm thinking if I can put the samples in the EXS24, or somewhere else, but I don't know where to import the sample into. For example: lets say I have a samples guitar that's one hit in the key of C, but I wanna continue to a 1, 4, 5 progression, and trigger it with my keyboard. Just asking what device in logic, can I trigger it from?

    You may receive more focused attention to your issue if you post this question in either the Logic Pro forum or the Logic Express forum.
    Good luck!

Maybe you are looking for