Others

How to Calculate Total Audio Duration in a PowerPoint Presentation Using WPS Office

Nimra MalikNimra Malik Nov 13, 2026 869 views

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.

How to Calculate Total Audio Duration in a PowerPoint Presentation Using WPS Office
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.
Before you start

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.

Solution 1Recommended

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.

1
Open the VBA editor

In PowerPoint or WPS Presentation, press Alt+F11 to open the Microsoft Visual Basic for Applications editor.

2
Insert a module

In the VBA editor, click Insert > Module to create a new module.

3
Paste and run the duration macro

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

4
Read the total

A message box displays the total audio duration in minutes; record the result for your timing or export workflow.

Use a VBA Macro to Sum All Embedded Audio Durations
Linked audio may be excluded: The macro reports sound media exposed through the object model. Linked or externally referenced audio clips may not be counted, so check those clips manually.
WPS Office direct solution

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. 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. 2. Enable the Developer tab: Right-click the ribbon, choose Customize Ribbon, and enable the Developer option so you can access macro tools.
  3. 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. 4. Review the total duration: Read the message box result and use the total for timing, review, or export planning.
Calculates total embedded audio duration with a reusable VBA macroOpens and saves PowerPoint .pptx files without format conversionFree, lightweight Office suite with a familiar ribbon interfaceCompatible with PowerPoint audio, video, and slide media propertiesKeeps the original presentation structure and object model intact
microsoft office alternative - wps office

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.