AudioTools - Maple Help

# Online Help

###### All Products    Maple    MapleSim

Home : Support : Online Help : Programming : Audio Processing : AudioTools/Duration

AudioTools

 Duration
 computes 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}{c}{\mathrm{1..19962 x 1..2}}{\mathrm{Array}}\\ {\mathrm{Data Type:}}{{\mathrm{float}}}_{{8}}\\ {\mathrm{Storage:}}{\mathrm{rectangular}}\\ {\mathrm{Order:}}{\mathrm{C_order}}\end{array}\right]$ (1)
 > $\mathrm{Duration}\left(\mathrm{aud}\right)$
 $\frac{{1109}}{{1225}}$ (2)
 > $\mathrm{evalf}\left(\right)$
 ${0.9053061224}$ (3)

 See Also

## Was this information helpful?

 Please add your Comment (Optional) E-mail Address (Optional) What is ? This question helps us to combat spam