Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

wavwrite (MathScript RT Module Function)

LabVIEW 2010 Help

Edition Date: June 2010

Part Number: 371361G-01

»View Product Info

Owning Class: audio

Requires: MathScript RT Module (Windows)

Syntax

wavwrite(Y, file)

wavwrite(Y, fs, file)

wavwrite(Y, fs, NBITS, file)

Description

Writes data to a Microsoft .wav file.

Details

Examples

Inputs

Name Description
Y Specifies the wave data you want to write to file. Each column of Y represents one channel. Specify two columns for stereo data. Y is a real matrix.
file Specifies the filename to which you want to write the wave data in Y. You can use an absolute path or a path relative to the current working directory. file is a string.
fs Specifies the sampling rate in Hz. fs is a real number. The default is 8000.
NBITS Specifies the number of bits to use to encode the wave data in Y. NBITS must be 8, 16, 24, or 32. The default is 16.

Details

Changes you make to the working directory using the cd function apply only to the current instance of the LabVIEW MathScript Window or the MathScript Node from which you call the function. Changes to the working directory for one MathScript Node do not apply to any other MathScript Nodes. LabVIEW resets the working directory to the default when you close the LabVIEW MathScript Window or when the MathScript Node stops executing. Use the MathScript: Search Paths page of the LabVIEW MathScript Properties dialog box to change the default working directory for the LabVIEW MathScript Window. Use the MathScript page of the Options dialog box to change the default working directory for MathScript Nodes in the main application instance.

Examples

t = 0:0.01:10*pi;
z = sin(50*t.^2);
wavplay(z')
wavwrite(z, 'C:\chirp');
clear z;
pause(2);
z = wavread('C:\chirp');
wavplay(z)
plot(t, z)

Related Topics

cd
pwd
wavplay
wavread


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit