How to Calculate Total Audio Duration in a PowerPoint Presentation Using WPS Office
Question details
The user needs to calculate the combined playback duration of every audio clip in a PowerPoint presentation because no standard command shows the total.

- Product
- WPS Office Presentation / Microsoft PowerPoint
- Device & OS
- not provided
- Scenario
- The user has a presentation with several embedded audio clips and needs the total audio duration for timing, review, or export planning.
- Observed behavior
- PowerPoint and WPS Presentation do not display a built-in combined audio duration; individual audio lengths must be collected manually or calculated with a VBA macro.
Open the presentation in WPS Office or PowerPoint, enable the Developer tab, and save a copy as a macro-enabled .pptm file if you plan to run VBA code. This keeps the macro available and avoids losing it when the file is closed.
Use a VBA Macro to Sum All Embedded Audio Durations
Best for presentations with many audio clips because it totals every exposed media file automatically.
PowerPoint and WPS Presentation do not have a standard total-duration command, but the object model exposes the MediaFormat.Length property for embedded sound shapes. The following macro loops through all slides, finds sound media shapes, and adds their lengths.
In PowerPoint or WPS Presentation, press Alt+F11 to open the Microsoft Visual Basic for Applications editor.
In the VBA editor, click Insert > Module to create a new module.
Paste the following code into the module, then click Run > Run Sub/UserForm or press F5: Sub TotalAudioDuration() Dim sld As Slide Dim shp As Shape Dim total As Double total = 0 For Each sld In ActivePresentation.Slides For Each shp In sld.Shapes If shp.Type = msoMedia Then If shp.MediaType = ppMediaTypeSound Then total = total + shp.MediaFormat.Length End If End If Next shp Next sld MsgBox "Total audio duration: " & Format(total / 60, "0.00") & " minutes" End Sub
A message box displays the total audio duration in minutes; record the result for your timing or export workflow.

Manually Add Duration from Audio Tools Playback Tab
Use when you have only a few audio clips and prefer not to run macros.
Calculate Total Audio Duration in WPS Presentation with a VBA Macro
Open the same PowerPoint file in WPS Office and use the built-in VBA editor to total the duration of all embedded sound clips. WPS Presentation reads .pptx media objects, so you can get the total playback time without changing your workflow.
- 1. Open the presentation in WPS Office: Launch WPS Presentation, click File > Open, and select the .pptx or .pptm file containing the audio clips.
- 2. Enable the Developer tab: Right-click the ribbon, choose Customize Ribbon, and enable the Developer option so you can access macro tools.
- 3. Insert and run the VBA macro: Press Alt+F11 to open the VBA editor, click Insert > Module, paste the total audio duration macro, and press F5 to run it.
- 4. Review the total duration: Read the message box result and use the total for timing, review, or export planning.

Frequently Asked Questions
Does PowerPoint have a built-in total audio duration calculator?
No. PowerPoint and WPS Presentation do not show a combined audio duration by default. You need to run a VBA macro or manually add the Duration values from the Audio Tools Playback tab.
Why does the VBA macro skip some audio files?
The object model only exposes embedded sound objects. Audio inserted as linked files or through certain add-ins may not be returned, so those files must be checked manually.
Can I calculate total audio duration in WPS Presentation?
Yes. Open the .pptx file in WPS Presentation, enable the Developer tab, press Alt+F11 to open the VBA editor, and run the same MediaFormat.Length macro.
Will this method include video clips?
Not with the sound macro. It checks ppMediaTypeSound only. To include video, change the condition to ppMediaTypeVideo or add a separate video-duration macro.
How do I make sure the macro is saved with my presentation?
Save the file as a PowerPoint Macro-Enabled Presentation (.pptm). In WPS Office, use File > Save As and choose the macro-enabled format so the VBA code is retained.




