LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Streaming Audio over serial com port

I have a task where I am programming a robotic system and control unit.  I am using a laptop for the control unit.  On the laptop is a microphone.  What I would like to do is capture the audio from the microphone and transmit this via the radio to the robot to play on a speaker.  The radio plugs into the com port on the laptop.  I can transfer a .wav file by using the Flatten to String.vi send and unFlatten on the other side.  What I need to do is stream the audio as it is collected from the microphone.  Is this possible?  If so, any suggestions would be appreciated.

0 Kudos
Message 1 of 4
(6,699 Views)
It will depend on the speed you are using and the resolution. Let me give an example. Say you are using 1 start bit one stop  bit and 8 bit data. This mean for each byte you have to send 10 bit. Given that you are using 16 bit for audio and a 115200 rs232 link the maximum sample speed will be 115200/20 equal to 7760 samples pr second. But I guess your actual max speed will be lower. If you only need 8 bit sound  you may get higher data rates. That is perhaps the reason for the strange voice on robots in motion picturesSmiley Very Happy 


Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 2 of 4
(6,682 Views)

I just wanted to see if anyone has come up with anything for this yet. I'm currently working on getting streaming audio over serial as well and have only just started. 

 

Does anyone have any example VIs that would help with this?

 

I'm thinking about converting the input sound waveform into a digital wave, and then transmit the bits over serial,after I convert the binary array to ASCII so I can input the data into the Serial-Write VI. If anyone has any other ideas, I'd love to hear them. I'm also considering using some sort of compression/encoding, if needed, but probably won't need to go that far.

0 Kudos
Message 3 of 4
(6,327 Views)

Weizbox:

 

As Coq rouge mentioned, the major limitation is the data rate provided by the serial port. Streaming will be difficult at best, and you'll get extremely poor quality if you degrade the audio enough to stream it. If you want to transfer the audio, your best bet is probably to take goofylogic98's approach and flatten the data to a string. That will make it easiest to transfer the data using VISA functions. If you're looking for examples on those, just search "serial" in the NI Example Finder in LabVIEW.

 

Hope that helps!

Caleb Harris

National Instruments | Mechanical Engineer | http://www.ni.com/support
0 Kudos
Message 4 of 4
(6,292 Views)