|| 2.75 out of 5
Can I Play a .WAV Sound File from LabVIEW?
LabVIEW Development Systems>>LabVIEW Base Development System
Primary Software Version:
Primary Software Fixed Version:
I would like to play a sound from within LabVIEW. Can I play a .WAV file in LabVIEW?
Related Links: KnowledgeBase 34BJ3SFQ: How to Use the Sound Output VI's in LabVIEW to Play Wave FilesKnowledgeBase 2HU7M1U7: Clicking Sound When Looping Back a WAV File Using the Build-in Sound VIsKnowledgeBase 2VNE7AQT: How do I Use the LabVIEW Sound VIs on a Macintosh?Developer Zone Example: Acquiring Data and Saving the Data as a .wav File
Attachments: Sound File to Sound Output v2015.viSound File to Sound Output v2014.viSound File to Sound Output v2013.viSound File to Sound Output v2012.vi
- LabVIEW 8.6 and later
The sound palette is located in the Functions Palette under Programming » Graphics and Sound » Sound. Select Output and you can use the Play Waveform Express VI or the Play Sound File.vi to play a .WAV file. The Device ID terminal is the device you access for a sound operation, which generally 0 by default. The Play Waveform Express VI has an auto-populated drop-down list that includes all available sound devices. Refer to Context Help for more information.
For example code, select Help » Find Examples. When the NI Example Finder window opens, select the Browse tab, then navigate to Hardware Input and Output » Sound. To play a .WAV file, begin with the Sound File to Sound Output.vi.
- LabVIEW 5.1
Beginning in LabVIEW 5.1, a sound palette has been added to enable the use of sound cards in LabVIEW. This palette, located at Functions » Graphics and Sound » Sound, has VIs that provide the ability to play and record 8 or 16-bit sounds. In particular, the VI will play a .WAV file from a path that you supply to the wave file path terminal.
- LabVIEW 5.0
There is a similar version of the Sound VIs available for LabVIEW 5.0 in the Developer Zone. A link to these VIs is available in the Related Links section below.
- LabVIEW 4.1
LabVIEW 4.1 for Windows ships with an example, Play Sound, located in the playsnd.llb library in the <LabVIEW>\Examples\DLL\Sound folder. This VI calls a DLL that uses Windows API function calls to play .WAV files.