Skip to content

get_Duration

James Brundage edited this page Oct 23, 2026 · 1 revision

get_Duration

Gets Wave Duration

Gets the duration of a wave file.

This should be the length of it's PCM data, divided by bytes per second.

View Source
<#
.SYNOPSIS
    Gets Wave Duration        
.DESCRIPTION
    Gets the duration of a wave file.

    This should be the length of it's PCM data, divided by bytes per second.
#>
$bps = $this.BytesPerSecond
if ($bps) {
    [TimeSpan]::FromSeconds($this.'#data'.length / $bps)
}

Clone this wiki locally