How to cut the last 20 seconds of a audio file?
8 次查看(过去 30 天)
显示 更早的评论
How to cut the last 20 seconds of a audio file?
0 个评论
回答(1 个)
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 个评论
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 Center 和 File 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!