Example Code

Random Sound Generator

Code and Documents

Attachment

Overview
This example allows the user to set up to three frequencies or randomly choose three frequencies. The sound file is then saved as .wav file. 


Description
This code establishes a sound task that takes up to three frequencies and plays them simultaneously. The user is able to dynamically change the frequencies and volume and the sound output is saved in a file titled RandomSoundGenerator.wav .

 


Requirements

  • LabVIEW 2012 (or compatible)
  • Windows Media Player


Steps to Implement or Execute Code

  1. Download and Open VI
  2. Set up to three frequencies
  3. Run the VI
  4. Manually set the frequencies with the "User Input" button or randomly set the three frequencies with the "Randomize" button.
  5. Press the "Stop" button to save the generated sound

Additional Information or References

Front panel

Capture.PNG

 

Block Diagram

1.png

 **This document has been updated to meet the current required format for the NI Code Exchange.**

 

Jonathan L.
Technical Support Section Manager
National Instruments

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.