LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why do acquire sound VI%27s not record correct samples%2Fch

Solved!
Go to solution

Hi all,


Not a major issue right now, but interested if anyone knows why. 

 

Using LV2011 full development and working with the basic acquire sound VI's.  Its very strange, but i set the sampling frequency to say 48000 Hz and samples/ch to 96000 assuming i would get 2 seconds worth of data, but i get 1.5 seconds and only 72000 data points.  Its not cutting exactly half a second off, ive done a few different variations.  There is nothing special about this VI im using, i did the same thing with the express VI and got the same results.

 

Anyone have any clues?

 

Thanks,

 

Matt



-Matt
0 Kudos
Message 1 of 13
(4,161 Views)

Post code please. You're doing something wrong.

 

I get all the samples:

Listening in.PNG

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 2 of 13
(4,150 Views)

Hi james,

 

Project Is below.  Currently working in acquire and log sound wave vi.  Ive just noticed it records exactly 75% of the number of samples i request.

 

Thanks for any help,

 

matt



-Matt
0 Kudos
Message 3 of 13
(4,141 Views)

I ran your code and I got 72000 datapoints, which is how many you configured the acquisition for. What are you comparing your 75% to? Did you forget that you set the # of data points to 72k?

 

This is the relevant section of your code, right? (I added the Array Size part)

Listening in your VI.png

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 4 of 13
(4,136 Views)

Configured it for 96000 and only got 72000,acquire sound error.PNG conifgured it for 72000, got only 54000. 



-Matt
0 Kudos
Message 5 of 13
(4,127 Views)

Sorry,

 

Some of that post got covered by the photo,

 

But i configured it for 96k, got 72k.  Configured it for 72k, got 54k.  It is exactly75% everytime.  I am a little lost for words.



-Matt
0 Kudos
Message 6 of 13
(4,123 Views)

Yes that is the relevant section of code.  If i run that or run the express vi its the same thing.  I wonder if it is because it is labview 2011.



-Matt
0 Kudos
Message 7 of 13
(4,118 Views)
Solution
Accepted by topic author Wolleee

It's gotta be a weird buffer thing then... Maybe my computer is able to fill the buffer up to the top, but yours isn't.

 

In the "relevant code" above, use a 2x buffer for the configuration, but still only pull 96000. I say 2x, so that if you change your # data points in the future, you only have to change one number, not the buffer too. So you should end up writing 192k in to the Config function and 96k in to the Read function.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 8 of 13
(4,111 Views)

How do you set the buffer for that? I mean i can always divide the number of samples by .75 but if i switch to another computer without the buffer issue then the issue is going to happen again.Its not a huge deal, i can just record for longer, but id like to know why HA.



-Matt
0 Kudos
Message 9 of 13
(4,103 Views)

Oh,

 

Definitely misread the last post. Did that and success, pretty weird.

 

Thank you for your help again.



-Matt
0 Kudos
Message 10 of 13
(4,096 Views)