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

46 visualizaciones (últimos 30 días)
valerio riso
valerio riso el 19 de Feb. de 2018
Comentada: Ayesha el 3 de Nov. de 2022
How to cut the last 20 seconds of a audio file?

Respuestas (1)

Venkata Siva Krishna Madala
Venkata Siva Krishna Madala el 22 de Feb. de 2018
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 comentarios
valerio riso
valerio riso el 24 de Feb. de 2018
Thank you!
Ayesha
Ayesha el 3 de Nov. de 2022
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?

Iniciar sesión para comentar.

Categorías

Más información sobre Audio I/O and Waveform Generation en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by