Joaquin_H Posted October 15, 2012 Report Share Posted October 15, 2012 Hi, I'm trying get the correct size of the array data from the acquire sound block. I have set it up at 44100 Hz sample rate and 1 second of duration. I convert the output data from dynamic data to single waveform and then using get waveform components I can get the size of the Y array. But the size I get is 33075 samples, instead of 44100. I don't know where are the 1025 samples, maybe this samples are used to carry the timestamp and dt info. Can anyone help me with this? Thanks! Quote Link to comment
Tim_S Posted October 15, 2012 Report Share Posted October 15, 2012 Are you collecting the data by setting the number of samples in the DAQ Read or are you waiting for 1 second then collecting the data points present? Quote Link to comment
asbo Posted October 15, 2012 Report Share Posted October 15, 2012 Are you using the lvsound2 library, particularly the Sound Input library? I know first-hand that its input parameters are buggy, in that asking for x samples at x Hz will not actually return x samples, it will be some proportion fewer. I ended up using a coefficient to tweak some of the inputs to give me (approximately) the right amount of data. Quote Link to comment
JamesMc86 Posted October 15, 2012 Report Share Posted October 15, 2012 Sounds like an express vi but it may be built on that library still. If you can post some code it will help us understand what your doing. Quote Link to comment
Joaquin_H Posted October 22, 2012 Author Report Share Posted October 22, 2012 Are you collecting the data by setting the number of samples in the DAQ Read or are you waiting for 1 second then collecting the data points present? I'm using the express VI and waiting for a second, I don't know another way to do it, I'm just starting with Labview Thanks Are you using the lvsound2 library, particularly the Sound Input library? I know first-hand that its input parameters are buggy, in that asking for x samples at x Hz will not actually return x samples, it will be some proportion fewer. I ended up using a coefficient to tweak some of the inputs to give me (approximately) the right amount of data. Sorry I don't know about libraries yet, I'm just starting with Labview and a guide book. I just put an acquire sound express VI and convert the dynamic data into an array to get the size. I'm trying to make a scope and for some calculus I need the right amount of data. I'm learning now about queue the data to implement the diferents types of inputs I need as mic, text o wav files. Thanks Quote Link to comment
asbo Posted October 22, 2012 Report Share Posted October 22, 2012 I'm pretty sure the Express VI you're referring to depends on the library I mentioned. You should follow James' suggestion and post your code. Quote Link to comment
Joaquin_H Posted October 22, 2012 Author Report Share Posted October 22, 2012 Sounds like an express vi but it may be built on that library still. If you can post some code it will help us understand what your doing. Yes, I'm using an express VI. I don't know how to upload the file to the forum, you have it here: http://www.2shared.c...qBSEg/test.html Thanks! test.vi Quote Link to comment
asbo Posted October 22, 2012 Report Share Posted October 22, 2012 Yes, I'm using an express VI. I don't know how to upload the file to the forum, you have it here: http://www.2shared.c...qBSEg/test.html If you click "More Reply Options" on this page, it will take you to the full post editor, which has a panel for uploading attachments. I took a peek at your VI - it does depend on the lvsound2 library. As I mentioned before, my workaround was not elegant; I just multiplied my acquisition duration by a constant to get the right output duration. Do me a favor and report this to NI (http://www.ni.com/support) so they know someone else is running into this problem. 1 Quote Link to comment
Joaquin_H Posted October 22, 2012 Author Report Share Posted October 22, 2012 Thank you OK I just reported the bug to NI. I will post here their response. Quote Link to comment
Mellroth Posted October 23, 2012 Report Share Posted October 23, 2012 ... I just multiplied my acquisition duration by a constant to get the right output duration... Just info for the thread; if you want X samples you'll actually get X mod (4) * 3 samples out, or roughly 0.75X So the input should approximately be set to X * 4 /3 to get close to X samples out. I've seen this type of bug in another application a long time ago, and then it was due to the conversion from a 24bit stream to a 32bit stream. /J 1 Quote Link to comment
Cat Posted October 31, 2012 Report Share Posted October 31, 2012 I remember reading on ni.com somewhere that there are issues with only getting 75% of requested sound. FWIW, I just fixed all my sound problems (both input and output) by upgrading from LV2011 to LV2012. lvsound2.dll seems to be the same for both (exact same # of bytes, anyway), so it seems to be something in LV2011 that just doesn't play well with sound. Quote Link to comment
asbo Posted November 1, 2012 Report Share Posted November 1, 2012 FWIW, I just fixed all my sound problems (both input and output) by upgrading from LV2011 to LV2012. lvsound2.dll seems to be the same for both (exact same # of bytes, anyway), so it seems to be something in LV2011 that just doesn't play well with sound. Do you, by chance, add or remove devices during your application's lifetime? I had a big problem with that on a tester which paired and unpaired BT audio devices. I can't remember if we ever tested it on LV2012. Quote Link to comment
Cat Posted November 1, 2012 Report Share Posted November 1, 2012 Do you, by chance, add or remove devices during your application's lifetime? I had a big problem with that on a tester which paired and unpaired BT audio devices. I can't remember if we ever tested it on LV2012. Not programmatically, if that's what you mean. I did try various devices with no luck, but all of that was all via configuration files. All I can say is, if you had any issues with sound while running LV2011, try it with LV2012 and you may be pleasantly surprised. Or really annoyed that you spent all that time trying to debug something that was actually a LV problem. :-) Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.