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

44 visualizaciones (últimos 30 días)
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

Respuesta aceptada

Star Strider
Star Strider el 31 de Oct. de 2021
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 comentarios
Sisi Misi
Sisi Misi el 1 de Nov. de 2021
okay guys, it works
thank you so much for helping me

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Simulation, Tuning, and Visualization 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