Academic Company Events Community Support Solutions Products & Services Contact NI MyNI
14 ratings:
 2.92 out of 5     Rate this Document

Can I Play a .WAV Sound File from LabVIEW?

Primary Software: LabVIEW Development Systems>>LabVIEW Base Development System
Primary Software Version: 1.0
Primary Software Fixed Version: N/A
Secondary Software: N/A

Problem:
I would like to play a sound from within LabVIEW. Can I play a .WAV file in LabVIEW?

Solution:
  • 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.


Related Links:
KnowledgeBase 34BJ3SFQ: How to Use the Sound Output VI's in LabVIEW to Play Wave Files
KnowledgeBase 2HU7M1U7: Clicking Sound When Looping Back a WAV File Using the Build-in Sound VIs
KnowledgeBase 2VNE7AQT: How do I Use the LabVIEW Sound VIs on a Macintosh?
Developer Zone Example: LabVIEW Sound Card VIs for LabVIEW 5.0
Developer Zone Example: Acquiring Data and Saving the Data as a .wav File
Developer Zone Example: Playing Asynchronous Wav Files in LabVIEW 5.x

Attachments:





Report Date: 09/24/1997
Last Updated: 02/07/2014
Document ID: 11NHM905

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit