Need help with cutting 37 seconds off from start of wav file.
14 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
AJ516
el 24 de Oct. de 2019
Editada: Cyrus Tirband
el 24 de Oct. de 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.
0 comentarios
Respuesta aceptada
Cyrus Tirband
el 24 de Oct. de 2019
Editada: Cyrus Tirband
el 24 de Oct. de 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 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Audio and Video Data en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!