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

44 visualizzazioni (ultimi 30 giorni)
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

Risposta accettata

Star Strider
Star Strider il 31 Ott 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 Commenti
Sisi Misi
Sisi Misi il 1 Nov 2021
okay guys, it works
thank you so much for helping me

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Simulation, Tuning, and Visualization in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by