Azzera filtri
Azzera filtri

Need help with cutting 37 seconds off from start of wav file.

6 visualizzazioni (ultimi 30 giorni)
I have a 43 second wav clip I am trying to trim to make a new sound file. I found a way to cut 3.65 seconds off from the end, however I need help finding a way to cut 37 seconds off from the begining point.
Here is the script so far.
filename = 'C:\Users\ajbaf\Music\mlabpost\wm7001.wav';
[y,fs] = audioread(filename);
endtrim=[1,length(y)-(3.65*fs)];
[y1,fs] = audioread(filename,t,endtrim);
wavFileName = 'C:\Users\ajbaf\Music\mlabpost\wmr.wav';
audiowrite(wavFileName, y1,fs);
Here is a picture of what I working on.
wavWork.jpg

Risposta accettata

Cyrus Tirband
Cyrus Tirband il 24 Ott 2019
Modificato: Cyrus Tirband il 24 Ott 2019
[y,fs] = audioread(filename);
filename = 'C:\Users\ajbaf\Music\mlabpost\wm7001.wav';
y(1:37*fs,:) = []; %% this deletes the matrix elements corresponding to the index range 1:37*fs
y(end-3.65*fs:end,:) = [];
wavFileName = 'C:\Users\ajbaf\Music\mlabpost\wmr.wav';
audiowrite(wavFileName, y,fs);

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by