LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using usb-microphone to make a detection

Hi all, 

             I am new to labview and this forum. I would like to know how to do the following. 

If usb-microphone detect sound signal exceed xxxxxx loudness 

then display "1" in a graph or whatever it can be. 

 

something as simple as that. Thanks all. 

0 Kudos
Message 1 of 13
(6,815 Views)

First get your sound into LabVIEW.  Look at the example called Continuous Sound Input.vi.  Once you have that you can add a threshold detector.  The Basic Level Trigger Detection.vi would be a good place to start.  It's in the waveform monitoring palette.

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 2 of 13
(6,790 Views)

First get your sound into LabVIEW.  Look at the example called Continuous Sound Input.vi.  Once you have that you can add a threshold detector.  The Basic Level Trigger Detection.vi would be a good place to start.  It's in the waveform monitoring palette.

 

So I've tried out labview and it seems to be some sort of "block" programming. So if I am right is a threshold detect a block? where can I find it? What about the "basic level trigger detection" and "waveform monitoring palette.

 

Thanks

0 Kudos
Message 3 of 13
(6,762 Views)

You need to learn about LabVIEW programming.  If you Google "LabVIEW Core 1", you can find some information about "block programming".

0 Kudos
Message 4 of 13
(6,746 Views)

 Ok I stumble upon a video "http://www.youtube.com/watch?v=Q7UJ_uOvXP8" It seems that's what I should be doing. However, in that video I am unsure how he specify his mic. As a matter of fact I did not see him routing the settings to the mic he is using. Labview automatically uses the mic avalible on the PC? what if i'm using a labtop where I have a USB mic and a built in mic? How to specify labview to use my usb mic instead of the built-in mic? 

 

Lastly, if anyone have time, can someone explain me what did he do in that video? what is that while loop for? and etc....

0 Kudos
Message 5 of 13
(6,739 Views)

We're willing to help you with your code here but you will need to learn LabVIEW on your own time.  There are TONS of resources available.  Do a search for LabVIEW beginner tutorials.  Or just start here: http://www.ni.com/white-paper/7466/en/

 

After you get the basics down, go back to your sound project and you'll find it pretty easy.

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 6 of 13
(6,721 Views)

Thanks all 

"

First get your sound into LabVIEW.  Look at the example called Continuous Sound Input.vi.  Once you have that you can add a threshold detector.  The Basic Level Trigger Detection.vi would be a good place to start.  It's in the waveform monitoring palette.

 

 

Thanks"

 

^ i can do the above now. So right now I want to add more complexity on it. Same thing but I want the program to not work until I have another trigger on it. 

 

What I mean is this. I have 1 button and 1 light. So the program that I have is whenever the sound level pass through a certain threshold, the light will go on. Now I want the program to ONLY work if ser pressed the button before hand, and the program will only go through ONCE. Then if the user want to operate the program again he will need to press the button again. How to do that?  I've done some research and it seems that I need to purchase a NIDAQ card to make this work. Is it true? 

0 Kudos
Message 7 of 13
(6,684 Views)

^bump

0 Kudos
Message 8 of 13
(6,662 Views)

threshold.png

 

You don't need a DAQ card if you have a sound card.  I added the Waveform Threshold VI above and it detects the sound just fine.  Notice I added the index array as well since that sound output VI returns an array of waveforms.  The index array pulls out the first waveform and it checks if it is bigger than the threshold limit, if so it lights the boolean.

 

If you want it to wait for a button press to "arm" the system you can put the detection code in a case structure.  I'll leave that to you since it's super basic programming. Smiley Wink

 

EDIT:  I just realized the reason that the waveforms are in an array is because there's one for each channel, left and right.  

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 9 of 13
(6,647 Views)

Thanks, where did you get the "status" check to combine with the or function? I am still new, just to confirm, the "stop" that connected to the or function is just the control you created right? Also where do you check the waveform limited (meaning set your threshold) I don't see any numbers I can change. 

0 Kudos
Message 10 of 13
(6,632 Views)