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: LabVIEW Sound Card VIs for LabVIEW 5.0Developer Zone Example: Acquiring Data and Saving the Data as a .wav FileDeveloper Zone Example: Playing Asynchronous Wav Files in LabVIEW 5.x
- 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.
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.