Microphone Component - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.
Our website is currently undergoing maintenance, which may result in occasional errors while browsing. We apologize for any inconvenience this may cause and are working swiftly to restore full functionality. Thank you for your patience.

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Document Tools : Components : Microphone Component

DocumentTools[Components]

  

Microphone

  

generate XML for a Microphone Component

 

Calling Sequence

Parameters

Options

Description

Examples

Compatibility

Calling Sequence

Microphone( opts )

Parameters

opts

-

(optional) ; one or more keyword options as described below

Options

• 

enabled : truefalse:=true; Indicates whether the component is enabled. The default is true. If enabled is false then the inserted component is grayed out and interaction with it cannot be initiated.

• 

identity : {name,string}; The reference name of the component.

• 

record : truefalse:=false; Indicates whether the component is initially recording. The default value is false.

• 

samplerate : posint:=16000; The sample rate at which audio data is played. The default value is 16000.

• 

stereo : truefalse:=false; Indicates whether audio data is played on two channels (true) or on one channel (false). The default value is false.

• 

tooltip : string:=""; The text that appears when the mouse pointer hovers over the component. The default is the empty string (no tooltip).

• 

visible : truefalse:=true; Indicates whether the component is visible. The default is true.

Description

• 

The Microphone command in the Component Constructors package returns an XML function call which represents a Microphone Component.

• 

The generated XML can be used with the results of commands in the Layout Constructors package to create an entire Worksheet or Document in XML form. Such a representation of a Worksheet or Document can be inserted into the current document using the InsertContent command.

Examples

withDocumentTools:

withDocumentTools:-Components:

withDocumentTools:-Layout:

Executing the Microphone command produces a function call.

SMicrophoneidentity=Microphone0

S_XML_EC-Microphoneid=Microphone0,enabled=true,visible=true,samplerate=16000,stereo=false,record=false

(1)

By using commands from the Layout Constructors package a nested function call can be produced which represents a worksheet.

xmlWorksheetGroupInputTextfieldS:

That XML representation of a worksheet can be inserted directly.

InsertContentxml:

 

SMicrophoneidentity=Microphone0,tooltip=My microphone,stereo=false:

xmlWorksheetGroupInputTextfieldS:

The previous example's call to the InsertContent command inserted a component with identity "Microphone0", which still exists in this worksheet. Inserting additional content whose input contains another component with that same identity "Microphone0" incurs a substitution of the input identity in order to avoid a conflict with the identity of the existing component.

The return value of the following call to InsertContent is a table which can be used to reference the substituted identity of the inserted component.

lookupInsertContentxml,output=table

lookuptableMicrophone0=Microphone1

(2)

 

lookupMicrophone0

Microphone1

(3)

GetPropertylookupMicrophone0,stereo

false

(4)

Compatibility

• 

The DocumentTools:-Components:-Microphone command was introduced in Maple 2015.

• 

For more information on Maple 2015 changes, see Updates in Maple 2015.

See Also

Component Code

Component Constructors

DocumentTools

Embedded Components

Layout Constructors

XMLTools