WAV file format overview
WAV stands for waveform audio file format. It is a popular file format for storing audio data in a digital form. WAV files have a header followed by the audio data. The header contains information about the file's sampling rate, number of channels, bits per sample, and other details. The audio data is typically stored in a 16-bit or 24-bit format, with a sample rate of 44.1 kHz or 48 kHz.Steps to load a WAV file in MATLAB
To load a WAV file in MATLAB, follow these simple steps:Step 1: Open MATLAB and navigate to the directory that contains the WAV file.
Step 2: Use the \"audioread\" function to read the WAV file and store the audio data in a variable. The syntax for this function is as follows:
[y, Fs] = audioread('filename.wav');
Here, \"y\" is an array that contains the audio data, and \"Fs\" is the sampling rate of the audio data.
Step 3: If you want to play the audio file, use the \"sound\" function. The syntax for this function is as follows:
sound(y, Fs);
This will play the audio file using the default system player.
Step 4: If you want to plot the audio data, use the \"plot\" function. The syntax for this function is as follows:
plot(y);
This will plot the audio data as a waveform.