Measuring audio parameters on data streamed via UDP

Hello,
I have the task of trying to measure some audio
parameters from multiple wave files that has been streamed over a
network using UDP.
I can capture the individual streams at the
UDP ports, but when I try to make a measurement on the data the
frequency not correct and I am having trouble scaling the data
vertically.
The data streams are different sampling rates and depths, 8Ks/S@16bit, 16Ks/S@16bit, 44.1Ks/S@24bit.
The data stream at the higher rate (44.1K) is closer to the expected value but still not correct.
I beleive I need to scale the data but cannot figure out how to parse it after I do a UDP read.
Any help is appreciated.
 Michael

Hello All,
Thanks for the responce(s).
Unfortunatley I am stuck with the UDP format. Our product will not be connected to the"Net" so we are not very concerned with loosning any information. We just need to get it out of the box and to our test equipment.
I have reviewed all of my code and stimulas. Seems that the audio streaming utility I have been using (VLC) would automatically generate streams at 44.1Ks/S. There is a small, criptic setting that by default is turned off to be able to keep the original sample rate of the audio stream. By enabling this setting I am able to make some accurate SINAD, Freq, and THD+N measurements without the Sound and Vibration toolkit. I am now working on getting the vertical scaling correct so I can make a valid amplitude measurement.
The only thing I can see that the S&V toolkit would gives is some tailored graph and charting frequently used in the S&V business. It does nothing for capturing streams of audio and being able to easily decode the header information that is in a .wav file. This for me is pretty important.
Here is sample of my code. It is very crude and I am very new to LV. I have been a VB guy for the last 10 years. Istruggle alot with these icons and wires. It is very hard to follow the logic behind the samples when there are no comments to guide you.
Regards,
Michael Mayers
Test Engineering
Attachments:
UDP_Receive_w_Measurement.vi ‏27 KB

