Duration - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

AudioTools

 Duration
 compute the duration of a recording, in seconds

 Calling Sequence Duration(audArray)

Parameters

 audArray - Array, Vector, or Matrix containing the audio data

Description

 • The Duration command computes the duration of an audio recording, in seconds, based on the number of samples, and the samples per second as stored in the attributes of audArray.
 • The audArray parameter must be a dense, rectangular, one or two dimensional Array, Vector, or Matrix with datatype=float[8],

Examples

 > $\mathrm{audiofile}≔\mathrm{cat}\left(\mathrm{kernelopts}\left(\mathrm{datadir}\right),"/audio/stereo.wav"\right):$
 > $\mathrm{with}\left(\mathrm{AudioTools}\right):$
 > $\mathrm{aud}≔\mathrm{Read}\left(\mathrm{audiofile}\right)$
 ${\mathrm{aud}}{≔}\left[\begin{array}{cc}{"Sample Rate"}& {22050}\\ {"File Format"}& {\mathrm{PCM}}\\ {"File Bit Depth"}& {8}\\ {"Channels"}& {2}\\ {"Samples/Channel"}& {19962}\\ {"Duration"}& {0.90531}{}{s}\end{array}\right]$ (1)
 > $\mathrm{Duration}\left(\mathrm{aud}\right)$
 $\frac{{1109}}{{1225}}$ (2)
 > $\mathrm{evalf}\left(\right)$
 ${0.9053061224}$ (3)