How to trim audio in Matlab to get the desired audio duration?
44 views (last 30 days)
Show older comments
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
0 Comments
Accepted Answer
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
More Answers (0)
See Also
Categories
Find more on Simulation, Tuning, and Visualization in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!