필터 지우기
필터 지우기

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

조회 수: 6 (최근 30일)
AJ516
AJ516 2019년 10월 24일
편집: Cyrus Tirband 2019년 10월 24일
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

채택된 답변

Cyrus Tirband
Cyrus Tirband 2019년 10월 24일
편집: Cyrus Tirband 2019년 10월 24일
[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개)

카테고리

Help CenterFile Exchange에서 Audio and Video Data에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by