How do i silence part of wav file ?

4 views (last 30 days)
So i need to input star and and of a part of wav file i want to alter and then make that part silent.
>> song1 = wavread('C:\Program Files\MATLAB\AM.wav');
>> song1(44100:44100*10) = 0;
I tried this (silencing from 1 to 10 sec) but nothing happens.
Any ideas ?

Accepted Answer

Image Analyst
Image Analyst on 14 May 2014
This works for me. It blanks out some seconds:
% song1 = wavread('C:\Program Files\MATLAB\R2014a\toolbox\signal\sigdemos\guitartune.wav');
song1 = wavread('C:\Program Files\MATLAB\R2014a\toolbox\signal\sigdemos\noisymusic.wav');
fprintf('song1 is %d elements long\n', length(song1));
subplot(2,1,1);
plot(song1);
song1(44100:44100*10) = 0;
subplot(2,1,2);
plot(song1);
% sound(song1);
msgbox('Done with demo!');

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!