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

Online Help

All Products    Maple    MapleSim


AudioTools

  

Extract

  

extract a piece of an audio recording

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

Extract(audArray, timeRange)

Parameters

audArray

-

the Array, Vector, or Matrix containing the audio data

timeRange

-

the time period to extract

Description

• 

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[8].

• 

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.

Examples

audiofilecatkerneloptsdatadir,/audio/stereo.wav:

withAudioTools:

audReadaudiofile

audSample Rate22050File FormatPCM File Bit Depth8Channels2Samples/Channel19962Duration0.90531s

(1)

durevalfDurationaud

dur0.9053061224

(2)

middleExtractaud,0.1..0.1

middleSample Rate22050File FormatPCM File Bit Depth8Channels2Samples/Channel15553Duration0.70535s

(3)

evalfDurationmiddle

0.7053514739

(4)

last_quarter_secExtractaud,0.25

last_quarter_secSample Rate22050File FormatPCM File Bit Depth8Channels2Samples/Channel5512Duration0.24998s

(5)

evalfDurationlast_quarter_sec

0.2499773243

(6)

See Also

Array

AudioTools

AudioTools[Duration]

Matrix

Vector