By Tim King · Updated
Audio Duration Sum
Total Length of Audio Files, With Gaps, Average and Longest, Export CSV
OneTask is free, with no sign-up, and built by one person.
If this tool saved you time, a coffee helps keep new ones coming.
How the Audio Duration Sum works
This audio duration sum tool totals the length of many files. Drop a folder's worth of audio files in and the stats add them up: the total running time in hours, minutes and seconds and in plain seconds, the total with a gap of your choosing between each file, the average, the longest and shortest file by name, and the combined size. Enter a time limit in minutes and it tells you how many files, in list order, fit inside it and how much is left over. Press Export for a CSV of every file.
Audio duration sum: what to know first
Adding up durations by hand is the kind of arithmetic that goes wrong every time: minutes and seconds do not carry in tens, file managers round to the nearest second or hide the length column entirely, and a batch of forty files is forty chances to mistype. Yet the question comes up constantly — will this set of tracks fit on a CD or a cassette side, how long is the podcast season, how many hours of interviews are in this folder, does the playlist run past the end of the event, how much recording is left to transcribe.
What is measured. Every file is decoded in the browser, so the length comes from the actual audio samples rather than from a header, and files that report a wrong duration in their metadata — variable-bitrate MP3s are the classic case — are counted correctly. The total duration is the sum of every file, shown as h:mm:ss.ss and again in seconds for pasting into a spreadsheet. Average, longest and shortest follow, the last two naming the file so an outlier is easy to spot. Total size is the sum of the file sizes on disk in megabytes.
Gaps. A playlist, a CD or a broadcast rarely runs the files back to back; there is a pause of a second or two between tracks, or a longer sting or ident in a radio schedule. Set the gap and the with gaps line adds that many seconds between each pair of adjacent files — one fewer gap than there are files — so the figure matches what the finished programme will actually run to.
Fitting into a limit. Enter a number of minutes in fit into and the tool walks down the list in order, adding each file and its gap, and stops at the first one that would overshoot. The stats then say how many of the files fit, how long that set runs, and either how much time is spare or how far the complete batch is over the limit. The limit is optional; leave it blank and the line is omitted. Typical values are 80 for a CD-R, 45 for a cassette side, 60 for an hour-long slot, or whatever the venue gave you. Because the walk is in list order, arrange the files the way they will play and drop them in that order.
The CSV. The export lists every file with its index, name, duration in seconds and as a clock time, channel count, sample rate, size in bytes and the cumulative time at which it ends, gaps included. Two footer lines give the grand total with and without gaps. Open it in a spreadsheet to sort, filter or plan a running order, or feed it to a script that builds a cue sheet.
Limits. Every file is fully decoded, so a very large batch of long files takes a moment and needs memory in proportion; a few hundred podcast episodes is fine, a whole music library is better done a folder at a time. Only formats the browser can decode are counted, which covers MP3, WAV, FLAC, OGG and AAC in every current browser.
FAQ
Why is the total different from what my file manager says?
File managers read the duration from the header, which for variable-bitrate MP3s and some badly written files is an estimate. This tool decodes the audio and counts the samples, which is the true length.
Does the order of the files matter?
Only for the fit into calculation, which takes files from the top of the list until the limit is reached, and for the cumulative column in the CSV. The totals, average, longest and shortest are the same in any order.
Can I mix formats?
Yes. MP3, WAV, FLAC, OGG, M4A and anything else the browser can decode are all counted together, and the CSV shows each file's channels and sample rate so mixed batches are easy to check.
Is the gap added after the last file?
No. Gaps go between files, so five files get four gaps. If the programme also needs silence at the very end, add one gap's worth yourself or pad the last file with the Audio Padder.
See also: all Audio tools, Images, Video & Screen, PDF, SVG, Simulations & Screensavers, Generative Art, Chart Makers, 3D Model Viewers, Drawing Pads, Mockups & 3D Making, Diagram Makers, 3D Science, Tracker Music.
Related tools
Audio Info Inspector
Read the sample rate, channels, bitrate and levels of any audio file.
Audio Joiner
Merge several audio files into one, in order, with optional gaps.
Silence Finder
Find and timestamp every silent gap in a recording.
Ambient Sound Mixer
Mix rain, wind, waves, fire, stream and crickets into your own soundscape.
Audio Channel Swapper
Swap stereo channels, copy one side to both, or invert polarity.