LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how can I create and manipulate milli second sounds

I am trying to create a sound that last 100 milli seconds.  It requires a 10 ms fade in and fade out.

The fade eliminates the popping sound that occurs when the sound starts or ends.

 

I tried using a while loop to create it, but it does not loop fast enough.

I wonder if there is a way to assemble the sound waves slowly and then play them.

  

 

 

Any suggestions?

 

Download All
0 Kudos
Message 1 of 2
(2,076 Views)

You cannot use software to perform precise timing. This means that if you need precisely 10 msec before and after the sound with extra time between the pad time and the actual sound, you will need to either

(a) create the combined sound with some other application and play it from LabVIEW

(b) write out a temporary sound file to disk that has the 10 msec pads added (using the LabVIEW functions to write binary files) and play this. Don't ask me how to do this, as I don't know.

Other comments regarding the code:

  • Inside the loop you are driving a case structure with 0/1 that you get by converting a Boolean value to a DBL using the Select function. This is pointless. Simply drive the case structure directly from the Boolean.
  • You have a "Sine" constant that's driving another case structure. Is this supposed to be a control? If not, the case structure then serves no purpose. 
0 Kudos
Message 2 of 2
(2,069 Views)