Programmer Guide/Command Reference/SEGMENT: Difference between revisions
From STX Wiki
Jump to navigationJump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:{{SUBPAGENAME}}}} | {{DISPLAYTITLE:{{SUBPAGENAME}}}} | ||
;Usage: | |||
'''1.''' Evaluate the segment expression <var>segexpr</var>, using the sampling rate and the length of the current soundfile (see [[../LOAD|LOAD SOUNDFILE]]). | '''1.''' Evaluate the segment expression <var>segexpr</var>, using the sampling rate and the length of the current soundfile (see [[../LOAD|LOAD SOUNDFILE]]). | ||
:<code>SEGMENT <var>segexpr</var> [/S | /?]</code> | :<code>SEGMENT <var>segexpr</var> [/S | /?]</code> | ||
Line 14: | Line 15: | ||
:;<var>segtag</var>:the xml element tag used for segment definitions | :;<var>segtag</var>:the xml element tag used for segment definitions | ||
:;<var>idattr, pattr, lattr</var>:the xml attributes used in the segment definition elements to specifiy the segment id (<var>idattr</var>) and its starting position (<var>pattr</var>) and length (<var>lattr</var>) | :;<var>idattr, pattr, lattr</var>:the xml attributes used in the segment definition elements to specifiy the segment id (<var>idattr</var>) and its starting position (<var>pattr</var>) and length (<var>lattr</var>) | ||
;Result: | |||
:*success: <code>''bseg eseg lseg''</code> - the return value is the begin (''bseg''), end (''eseg'') and length (''lseg'') of the segment specified by the segment expression. The variable <code>RC</code> is set to 0. | |||
:*error: the command returns the empty string and the error- or warning-code is stored in variable <code>RC</code> | |||
: | |||
: | |||
: | |||
: | |||
<code> | |||
Revision as of 08:23, 27 April 2011
- Usage
1. Evaluate the segment expression segexpr, using the sampling rate and the length of the current soundfile (see LOAD SOUNDFILE).
SEGMENT segexpr [/S | /?]
- segexpr
- the segment expression to be evaluated
/S
,/?
- silent error handling; generate warnings rather than errors.
2. Evaluate the segment expression segexpr, using the specified sampling rate and length.
SEGMENT segexpr sr l [/S | /?]
- sr
- sampling rate in Hz
- l
- maximum signal duration in samples
3. Evaluate the segment expression segexpr, using the sampling rate and the segment definitions stored in the xml-file item xitem.
SEGMENT segexpr xmlfile srattr segtag idattr pattr lattr
- xmlfile
- a xml-file item containing the metadata; the selected element must contain soundfile metadata and the segment definitions must be stored as child elements
- srattr
- the xml attribute of the selected element containing the sampling rate (in Hz)
- segtag
- the xml element tag used for segment definitions
- idattr, pattr, lattr
- the xml attributes used in the segment definition elements to specifiy the segment id (idattr) and its starting position (pattr) and length (lattr)
- Result
-
- success:
bseg eseg lseg
- the return value is the begin (bseg), end (eseg) and length (lseg) of the segment specified by the segment expression. The variableRC
is set to 0. - error: the command returns the empty string and the error- or warning-code is stored in variable
RC
- success: