Owning Class: audio
Requires: MathScript RT Module (Windows)
Y = wavread(file)
SIZE = wavread(file, 'size')
[Y, fs, NBITS] = wavread(file)
[Y, fs, NBITS] = wavread(file, n)
[Y, fs, NBITS] = wavread(file, [n1 n2])
Reads a Microsoft .wav file.
| Name | Description |
|---|---|
| file | Specifies the filename of the .wav file you want to read. You can use an absolute path or a path relative to the current working directory. LabVIEW adds a .wav extension to the filename if you do not provide the extension. file is a string. |
| 'size' | Directs LabVIEW to return the size of the audio data in file. |
| n | Directs LabVIEW to return only the first n samples from each channel in file. |
| n1 | Specifies the first sample in the range of samples that LabVIEW returns from each channel in file. |
| n2 | Specifies the last sample in the range of samples that LabVIEW returns from each channel in file. |
| Name | Description |
|---|---|
| Y | Returns the sampled data with amplitude values in the range [-1, 1]. Each column of Y represents one channel. Y is a real matrix. |
| SIZE | Returns the size of the audio data in file. The first element in SIZE is the number of samples in file. The second element in SIZE is the number of channels in file. SIZE is a two-element vector of integers. |
| fs | Returns the sampling rate in Hz. fs is a real number. |
| NBITS | Returns the number of bits per sample used to encode the data in file. NBITS is an integer. |
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.
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)