From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LABVIEW 7.1 20020

Solved!
Go to solution
thanks thoric, here is the reason i did that, the fonction is i record sound and hear it in the same time, and if it does not satisfy me, i delete immediately.
0 Kudos
Message 21 of 30
(1,813 Views)

Oh, I see. Well, unfortunately, your current code will not work that way. If you select the boolean control anytime after the program starts you will be too late already, because it is read as soon as the vi starts. Perhaps if you move the boolean into the while loop that performs the acquisition then it will be continually polled until the loop exits (make sure you set the control type to Switch when Released). Wire it out to the delete case statement (make sure autoindexing is off) and now, if you press it before you press Stop, it will delete the file.

 

...or...

 

Why not instead put the Snd Write inside the case statement instead of a file delete, and rename the boolean control to "Save Recording". Then, if you choose to keep the sound, turn on the boolean control and when you select Stop it will save to file. This has to be better than saving the data then deleting it when you don't want it?

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 22 of 30
(1,807 Views)
Is your problem that you hear some sort of "poping" sound? This is because the sound output buffer runs empty before it filled up again.


Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
Message 23 of 30
(1,800 Views)

yes it's like this, shoud i reduce the buffer?Smiley Tongue

0 Kudos
Message 24 of 30
(1,799 Views)
hi Thoric, i think the second method is better, but there is the same problem, what can i do?
0 Kudos
Message 25 of 30
(1,792 Views)
take a look here http://digital.ni.com/public.nsf/allkb/CE31E1DEA12E212586256F310078AC2C you need to implement at least two buffers


Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
Message 26 of 30
(1,790 Views)

Xiuming,

You need to move the boolean into the while loop to make sure it is constantly polled during the sound acquisition. This ensures that upon end of acquisition, the latest value from this Save boolean is read and sent to the case structure. Ideally you would use a state machine for this and poll the Save boolean only once when required - but this ought to suffice.

 

save.jpg

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 27 of 30
(1,789 Views)

thanks Thoric, it's done.

 

and Coq Rouge, i have already add number of buffers, but there is always the problem,

 

when i connect SO write before the filter, there is 'zi.......'

after filter, 'pip pip pip'

 

0 Kudos
Message 28 of 30
(1,775 Views)
cahnge the init/cont boolean on filter-block to true, and use two ore more buffers. Also move the "SO Set Num Buffers VI" outside the loop


Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 29 of 30
(1,773 Views)

yes I have successfully completed the task, this is my first try with labview, and forgive my poor english, i use labview french version , thanks very much, you are two very nice peson.

 

xiuming.

0 Kudos
Message 30 of 30
(1,755 Views)