CaptionTracks

IAudioFrame.CaptionTracks property

Gets the collection of closed captions associated with the audio frame. This property is read-only and returns an ICaptionsCollection containing all caption tracks.

public ICaptionsCollection CaptionTracks { get; }

Examples

Example:

[C#]
using (Presentation pres = new Presentation("audio with captions.pptx"))
{
    foreach (IShape shape in pres.Slides[0].Shapes)
    {
        if (shape is IAudioFrame audioFrame)
        {
            // Save the caption track's binary data as a .vtt file
            foreach (var captionTrack in audioFrame.CaptionTracks)
                File.WriteAllBytes(captionTrack.CaptionId + ".vtt", captionTrack.BinaryData);
        }
    }
}

See Also