LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Acquiring voice

Hello there!

 

How can I change the number of samples/ch from a microphone? I need my wave to be acquired and monotorized in real time.

 

Thanks!

0 Kudos
Message 1 of 11
(2,715 Views)

How are you acquiring the signal now?  DAQmx?  Sound Input VIs?

 

I'll assume you are using the Sound Input VIs.  I would recommend setting the Sample Mode to Continous Samples.  Then there is an input for the Sound Input Read.vi for the number of samples to read.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 11
(2,707 Views)

I was doing that. But every time I change the number of samples, the signal takes too long to acquire. My goal is too show the wave in real time. Every time a person talks the wave shows and we don't have to wait almost 6s to see it.

0 Kudos
Message 3 of 11
(2,703 Views)

Can you share your code?  I have a feeling this is a case of not getting the samples fast enough and you are just getting old data out of the buffer.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 11
(2,701 Views)

@anariodrigues wrote:

I was doing that. But every time I change the number of samples, the signal takes too long to acquire. My goal is too show the wave in real time. Every time a person talks the wave shows and we don't have to wait almost 6s to see it.


If you increase the "number of samples" then you'll be acquiring more data and therefore it will take longer. If you want to show the data in real time, like an oscilloscope, then you need to be acquiring small amounts of data, and repeat that in a loop many times a second.

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 5 of 11
(2,696 Views)

I'm trying to program something to, first, to show how does the sound wave varies. Then, if a sound is bigger than the max of that sound wave, it triggers a force resistence sensor to read a voltage (not yet implemented). For that, I need to show a real time wave.

 

Thanks!

0 Kudos
Message 6 of 11
(2,694 Views)

Sometimes it's better to post code, rather than a snapshot, so we can assist by modifying it directly.

 

Firstly, can I recommend you replace the Graph with a Chart, which will automatically concatenate your data for you without needing to Array Insert function, plus it will only store a certain amount of data and thus doesn't require endless RAM if the code runs for a long time. This also means you lose the uninitialised shift register (not helpful here).

 

Secondly, there's no reason (looking briefly at this code) why it shouldn't work for you. Can you describe what the symptoms of your problem are? Do you get an error code? So long as the "number of samples/Ch" is small this should execute fairly quickly for you.

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 7 of 11
(2,684 Views)

Start the sound task before the While loop.  That way you will be constantly acquiring the data and when you read you will get the number of samples you need.  The way you are set up, the task has to start each time you try to do a read.  You should also stop the task after the While loop before clearing it.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 8 of 11
(2,682 Views)

OK. Thanks!

 I'll give it a try and let you know.

0 Kudos
Message 9 of 11
(2,676 Views)

you mean using the start function before the while?

 

Thanks!

0 Kudos
Message 10 of 11
(2,674 Views)