extracts a piece of an audio recording
the Array, Vector, or Matrix containing the audio data
the time period to extract
The Extract command extracts a piece of an audio recording and returns a new audio object containing the extracted piece.
The audArray parameter must be a dense, rectangular, one or two dimensional Array, Vector, or Matrix with datatype=float.
The timeRange parameter can be either a number, or a range of numbers. In either case, positive values refer to times relative to the beginning of audArray, whereas negative values refer to times relative to the end of audArray.
If a number is specified, Extract extracts that many seconds from the beginning (if positive) or end (if negative) of audArray.
If a range is specified, the data between those two points in time is extracted. Negative values are treated as described above.
Because Extract can only work to the nearest whole sample, the precise duration of the result may be slightly more or less than what was specified by timeRange.
audiofile ≔ cat⁡kernelopts⁡datadir,/audio/stereo.wav:
aud ≔ Read⁡audiofile
aud ≔ 1..19962 x 1..2 ArrayData Type: floatStorage: rectangularOrder: C_order
dur ≔ evalf⁡Duration⁡aud
dur ≔ 0.9053061224
middle ≔ Extract⁡aud,0.1..−0.1
middle ≔ 1..15553 x 1..2 ArrayData Type: floatStorage: rectangularOrder: C_order
last_quarter_sec ≔ Extract⁡aud,−0.25
last_quarter_sec ≔ 1..5512 x 1..2 ArrayData Type: floatStorage: rectangularOrder: C_order
Download Help Document
What kind of issue would you like to report? (Optional)
Thank you for submitting feedback on this help document. Your feedback will be used
to improve Maple's help in the future.