Question
hello! I am trying to import an audio sample into matlab and get matlab to tell me the length of the sample. Please can someone help me with this ,
Expert Answer
Prashant Kumar
PhD Expert
Answered Sep 12, 2026
Just in case you got a wave file
[y, Fs, nbits] = wavread(filename) %load the wav [m d] = wavfinfo(filename) %get the wav information
Another way to get the length in seconds is:
siz = wavread(filename,'size') %siz = [samples channels] siz(1)/Fs %should give you the length in seconds
100% Run Guarantee
3-Hour Fast-Track Delivery
Need a Custom Version or Complete Simulation for This Problem?
Our 500+ PhD engineers build, debug, and optimize working MATLAB scripts and Simulink (.slx) models tailored to your exact assignment rubrics with zero plagiarism.
Tested on MATLAB R2024b / R2026a
Turnitin 0% Plagiarism Report
Free 7-Day Revisions Guarantee
Have a different question? Ask here
Related audio Questions & Solutions
Browse All →
Explore similar technical troubleshooting questions and verified MATLAB solutions:
Ready-to-Run MATLAB & Simulink Projects
Browse All Projects →