matlab高手请进!

2024-12-12 19:06:57
推荐回答(1个)
回答1:

[x,Fs,bits]=wavread('wav文件');

>> help wavread

WAVREAD Read Microsoft WAVE (".wav") sound file.
Y=WAVREAD(FILE) reads a WAVE file specified by the string FILE,
returning the sampled data in Y. The ".wav" extension is appended
if no extension is given. Amplitude values are in the range [-1,+1].

[Y,FS,NBITS]=WAVREAD(FILE) returns the sample rate (FS) in Hertz
and the number of bits per sample (NBITS) used to encode the
data in the file.

[...]=WAVREAD(FILE,N) returns only the first N samples from each
channel in the file.
[...]=WAVREAD(FILE,[N1 N2]) returns only samples N1 through N2 from
each channel in the file.
SIZ=WAVREAD(FILE,'size') returns the size of the audio data contained
in the file in place of the actual audio data, returning the
vector SIZ=[samples channels].

[Y,FS,NBITS,OPTS]=WAVREAD(...) returns a structure OPTS of additional
information contained in the WAV file. The content of this
structure differs from file to file. Typical structure fields
include '.fmt' (audio format information) and '.info' (text
which may describe subject title, copy right, etc.)

Supports multi-channel data, with up to 16 bits per sample.

See also WAVWRITE, AUREAD.

NOTE: This file reader only supports Microsoft PCM data format.
It does not support wave-list data.

See also WAVWRITE, AUREAD, AUWRITE.

x=WAVREAD('wav文件')
直接这个就可以了