Need help with cutting 37 seconds off from start of wav file.
6 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
AJ516
il 24 Ott 2019
Modificato: Cyrus Tirband
il 24 Ott 2019
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](https://www.mathworks.com/matlabcentral/answers/uploaded_files/244848/wavWork.jpeg)
0 Commenti
Risposta accettata
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);
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Audio and Video Data in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!