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

46 views (last 30 days)
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

Accepted Answer

Star Strider
Star Strider on 31 Oct 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 Comments

Sign in to comment.

More Answers (0)

Categories

Find more on Simulation, Tuning, and Visualization in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!