Similar Messages

  • Transferring primitive data types via UDP other than a String

    Hi ALL,
    I am new to Socket programming in UDP.
    I need to implement a FTP client-server application.
    Now the packet that I need to transfer using UDP as a DatagramPacket consists of multiple primitive data types, (3short types and 1 byte array of size 265.)
    How do I do that?
    All the samples and examples I managed to find on the Internet illustrated the problem of transferring a String type converted to getBytes and the byteArray is transferred.
    However, in my case i need to pass this structure..(3fields) to the other side. If I convert the 4 fields to a single concatenated string there's this problem of finding out where each of the four fields begin and where do they end.
    Please suggest and help...
    thanks..
    : )

    Just create a class that represents your structure and convert-it to a byte array that can be sended over a DatagramSocket.
    Try this sample code :
    import java.io.*;
    import java.net.*;
    public class DP
        /** Creates a new instance of DP */
        public DP ()
         * @param args the command line arguments
        public static void main (String[] args)
            try
                System.out.println ("Starting server ...");
                DatagramServerThread server = new DatagramServerThread ("Datagram server");
                server.start ();
                System.out.println ("Creating your object ...");
                ByteArrayOutputStream baos = new ByteArrayOutputStream (); // Creating byte array output stream ..
                ObjectOutputStream oos = new ObjectOutputStream (baos);// Creating a object output stream that writes to byte array output stream..
                YourStructure newObject = new YourStructure (); // creating your data structure..
                newObject.setShortField1 ((short)12);// setting values ...
                newObject.setShortField2 ((short)45);
                newObject.setShortField3 ((short)4);
                newObject.setArray (new byte [256]);
                oos.writeObject (newObject); // write your structure to object output stream...
                byte data_to_be_sent[] = baos.toByteArray (); // retrieving equivalent byte array...
                // send data...
                DatagramSocket s = new DatagramSocket ();
                System.out.println ("Sending ...");
                DatagramPacket packet = new DatagramPacket (data_to_be_sent, data_to_be_sent.length);
                packet.setAddress (InetAddress.getByName ("localhost"));
                packet.setPort (8888);
                s.send (packet);
            catch (Exception e)
                e.printStackTrace ();
    class YourStructure implements Serializable
         * Holds value of property shortField1.
        private short shortField1;
         * Holds value of property shortField2.
        private short shortField2;
         * Holds value of property shortField3.
        private short shortField3;
         * Holds value of property array.
        private byte[] array;
         * Getter for property shortField1.
         * @return Value of property shortField1.
        public short getShortField1 ()
            return this.shortField1;
         * Setter for property shortField1.
         * @param shortField1 New value of property shortField1.
        public void setShortField1 (short shortField1)
            this.shortField1 = shortField1;
         * Getter for property shortField2.
         * @return Value of property shortField2.
        public short getShortField2 ()
            return this.shortField2;
         * Setter for property shortField2.
         * @param shortField2 New value of property shortField2.
        public void setShortField2 (short shortField2)
            this.shortField2 = shortField2;
         * Getter for property shortField3.
         * @return Value of property shortField3.
        public short getShortField3 ()
            return this.shortField3;
         * Setter for property shortField3.
         * @param shortField3 New value of property shortField3.
        public void setShortField3 (short shortField3)
            this.shortField3 = shortField3;
         * Getter for property array.
         * @return Value of property array.
        public byte[] getArray ()
            return this.array;
         * Setter for property array.
         * @param array New value of property array.
        public void setArray (byte[] array)
            this.array = array;
        public String toString ()
            StringBuffer buffer = new StringBuffer ();
            buffer.append ("Short field 1 is ");
            buffer.append(this.getShortField1 ());
            buffer.append ("\nShort field 2 is ");
            buffer.append (this.getShortField2 ());
            buffer.append ("\nShort field 3 is ");
            buffer.append (this.getShortField3 ());
            buffer.append ("\nYour array field is ");
            for (int index = 0; index < this.getArray ().length; index++)
                buffer.append ("Index [" + index + "] = " + this.getArray () [index] + "\n");
            return buffer.toString ();
    class DatagramServerThread extends Thread
        protected DatagramSocket socket = null;
        public DatagramServerThread (String name) throws IOException
            super (name);
            socket = new DatagramSocket (8888);
        public void run ()
            try
                byte buffer [] = new byte [socket.getReceiveBufferSize ()];
                DatagramPacket packet = new DatagramPacket(buffer, buffer.length);
                System.out.println ("Server is ready. Waiting for packet ...");
                socket.receive(packet); // waiting for packet ...
                System.out.println ("Packet received! : ");
                byte received_data[] = packet.getData ();
                ByteArrayInputStream bais = new ByteArrayInputStream (received_data); // Creating byte array input stream ..
                ObjectInputStream ois = new ObjectInputStream (bais); // Creting Object input stream
                Object readed_object = ois.readObject ();
                YourStructure your_original_object = (YourStructure)readed_object;
                System.out.println (your_original_object.toString ());
                System.out.println ("Exiting server thread. Bye");
                socket.close ();
            catch (Exception e)
                System.err.println ("Server error");
                e.printStackTrace ();
    }

  • How do you separate UDP data streams

    Hi.  I'm currently using LabVIEW 2013  to read in a UDP data stream (packet) that contains various parameters.  I am successful in receiving the UDP packet using the UDP Open and UDP Read vi.  On the data out of the UDP Read I have it running into the "Unflatten to String" function and the type I have created a cluster containing 32-bit floating point (Single Precision in LabVIEW) numeric constant, since that is the type of data I am receiving.  To be able to separate the different parameters coming in, I have created the same number of numeric constants blocks to equal the number of parameters.  Is there an easier way to separate the data from the UDP data out so that I don't have to create so many numeric constants to represent the same number of data I have coming in?  Sometimes we will way more than what is listed below.
    Any help will be appreciated.  Thank you in advanced
    Attachments:
    Example layout (Not actual).vi ‏11 KB

    If all the data is the same type, then you can wire an array as the datatype instead of a cluster. Set the "data includes array or string size" input to False (the default is True). The output will be an array, and you can index out the values you want.

  • The incoming tabular data stream (TDS) remote procedure call (RPC) protocol stream is incorrect. Too many parameters were provided in this RPC request. The maximum is 2100

    Hello,
    I am getting a new message this morning creating a view:
    The incoming tabular data stream (TDS) remote procedure call (RPC) protocol stream is incorrect. Too many parameters were provided in this RPC request. The maximum is 2100
    Any ideas on this?
    Thanks,
    DOm
    System Center Operations Manager 2007 / System Center Configuration Manager 2007 R2 / Forefront Client Security / Forefront Identity Manager

    Hi,
    Based on my research, this is a limitation of sql server.
    http://msdn.microsoft.com/en-us/library/ms143432.aspx
    And please refer to the below article to find a fix for this issue:
    How to fix SQL error: "Too many parameters were provided in this RPC request"
    http://blogs.msdn.com/b/emeadaxsupport/archive/2009/09/01/how-to-fix-sql-error-too-many-parameters-were-provided-in-this-rpc-request.aspx
    Regards,
    Yan Li
    Regards, Yan Li

  • App for streaming the audio output of the Mac via blouetooth to iphone

    HI,
    Looking for an app that streams the audio output of the Mac via blouetooth to iphone.
    Thx

    Please pardon the intrusion…
    Hi, roaminggnome!
    Congratulations on advancing to Level 4!
    At the Water Cooler in the Level 4 Lounge, we are throwing virtual confetti in celebration of your attainment of Level 4-dom. Would you care to join us at the Water Cooler?
    On the Discussions Home Page, down at the bottom, you will, hopefully, soon find the Lounge link available to you.
    Hope to see you there soon!

  • BCS - Schedule data stream to execute daily

    Hi everyone, 
    I have created 2 data streams to sync 2 master data loads into BCS from our BW system. 
    Currently, I am manually executing the data streams by going through the menu within t-code "UCWB", and right clicking on each one to select execute.
    Does anyone know of a way I could add these manual executes into a schedule which runs daily?
    Thank you for your help.
    Ryan.

    There may be a way to schedule the load-from-datasteam process for master data, but I am not aware of any.
    However, there are the programs UGMDSYNC for master data, and UGMDSY20 for master data hierarchies. It may be possible to execute these with the parameters needed via the schedule manager. If this works, it is suggested that tha master data always be scheduled prior to the hierarchies.

  • Video streaming over UDP

    Hi,
    Does anyone know how to stream a video file, that includes an audio and video codec(from any kind), to a remote client using UDP/RTP ?
    I don't really know how to synch the audio/video over RTP.
    I know this is a hard one, but I'm searching for a guru that knows how do it.
    Thanks,
    em.

    First off, I don't recall if Java has an API or any access at all to QoS mapping.
    UDP is not reliable, so unless you have some sort of packet integrity protocol on your app, then TCP is a much better way to go.
    When you say Codec, are you transporting the codec along with the stream or is that something your client has - or download seperately - as a codec (and you don't need the encoder part to playback on the client) is something extra to the app.
    If you are multicasting a single file such as AVI, WMV, etc. then just transport the file.
    If you are moving seperate streams for the audio, video, and data. Then create three sockets, and create a sync header in the data payload of each, and then the client will recombine the streams' packets to match each sync header.

  • IPhone 4s no longer streams via USB in 2010 Honda

    Previously with my iphone 4, I could connect to the USB port in my 2010 Honda Civic and also to the Auxiliary jack via a retractable auxiliary cable.  The phone was positioned at dash height and I could stream music over the 6 car speaksers from Pandora, AOL radio, Public Radio apps, and others while at the same time running the GPS program.  The music would dim whent the GSP would make an announcement or when I received an incoming call and life was good.
    Yesterday I noticed with my new iphone 4S, that when I plugged into the USB jack and auxiliary jacks, these audio apps would NOT stream.  The music would play for a second or so and then stop.  iTunes radio worked fine, but with the other apps - nothing.  I stopped the GSP app, I rebooted the phone, I checked the connections - all without success.  Then, only when I got home, and I unplugged the 4s from the USB jack, did the music stream again.
    I'm wondering if this has something to do with the USB wiring in the Honda (where hitting the aux. button switches between playing and displaying the ipod music and the auxiliary jack)?  I'm considering buying a USB charger via the cigarette lighter to charge the telephone instead of using the built in charger.  At home all the apps stream fine when connected to the computer's USB or the USB charger. Are there any other solutions or suggestions to be able to stream music via the built in USB charger?  I don't know what is at fault - the 4S, iOS 5.01 or the Honda USB cable connection?  Thank you.

    maybe try cleaning out the port at the bottom of your iphone by blowing it out with compressed air or maybe by using a soft brush. or maybe gently with a toothpick. but nothing metal. perhaps there's dirt or dust in there that's preventing a connection. similarly make sure the connectors on your docks and cables are clean.

  • Need help in Seding sound stream on UDP, please give me some advice!

    I'm a newbie in this. I try to do VoIP on mobile, and I did finish Register, Invite and Record voice in to output stream. But I don't know where to go next.
    I knew that most cell phone doesn't support RTSP, so it I must do it in UDP instead. But how? How to put Output Stream in UDP, and how to get it back?
    And I don't know how to put those things together.
    Please please, help me.
    Tanan
    from Thailand
    p = Manager.createPlayer("capture://audio?encoding=pcm&rate=8000&bits=16");
    p.realize();
    // Get the RecordControl, set the record stream,
    rc = (RecordControl)p.getControl("RecordControl");
    output = new ByteArrayOutputStream();
    rc.setRecordStream(output);
    rc.startRecord();
    p.start();

    Welcome to Discussions, ddalki_kiss!
    Most important thing first. You didn't list the "Boot ROM Version," which is after the Bus Speed in System Profiler. I ask due to the fact that, according to this Apple Support article:
    Firmware updates for Intel-based Macs
    your MacBook probably required the installation of this firmware update:
    MacBook EFI Firmware Update 1.1
    It isn't a question of whether or not that update was downloaded, but whether it was installed. Checking how System Profiler shows the "Boot ROM Version" is one way to find out if it was successfully installed. If it was not, download and install it, being careful to follow instructions and cautions.
    It is also getting very hot to the touch...
    First, the firmware update might help. Second, it is getting very hot due to the fans not being able to keep it cool enough despite running at higher speed. Can we assume that you are not using the MacBook as a laptop, but are following the cautions that it is a notebook and must have air circulation beneath it?
    ...sometimes when I push the power button to turn it on, all I see is a blank white/grey screen and nothing happens...
    You should boot into safe mode:
    http://docs.info.apple.com/article.html?artnum=107392
    http://docs.info.apple.com/article.html?artnum=107393
    http://docs.info.apple.com/article.html?artnum=107394
    Booting into safe mode could be remedial for your MacBook. You should then restart your MacBook to return to normal use, as you will be unable to remain in safe mode and have normal use of your Mac.
    If you have further problems, or if you resolve the current ones, please repost:)
    Message was edited by: myhighway

  • How does one send a file via UDP?

    I need to send a binary file via UDP. The file has 99 32-bit binary words of data. How do I input the data to the UDP write command? I don't want to send the data sequentially..I would like to send all 99 words in a single UDP transmission. TIA.
    -jlivermore

    Something to be careful of is that while UDP is fast, it is not secure. You can lose packets and there is no way for the sender or receiver to know it was lost. Because UDP doesn't have a "connection" like TCP does, the sender doesn't know if the data is going anywhere and the receivers have no way of knowing if anything is being sent.
    Picture a radio station. A guy working the night shift hopes there is someone somewhere listening to his broadcast, but he doesn't know. Likewise, if you turn on a radio and hear nothing but static, you may be listening to a frequency where there are no stations broadcasting, or the station transmitter might be off the air, or there might be interference keeping you from hearing the signal, but again you don't know which.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Outputing Raw Stream via airport express

    What is the output of the airport express optical port? Is a raw stream of the original audio file?  thx

    For the AirPort Express (AX), audio input is primarily provided by iTunes. Of course, it can also get input from other sources like Rogue Amoeba's Airfoil.
    iTunes does most of the work. When iTunes plays back standard audio content (AAC, MP3, audiobooks, Internet music streams, etc., it decompresses those file formats and creates what's essentially a raw, uncompressed audio stream. That stream is compressed using Apple's Lossless Compression (via a QuickTime codec), encrypted, and then, streamed (via AirTunes/AirPlay) to the AX. The AX decrypts the stream, decodes it, and outputs it in either analog format or as a digital PCM stream.
    If iTunes is playing back a digital multichannel file format like AC3 (Dolby Digital) or DTS, those bitstreams (like the lossy formats) are wrapped in Apple's Lossless compression, encrypted, and then, streamed to the AX. In these cases, the AX would first decode the stream, and then, output the raw AC3 or DTS stream via its optical digital audio port.

  • How to synchronize audio and video rtp-streams

    Hi everyone!
    I've tried to make one of the processors, processor1, control the other processor, processor2, with processor1.addController(processor2) but I get a
    javax.media.IncompatibleTimeBaseException. I need to synchronize audio and video rtp-streams because they are sometimes completely out of sync.
    In JMF API Guide I've read:
    "2. Determine which Player object's time base is going to be used to drive
    the other Player objects and set the time base for the synchronized
    Player objects. Not all Player objects can assume a new time base.
    For example, if one of the Player objects you want to synchronize has
    a *push-data-source*, that Player object's time base must be used to
    drive the other Player objects."
    I'm using a custom AVReceive3 to receive rtp-streams and then I create processors for the incoming stream's datasource's, and they are ALL PushBufferDataSource's.
    Does this mean I can't synchronize these. If so is there any way I can change them into Pull...DataSources ?
    How are you supposed to sync audio and video if not with as above ?

    camelstrike wrote:
    Hi everyone!
    I've tried to make one of the processors, processor1, control the other processor, processor2, with processor1.addController(processor2) but I get a
    javax.media.IncompatibleTimeBaseException. I need to synchronize audio and video rtp-streams because they are sometimes completely out of sync.
    In JMF API Guide I've read:
    "2. Determine which Player object's time base is going to be used to drive
    the other Player objects and set the time base for the synchronized
    Player objects. Not all Player objects can assume a new time base.
    For example, if one of the Player objects you want to synchronize has
    a *push-data-source*, that Player object's time base must be used to
    drive the other Player objects."
    I'm using a custom AVReceive3 to receive rtp-streams and then I create processors for the incoming stream's datasource's, and they are ALL PushBufferDataSource's.
    Does this mean I can't synchronize these. If so is there any way I can change them into Pull...DataSources ?The RTP packets are timestamped when they leave, and they are played in order. You can't change the timebase on an RTP stream because, for all intensive purposes, it's "live" data. It plays at the speed the transmitting RTP server wants it to play, and it never gets behind because it drops out of order and old data packets.
    If your RTP streams aren't synced correctly on the receiving end, it means they aren't being synced on the transmitting end...so you should look into the other side of the equation.

  • Flash 11.3 - Data Stream Playback Skipping

    Hi.
    I have a tool which is designed to playback interactive audio/text sessions.  For example, I record a data stream, sending events which contain the text that was typed into a chat window, so the messages can be replayed exactly how they originally occured.
    I have problems with the playback when deploying the swf to a browser, vs running locally from my Flash Pro CS 5.5 software.  I'm just trying to play the flv, waiting for the text events so I can display the recorded chat text.
    A simple example of a "skipping" problem in the data stream:
    1) A 30 second recording is made of text sent into a chat window.
    2) Lets say 5 events are sent to the recorded stream, at time values of 6 seconds, 10 seconds, 12, 14, and 22.  I.e. those are the time values of the stream when the text messages were sent.
    3) Playback with Flash Pro is exactly what I would expect.  After calling "Play()", I recieve the messages at the correct times.  For example, the first text message event is recieved from the stream 6 seconds after playing it.
    The Problem:  When deployed to the broweser, the stream playback seems to automatically "skip" to the first event.  I.e., there is no 6 second delay between the time the stream is started to the time the first event is recieved.  After that, there is the correct time between events (i.e. 4 seconds later the "10 second" event occurs, then 2 seconds later the "12 second" event occurs, on and on...).
    The data must be synched up with an audio stream in some cases.  This becomes a problem in certain cases, as the "dead space" at the beginning and end of the data stream is seemingly ignored.  The data stream is completely separate from audio (not mixed), and it passes the flvCheck (i.e. no errors about timestamps).
    This is all done from Action Script 2.  I use a timer to monitor the timestamp on the stream.  It becomes clear that the swf, when deployed in a browser, simply jum[s to the the timestamp of the first event.  When deployed locally, it is clear the steam properly plays the deadspace at the beginning, before sending the recorded event 6 seconds in.
    I can workaround the problem by creating a timer on the client side and always send an "init" event one second after I want to start recording.  I could get my recordings to work using this dummy event, but it causes addition problems/confusion and I wonder what the problem really is here.

    I do not know what is causing Flash Player not to work for non-admin users, but I have seen it getting to work in the past by using the following procedures
    do a clean uninstall of Flash Player, as described in http://forums.adobe.com/thread/928315 - do not reinstall yet
    resolve any permission problems using this procedure http://forums.adobe.com/thread/987370
    download and run the offline installers from http://helpx.adobe.com/content/help/en/flash-player/kb/installation-problems-flash-player- windows.html#main-pars_header
    Hope this fixes your issue.

  • Sending character array (as a bytebuffer) via udp

    Hi,
    I do have to send a udp packet, containing several variables, and the reciever awaits it as a character array ... (C++, cannot change this part!)
    As far as I see it, I can only send ByteBuffers via DatagramPackets via udp.
    Has anyone a clue how I can convert a ByteBuffer into another Bytebuffer in a way so that the udp reciever gets it as if I had sent a character array instead ?!?
    Or is there actually a character array udp sender ?!?
    Any help is highly appreciated, big Thanx in advance,
    ~Carmela

    In C++, char' are unsigned bytes. Thus converting between bytes and chars is fairly straight forward. Java treats char as unsigned short (16-bit) so it converts chars to bytes as UTF-8. (By default) Unless you are using special on ascii characters i.e. 128+ all this makes no difference whatsoever.
    A bytebuffer is just a container for bytes. You can encode anything as bytes so there is no magic here. Just get the data as bytes and put it into a ByteBuffer.
    String string = "text";
    ByteBuffer bb = ByteBuffer.wrap(string.getBytes());

  • Transmitting a byte command via UDP

    I hope you'll forgive the newbie question, but my education is in aerospace engineering and not computer science...
    I have a verified specification document which tells me that in order to command a data source to begin transmitting data, I need to send it the following command via UDP:
    1 byte        1 byte               2 bytes                              n bytes
    COMMAND
    01
    00
    Command Code =
    8016
    Data  
    Where the data field is ignored for this command.
    My best understanding of this situation would be to use the Byte Array to String function on an array of U8s which looks like this:
    where the network order is big endian.  However, I have some functioning, inherited code which interfaces with the same data source and issues a start data command using an array which looks like this:
    In classic style, the author of this code has retired and I'm the only other LabVIEW programmer.  I'm not savvy enough to tell whether this array accomplishes the same task and it's my limited understanding of bytes which is causing the confustion or if this command is combined with another command or what.
    Any insight, leading questions, or valuable commentary is appreciated.
    Solved!
    Go to Solution.

    I think I'm starting to understand how bits, bytes, and such behave with LabVIEW.  Kind of confusing without a solid background in computing...
    According to the documentation-when using the startup command--there is no data payload required; it is ignored by the data source.  My only guess for those elements remaining after the 4th element are that they are simply placeholders so that the data source know this is a completed command or that the original programmer copied the array from one of the other commands (which required the data payload) and those are just residual values he knew were ignored and never bothered to delete.  It would be in keeping with the just-get-it-done approach this programmer favored.
    Thanks for the assistance.  I think I can interpret the other commands for this data source now.
    Cheers.

Maybe you are looking for