LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I transfer a sound file via TCP?

Can you get a sound file that wasn't encoded with a variable bit rate?  That could be a simpler way to test the problem rather than make changes to your code.
Mark
NI App Software R&D
0 Kudos
Message 31 of 35
(1,098 Views)
That's exactly what I thought and I just went through all of my music files, grabbed a few, converted them to wav's, and tested them out.  The ones that were encoded using a CBR worked just fine.  One of the odd things though that I'm noticing is that when I play the sound file I output it to a waveform graph and I can see two channels, one in white and one in red.  But when I transfer the data over, I only have the one channel that shows on the graph but the default setting for the sound format calls for two.  How did I lose a channel in the transfer?
0 Kudos
Message 32 of 35
(1,069 Views)
Is a single channel being transfered or are the two channels being flattened to one channel?
Mark
NI App Software R&D
0 Kudos
Message 33 of 35
(1,063 Views)
The output format from the read sound file.vi is an array of double waveform so using the index waveform array, I grab the first array and send over the components (dt, Y, t0).  This is where I'm losing that channel right?  If I were to take the second index from the waveform array i'd get the second channel right?  But this doesn't solve the problem of why the music on the client side skips does it?  Or if I sent over both channels would this solve the issue?
0 Kudos
Message 34 of 35
(1,057 Views)
Using index array to pick off and send the second channel should allow you to reconstruct stereo sound at the client.  I do not believe this will addressed the choppiness issue (didn't we localize this to sounds files with variable bit rate?). 

Something to look out for is making sure the two audio streams become synchronized on the client side.  I believe this may be as simple as keeping track of the t0s. 
Mark
NI App Software R&D
0 Kudos
Message 35 of 35
(1,041 Views)