You can use audioread
function to read the audio files and dir
function to get the files in a directory. To get the length of each file, you can use the length
function on the audio data.
Here's an example code:
main.m588 chars18 lines
This code reads all the audio files in the audio_files
directory with .wav
extension, and then prints out the length (in seconds) of each file.
gistlibby LogSnag