LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I get the block duration for wave file playback?

I'm using a LV example "Getting Started with sound and vibration express vi's (simulated).  When I play back the examples the audio does not match the graphing updates as the file is played. That is, the sound continues to play after the graphs have finished reading the file.  I can change the input box "block duration (s)" to achieve playback coordination between graph updates and audio. Is it possible to calculate this value from data included in the file?  If not then if I have a vi that records sound to a wav file could the "block duration" be calculated there and passed to the playback vi?  Just not sure what makes up the block duration.  Thanks
 
0 Kudos
Message 1 of 3
(2,816 Views)
Hi Mike,

The Block Duration that is configured from the Front Panel is a control that is used to determine how much of the sound file has the analysis performed.  From the Block Diagram the Block Duration control is used to calculate the subset of the Get Waveform Subset.vi.  Also notice the sound file is opened prior to entering the case structure, thus will begin first to execute due to dataflow.  This may be easier to see using highlight execution.  The sound VIs are not affected by the Block Duration at all as the entire sound file will be played.  Take the data from your sound file and display it onto a chart or begin processing as in the Read Sound File to Chart.vi example for immediate updates  Hopefully this helps!
Regards,


h_baker
National Instruments
Applications Engineer
0 Kudos
Message 2 of 3
(2,788 Views)

I would like to share my experience here, I never used the sound and vibration toolkit, rather general Sound VI's available in the basic package.

 

Using the Sound VI's you can control how much sound you want to get at that instant by using no.of samples parameter in the sound read section.

You will have total control on the chunk of data what you have which, this can be plotted, played, and recorded, you can analyse too by displaying in the graph. Amplitude may not be the same though!!!!

0 Kudos
Message 3 of 3
(2,771 Views)