From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Sound and Vibration

cancel
Showing results for 
Search instead for 
Did you mean: 

Sound Play Tone

Introduction

This VI plays a single frequency over a desktop sound card.

Supported Targets

  • LabVIEW Desktop (Windows / Mac)

Requirements

  • LabVIEW 2010

Implementation

This VI is written like an express VI: references and tasks are opened on first call, sound is output on every call (unless an output fails), and the stop input closes all tasks. Use the stopped output to wire into the conditional terminal of a loop.

The wait input causes this VI to block until the audio card has played all generated samples, so the execution time of the VI will be at least sample duration (s) long. Setting wait to false will cause the VI to return immediately; if used in an untimed loop, it will consume 100% CPU resources. Set wait to true and use in an untimed loop to generate continuous output without overutilizing CPU resources.

snippet.JPG

Sample Code

The following VI plays a tone continuously.

example.jpg

Versions

1.0 (2010-10-06): Initial release.

Message 1 of 1
(10,691 Views)