Owning Class: audio
Requires: MathScript RT Module
Y = fread_audio(file)
SIZE = fread_audio(file, 'size')
[Y, fs, NBITS] = fread_audio (file)
[Y, fs, NBITS] = fread_audio (file, n)
[Y, fs, NBITS] = fread_audio (file, [n1 n2])
Reads audio data from a .au file.
|file||Specifies the filename of the .au file you want to read. You can specify an absolute path or a path relative to the current working directory. If you do not include a file extension, LabVIEW adds a .au extension to the filename. 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.|
|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 LabVIEW uses to encode the data in file. NBITS is an integer.|
If you use this function in a stand-alone application or shared library and file is a relative path, LabVIEW searches for the file in the path where you installed the application or shared library. (Real-Time Module) If you deploy this function to an RT target and file is a relative path, LabVIEW searches for the file in the path returned by the Default Data Directory VI.
The following table lists the support characteristics of this function.
|Supported in the LabVIEW Run-Time Engine||Yes|
|Supported on RT targets||Yes|
|Suitable for bounded execution times on RT||No (affects entire script)|
Make sure the audio file chirp.au exists in the C:\ directory.z = fread_audio('C:\chirp');