12-23-2014 06:45 AM
Hi.
I want to play input data with system speakers. Data receive from Serial Port and I want to play it realtime. my data frequency rabge is between 10 to 500 and it;s amplitude is up to 1. I use this Subvi that I right it for put in final Vi.
Sampling frequency is 2000.
anyway, I put this subvi in my final code, but It doesn/' work !!
anybody has idea ?
Thanks.
12-23-2014 11:21 AM
Curious. Thanks for posting the code as a Snippet -- I dropped it into an empty Block Diagram, replaced the Device input with a Constant (which was 0), replaced the Data with a Basic Function Generator set to make a Sine Wave (default) at 440 Hz, Amplitude 1 (default), 1000 points at 1000 Hz. When I ran it, I got a second of the note "A 440".
My conclusion is that your code is fine, the problem is that one or more of your Inputs is wrong or missing.
Bob Schor
12-23-2014 12:03 PM
I send my final desin which play input signal from VISA read function. as you can see, in program this VI doesn't work !!
I use notifier for play a specified song when input signal cross over 3.1 , it worked correct when I don't use first post VI, and when I put first post VI into above VI, LV show an error.
12-23-2014 12:13 PM
12-23-2014 01:52 PM
you are right, it is scaller, but I use numer to array function for DATA input of VI, and my data which come from MCU are digital (I use an ADC for sampling from an analog signal) and in every time I have just 1 sample. with this circumstances can I use this block for play input data ?
or is anyway to play input data ?
12-23-2014 01:58 PM
12-23-2014 02:11 PM
Thank you Dennis,
I run circuit tommorow and then put error text exatly here.
but as I say for play input signal which come from VISA read, what I can do ?
12-23-2014 02:13 PM
12-23-2014 02:19 PM
with 2ksps, what time need for accumulate samples ?
and if I use buld array functions for that , is it worked cooreclty ?
I want use queue in VI (like producer/consumer) , in your mind is it good way ?
and if it is possible for you, can you give an example for your way ?
Thanks.
01-26-2015 12:21 PM
how I can acoomulate samples before playing them ?