How to cut the last 20 seconds of a audio file?

조회 수: 46 (최근 30일)
valerio riso
valerio riso 2018년 2월 19일
댓글: Ayesha 2022년 11월 3일
How to cut the last 20 seconds of a audio file?

답변 (1개)

Venkata Siva Krishna Madala
Venkata Siva Krishna Madala 2018년 2월 22일
Hello Valerio Riso,
I understand that you want to cut the last 20 seconds of a audio file using MATLAB.
I have written a sample code which will perform the task.
filename='yourfilenamewithextension'
[y, fs]=audioread(filename);
samples=[1,length(y)-(20*fs)];%replace 20 with the number of seconds you need to cut
[y1,fs] = audioread(filename,samples);
audiowrite('cutversion',y1,fs);
You can play around with samples in the code to change the duration of the audio you want to extract.
- Venkata Siva Krishna Madala
  댓글 수: 2
valerio riso
valerio riso 2018년 2월 24일
Thank you!
Ayesha
Ayesha 2022년 11월 3일
how can I take only a small portion of the audio signal, about 500 consecutive points, and repeat this portion 10 times using the repmat command?

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

카테고리

Help CenterFile Exchange에서 Audio I/O and Waveform Generation에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by