How to add ,read,insert AUDIO in MATLAB

1)Statement of Problem:-

Here we are going to see how to add audio in MATLAB.

2)Program:-

%% Read audio
p=audioread('C:\Users\akshay\Downloads\pi.mp3');
%% Show audio
figure(1)
plot(p);
title('inputaudio')


3)Explanation:-

p=audioread('C:\Users\akshay\Downloads\pi.jpg');

In this instruction MATLAB reads the audio from the location which is given by user
here i have given the location which is p=audioread('C:\Users\akshay\Downloads\pi.mp3');
while giving the location you have to remember some point
1) The must be in single quotations marks. ex. 'your location'
2) After giving location you must have to give the name of file with its extension which is in this example is pi.mp3.

figure(1)

This instruction creates the figure window for you.


plot(p);

This instruction is use to plot  the audio which is given by user. As here the audio which is given by user is assign to the p thats why we write here in bracket plot(p);.


title('inputaudio')

title is used to give the title to the plot audio and in bracket you can write anything which is nothing but the name which you have to give your plotted figure. Here i have used the name inputaudio.


4) OUTPUT:-



Comments

Popular post

How to add ,read,insert IMAGE in MATLAB

How to plot different discrete signal using MATLAB

How to do Frequency Shift Keying (FSK) using MATLAB