clc;
clear all;
close all;
fileName='Voice_002.wav';
[y, fs, nbits]=wavread(fileName);
N = length(y);
sound(y, fs);
time=(1:length(y))/fs;
plot(time,y);xlabel('Time');
ylabel('Amplitude');
fprintf('Information of the sound file "%s":\n', fileName);
fprintf('Duration= %g seconds\n', length(y)/fs);
fprintf('Number of samples %g:\n', N);
fprintf('Sampling rate = %g samples/second\n', fs);
fprintf('Bit resolution = %g bits/sample\n', nbits);