Navigation

Operators and Keywords

Function List:

C++ API

Function File: y = wavread (filename)
Function File: [y, fs, nbits] = wavread (filename)
Function File: […] = wavread (filename, n)
Function File: […] = wavread (filename, [n1 n2])
Function File: […] = wavread (…, datatype)
Function File: sz = wavread (filename, "size")
Function File: [n_samp, n_chan] = wavread (filename, "size")

Read the audio signal y from the RIFF/WAVE sound file filename.

If the file contains multichannel data, then y is a matrix with the channels represented as columns.

If n is specified, only the first n samples of the file are returned. If [n1 n2] is specified, only the range of samples from n1 to n2 is returned. A value of Inf can be used to represent the total number of samples in the file.

If the option "size" is given, then the size of the audio signal is returned instead of the data. The size is returned in a row vector of the form [samples channels]. If there are two output arguments, the number of samples is assigned to the first and the number of channels is assigned to the second.

The optional return value fs is the sample rate of the audio file in Hz. The optional return value nbits is the number of bits per sample as encoded in the file.

See also: audioread, audiowrite, wavwrite.

Package: octave