How to trim audio in Matlab to get the desired audio duration?

조회 수: 101 (최근 30일)
Sisi Misi
Sisi Misi 2021년 10월 31일
댓글: Star Strider 2021년 11월 1일
Hii everyone
i wanna ask you
How to trim audio in Matlab to get the desired audio duration?
for example, the original audio duration is 17.9984 seconds and we want to cut it to 17.5500 seconds
thank you

채택된 답변

Star Strider
Star Strider 2021년 10월 31일
Express the desired length in thems of samples (here ‘Fs’ is the smapling frequency in Hz) —
desiredLength = 17.5500; % Seconds
L = Fs * desiredLength; % Samples/sec * sec = Samples
trimmedAudioMatrix = OriginalAutoioMatrix(1:L,:)
.
  댓글 수: 5
Sisi Misi
Sisi Misi 2021년 11월 1일
okay guys, it works
thank you so much for helping me
Star Strider
Star Strider 2021년 11월 1일
Our (collective) pleasure!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Code Generation and Deployment에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by