From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

capture audio signals on the server and play it on a client

How to capter sound and play it on a client

Hello

A am a newcommer in programming in Labview..

I want to use the webserver to capture audio signals on the server and play it in the same time on a client... a short delay is allowed.
How can I do that?

Is there any example on the internet, or where could I receve more Information?

X-thanks
0 Kudos
Message 1 of 11
(3,553 Views)
Hi Maxx

You might want to look at the

LabVIEW examples >> Networking >> DataSocket >> DS Weather

This example shows how you can distribute information over the internet to multiple clients. Also try the following for an alternative means of internet data delivery:

LabVIEW examples >> Networking >> TCP & UDP >> Data Client (& Data Server)

You can use the Sound tools in LabVIEW (Graphics&Sound >> Sound >> Sound Input) to acquire the sound information from a microphone input on the server side and then play it on the receiving end sound card. If you find that it is getting too complex to program, ive developed a program which does something similar but can be modified to suit your specification. You can contact me on charles@madry.com.au

Ive also set up
a remote monitoring application using the LabVIEW Internet Toolkit Web Server. It uses video instead of audio and can be used in situations where the client uses a web browser and does not have LabVIEW or the Run Time Engine. You might find it handy for ideas. You can look at it here.

Gluck!

Charles ElBayeh
Applications Engineer
Madry Technologies, NI Alliance Member
www.madry.com.au
0 Kudos
Message 2 of 11
(3,553 Views)
Hello all,

You may also want to check out the Sound and Vibration Toolset, which provides more in-depth sound analysis and evaluation capabilities. Information about the toolset can be found here:
http://sine.ni.com/apps/we/nioc.vp?cid=3122〈=US

Also, for a great starting point to search for example programs on our website, go to www.ni.com/support, and click on "Example Code" (under Option 3).

Have a great week!

Liz Fausak
National Instruments
0 Kudos
Message 3 of 11
(3,553 Views)

Hello!

I am facing a similar problem. I am trying to broadcast sound using datasocket. One program "sound_input.vi" is to write sound to datasocket server, and another is "sound_output.vi" to read sound from datasocket server. The sound_input is executed on the same computer where datasocket server is running, hence the url is to "localhost" and the sound_output specifies url of the datasocket server's computer. (normal datasocket programming)

When I run both these programs on the same computer, there's no error, and I read sound (and infact hear too) perfectly. But, when the sound_output program runs on another computer, I see an error at the computer running sound_input and datasocket server.

-----

Error 4823 occurred at Sound Input Read (DBL).vi->Sound_Input.vi

LabVIEW:  (Hex 0x12D7) A task must be running to perform this operation.

------

 

My network connections are ok, since I can run my video input/output application using datasocket server, between these two computers.

I have attached two program block diagrams for further information.

Any clues?

Thanks ahead.

-Vaibhav

Vaibhav
Download All
0 Kudos
Message 4 of 11
(3,227 Views)
Vaibhav,
 
I am not sure why this only occurs when yo u are using two different computers. However, this error usually occurs when the input task has been stopped. This could be because the input buffer maybe filling up.  Most of the times increasing the sample rate may solve this problem. Would it be possible for you to increase the sample rate?
 
 
Mehak D.
0 Kudos
Message 5 of 11
(3,192 Views)
Hi Mehak!
Thanks for your message.
 
After posting that message, on friday, I continued with experimenting. I tried different combinations of No. of Samples/channel and Sample rate. I started with 44100 on both these values, and it gave error at source as soon as I connected the client. But as I decreased these values, the error level also decreased; i.e., after initializing the client, the server gave an error and then if I only reinitialize the server, it started transmitting voice well. And going further down, i.e. with both the values around 3000, I started receiving voice clearly at client. But one drawback was that the low frequency sound wasn't transmitted. Somehow, after experiments we discovered that even at higher No. of Samples/ch, if the Sample rate is significantly low, there is no error at any end while starting or ending the programs. Some good combinations for (No. of Samples/channel, Sample rate) were, (41000, 22050), (25000, 15000), (25000, 20000) etc. And at these rates, the voice quality was good too, i.e. we could hear both high frequency and low frequency voices, but with around 3.5 seconds of delay (which is not very bad, provided good transmission). 
 
One problem, the voice is too low at the receiving end.
 
One more issue: I am now combining the two program of video and voice transfer thru DataSocket. Both these programs run well alone. But after merging them I am facing the same problem, error at source while client initializes. So I will again experiment with optimum sample rates.
 
But I guess the problem is somewhere else in my program designing. It would be great if someone has that DS Weather.vi in their older version of LabVIEW.
 
 
Thanks for your attention.
Vaibhav
0 Kudos
Message 6 of 11
(3,174 Views)

What version of labVIEW you are using?

Mathan

0 Kudos
Message 7 of 11
(3,170 Views)

Am using LabVIEW 8.5 and couldn't able to find the vi you mentioned. [ DS Weather.vi]

Mathan



Message Edited by mathan on 05-20-2008 06:33 AM
0 Kudos
Message 8 of 11
(3,167 Views)
Hi Mathan!
 
I am using LabVIEW 8.2.1 (20th Anniversary Edition) and I don't have that vi either. If you see the 2nd message in this thread, you will know which vi I am talking about. I think the DataSocket accessibilities are changed from version 7 onwards. So there's no .vi like that.
 
But nonetheless, did you understand the problem I described?
 
Here I am attaching the two more block diagrams where vision and sound are combined for transmittion via datasocket.
 
Thanks.
Vaibhav
Download All
0 Kudos
Message 9 of 11
(3,160 Views)
Hi Vaibhav,
I tried to find that USB Acquisition express VI but couldnt find it . The USB Acquistion Express that you are using in your input progra. Also are you using any compression in audio too like in image.?
 
aman


Message Edited by aman_bajra on 07-10-2008 11:39 AM
0 Kudos
Message 10 of 11
(3,045 Views)