Member of the audio class.
wavwrite(Y, file)
wavwrite(Y, fs, file)
wavwrite(Y, fs, NBITS, file)
Writes data to a Microsoft .wav file.
| 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. |
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 Options page to change the default working directory.
This function is not supported in the LabVIEW Run-Time Engine. Do not use this function in a stand-alone application or shared library.
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)