Sound Output Write VI

Owning Palette: Sound Output VIs

Requires: Base Development System

Writes data to a sound output device. You must use the Sound Output Configure VI to configure the device if you are writing continuously. You must manually select the polymorphic instance you want to use.

(Windows) You must have DirectX 8.0 or later to use this VI. (Linux) You must have the Open Sound System (OSS) driver to use this VI.

Note  If the buffer you set using the number of samples/ch input of the Sound File Read VI is full when the application executes, LabVIEW automatically implements a wait on the Sound Output Write VI even if you set timeout to 0. This may cause the data flow to hang and return unexpected results.

Examples

Use the pull-down menu to select an instance of this VI.

 Add to the block diagram  Find on the palette

Sound Output Write (DBL)

task ID is the sound operation from the configured device you want to manipulate or input. You generate task ID with the Sound Output Configure VI.
data writes any sound data to the internal buffers. For multi-channel sound data, data is an array of waveforms where each element of the array is a single channel.
t0 is ignored.
dt is ignored. The sample rate specified in the Sound Output Configure VI specifies the sample rate.
Y is the sound data. If the array data type is a floating-point numeric, Y can range from -1.0 to 1.0.

The specified data type determines the range of values for the sound data.
error in describes error conditions that occur before this node runs. This input provides standard error in functionality.
timeout (sec) specifies the time, in seconds, that the function waits for the sound operation to complete. This VI returns an error if the time elapses. The default is 10. If you set timeout (sec) to -1, the VI waits indefinitely. If you set timeout (sec) to 0, the VI returns immediately while the sound continues to play. You can use the Sound Output Wait VI to wait for playback to complete.
task ID out is the manipulated sound operation originally passed to the task ID parameter.
error out contains error information. This output provides standard error out functionality.

Sound Output Write (WFM)

Note Note  The WFM instance of this VI writes data from a single waveform that uses double-precision floating point numbers for the sound data.

task ID is the sound operation from the configured device you want to manipulate or input. You generate task ID with the Sound Output Configure VI.
data writes any sound data to the internal buffers.
t0 is ignored.
dt is ignored. The sample rate specified in the Sound Output Configure VI specifies the sample rate.
Y is the sound data. If the array data type is a floating-point numeric, Y can range from -1.0 to 1.0.

The specified data type determines the range of values for the sound data.
error in describes error conditions that occur before this node runs. This input provides standard error in functionality.
timeout (sec) specifies the time, in seconds, that the function waits for the sound operation to complete. This VI returns an error if the time elapses. The default is 10. If you set timeout (sec) to -1, the VI waits indefinitely. If you set timeout (sec) to 0, the VI returns immediately while the sound continues to play. You can use the Sound Output Wait VI to wait for playback to complete.
task ID out is the manipulated sound operation originally passed to the task ID parameter.
error out contains error information. This output provides standard error out functionality.

Sound Output Write (SGL)

Note Note  Use the SGL instance to write data from a waveform that uses single-precision floating point numbers for the sound data.

task ID is the sound operation from the configured device you want to manipulate or input. You generate task ID with the Sound Output Configure VI.
data writes any sound data to the internal buffers. For multi-channel sound data, data is an array of waveforms where each element of the array is a single channel.
t0 is ignored.
dt is ignored. The sample rate specified in the Sound Output Configure VI specifies the sample rate.
Y is the sound data. If the array data type is a floating-point numeric, Y can range from -1.0 to 1.0.

The specified data type determines the range of values for the sound data.
error in describes error conditions that occur before this node runs. This input provides standard error in functionality.
timeout (sec) specifies the time, in seconds, that the function waits for the sound operation to complete. This VI returns an error if the time elapses. The default is 10. If you set timeout (sec) to -1, the VI waits indefinitely. If you set timeout (sec) to 0, the VI returns immediately while the sound continues to play. You can use the Sound Output Wait VI to wait for playback to complete.
task ID out is the manipulated sound operation originally passed to the task ID parameter.
error out contains error information. This output provides standard error out functionality.

Sound Output Write (U8)

task ID is the sound operation from the configured device you want to manipulate or input. You generate task ID with the Sound Output Configure VI.
data writes any sound data to the internal buffers. For multi-channel sound data, data is an array of waveforms where each element of the array is a single channel.
t0 is ignored.
dt is ignored. The sample rate specified in the Sound Output Configure VI specifies the sample rate.
Y is the sound data. If the array data type is an 8-bit unsigned integer, Y can range from 0 to 255.

The specified data type determines the range of values for the sound data.
error in describes error conditions that occur before this node runs. This input provides standard error in functionality.
timeout (sec) specifies the time, in seconds, that the function waits for the sound operation to complete. This VI returns an error if the time elapses. The default is 10. If you set timeout (sec) to -1, the VI waits indefinitely. If you set timeout (sec) to 0, the VI returns immediately while the sound continues to play. You can use the Sound Output Wait VI to wait for playback to complete.
task ID out is the manipulated sound operation originally passed to the task ID parameter.
error out contains error information. This output provides standard error out functionality.

Sound Output Write (I16)

task ID is the sound operation from the configured device you want to manipulate or input. You generate task ID with the Sound Output Configure VI.
data writes any sound data to the internal buffers. For multi-channel sound data, data is an array of waveforms where each element of the array is a single channel.
t0 is ignored.
dt is ignored. The sample rate specified in the Sound Output Configure VI specifies the sample rate.
Y is the sound data. If the array data type is a 16-bit signed integer, Y can range from -32768 to 32767.

The specified data type determines the range of values for the sound data.
error in describes error conditions that occur before this node runs. This input provides standard error in functionality.
timeout (sec) specifies the time, in seconds, that the function waits for the sound operation to complete. This VI returns an error if the time elapses. The default is 10. If you set timeout (sec) to -1, the VI waits indefinitely. If you set timeout (sec) to 0, the VI returns immediately while the sound continues to play. You can use the Sound Output Wait VI to wait for playback to complete.
task ID out is the manipulated sound operation originally passed to the task ID parameter.
error out contains error information. This output provides standard error out functionality.

Sound Output Write (I32)

task ID is the sound operation from the configured device you want to manipulate or input. You generate task ID with the Sound Output Configure VI.
data writes any sound data to the internal buffers. For multi-channel sound data, data is an array of waveforms where each element of the array is a single channel.
t0 is ignored.
dt is ignored. The sample rate specified in the Sound Output Configure VI specifies the sample rate.
Y is the sound data. If the array data type is a 32-bit signed integer, Y can range from -2147483648 to 2147483647.

The specified data type determines the range of values for the sound data.
error in describes error conditions that occur before this node runs. This input provides standard error in functionality.
timeout (sec) specifies the time, in seconds, that the function waits for the sound operation to complete. This VI returns an error if the time elapses. The default is 10. If you set timeout (sec) to -1, the VI waits indefinitely. If you set timeout (sec) to 0, the VI returns immediately while the sound continues to play. You can use the Sound Output Wait VI to wait for playback to complete.
task ID out is the manipulated sound operation originally passed to the task ID parameter.
error out contains error information. This output provides standard error out functionality.

Examples

Refer to the following VIs for examples of using the Sound Output Write VI: