MARS Client Scripting Library - MarsVoice
From Multiverse
| MARS Client Scripting Library | |
|
MarsAbility
|
MarsQuest
|
| Additional Modules | |
| MarsStandardCommands | |
| Examples | |
| InstancePortal | |
MarsVoice is a module in the Mars Client Scripting API built on top of the Client Scripting API - Voice module. It provides a higher level interface for managing voice settings independent of a VoiceManager instance.
Methods
GetAllInputDevices
deviceList = GetAllInputDevices()
Returns a list of all available input devices. The index of each entry in the list is the device number.
Returns
A list of all output device names.
Parameters
None
GetAllOutputDevices
deviceList = GetAllOutputDevices()
Returns a list of all available output devices. The index of each entry in the list is the device number.
Returns
A list of all output device names.
Parameters
None
GetInputDevice
index = GetInputDevice()
Returns the integer device number for the current voice input device. See also SetInputDevice.
Returns
The integer device number for the voice input device.
Parameters
None
GetInputDeviceName
device = GetInputDeviceName()
Returns a string containing the name of the currently selected input device.
Returns
The name of the currently selected input device.
Parameters
None
GetInputEnabled
enabled = GetInputEnabled()
Returns True if the module is configured to send voice data. See also SetInputEnabled.
Returns
True if the module is configured to send voice data.
Parameters
None
GetInputLevel
level = GetInputLevel()
Returns a floating point number representing the current default input level for voice channels. This is a number between 0.0 and 2.0 with 1.0 being the default value. See also SetInputLevel.
Returns
The float default input level for voice channels.
Parameters
None
GetOutputDevice
index = GetOutputDevice()
Returns the integer device number for the current voice output device. See also SetOutputDevice.
Returns
The integer device number for the voice output device.
Parameters
None
GetOutputDeviceName
device = GetOutputDeviceName()
Returns a string containing the name of the currently selected output device.
Returns
The name of the currently selected output device.
Parameters
None
GetOutputLevel
level = GetOutputLevel()
Returns a floating point number representing the current default output level for voice channels. This is a number between 0.0 and 10.0 with 1.0 being the default value. See also SetOutputLevel.
Returns
The float default output level for voice channels.
Parameters
None
GetPushToTalkState
pttState, pttLocked, pttLockState = GetPushToTalkState()
Gets the current push-to-talk state, whether it is locked, and what it is locked to.
Returns
(bool, bool, bool)
Parameters
None
GetTestMode
enabled = GetTestMode()
Returns True if the module is configured to enable test mode. Test mode sets the "listen_to_yourself" parameter, which causes the voice server to select the voice data channel this client generates as one of the voice data channels to send back to it. See also SetTestMode.
Returns
True if the module is configured to enable test mode.
Parameters
None
GetVoiceEnabled
enabled = GetVoiceEnabled()
Returns True if the module is configured to connect to the voice server. See also SetVoiceEnabled.
Returns
True if the module is configured to connect to the voice server.
Parameters
None
GetVoiceGroupOid
GetVoiceGroupOid()
Get the player's current voice group. See also SetVoiceGroupOid.
Returns
The OID of the player's voice group.
Parameters
None
JoinVoiceGroup
JoinVoiceGroup( groupOID )
Join the specified voice group.
| Parameter | Datatype | Default Value | Description |
|---|---|---|---|
| OID | integer | N/A | Value to which to set the player's voice group OID. |
LockPushToTalk
LockPushToTalk( nowTalking )
Lock the push-to-talk setting to on or off, based on the Boolean value nowTalking. This overrides the value set with PushToTalk() until UnlockPushToTalk() is called.
See also UnlockPushToTalk.
Returns
No return value.
Parameters
| Parameter | Datatype | Default Value | Description |
|---|---|---|---|
| nowTalking | bool | N/A | True to enable sending voice data. |
PushToTalk
PushToTalk(nowTalking)
If nowTalking is True, enable the sending of voice packets.
Returns
No return value.
Parameters
| Parameter | Datatype | Default Value | Description |
|---|---|---|---|
| nowTalking | bool | N/A | True to enable sending voice data. |
SetInputDevice
SetInputDevice(index)
Sets the device to use for voice input. See also GetInputDevice.
Returns
No return value.
Parameters
| Parameter | Datatype | Default Value | Description |
|---|---|---|---|
| index | float | N/A | The device number to use for voice input. |
SetInputEnabled
SetInputEnabled(enabled)
If enabled is True, the module will enable the input device for voice.
See also GetInputEnabled.
Returns
No return value.
Parameters
| Parameter | Datatype | Default Value | Description |
|---|---|---|---|
| enabled | bool | N/A | True to enable voice input. |
SetInputLevel
SetInputLevel(level)
Sets the default input level for voice channels. This is a number between 0.0 and 2.0 with 1.0 being the default value. See also GetInputLevel.
Returns
No return value.
Parameters
| Parameter | Datatype | Default Value | Description |
|---|---|---|---|
| level | float | N/A | The input level to set for voice channels. |
SetOutputDevice
SetOutputDevice(index)
Sets the device to use for voice output. See also GetOutputDevice.
Returns
No return value.
Parameters
| Parameter | Datatype | Default Value | Description |
|---|---|---|---|
| index | float | N/A | The device number to use for voice output. |
SetOutputLevel
SetOutputLevel(level)
Sets the default output level for voice channels. This is a number between 0.0 and 10.0 with 1.0 being the default value. See also GetOutputLevel.
Returns
No return value.
Parameters
| Parameter | Datatype | Default Value | Description |
|---|---|---|---|
| level | float | N/A | The output level to set for voice channels. |
SetParameters
SetParameters(parms)
Adds arbitrary voice parameters to the configured set.
Returns
No return value.
Parameters
| Parameter | Datatype | Default Value | Description |
|---|---|---|---|
| parms | dict | N/A | A dictionary containing parameters to add to the voice manager configuration. |
SetTestMode
SetTestMode(enabled)
If enabled is True, the module will enable test mode. Test mode sets the "listen_to_yourself" parameter, which causes the voice server to select the voice data channel this client generates as one of the voice data channels to send back to it.
See also GetTestMode.
Returns
No return value.
Parameters
| Parameter | Datatype | Default Value | Description |
|---|---|---|---|
| enabled | bool | N/A | True to enable test mode. |
SetVoiceEnabled
SetVoiceEnabled(enabled)
If enabled is True, connects to the voice server and enables voice channels. If enabled
is false, disconnects from the voice server and disables voice.
See also GetVoiceEnabled.
Returns
No return value.
Parameters
| Parameter | Datatype | Default Value | Description |
|---|---|---|---|
| enabled | bool | N/A | True to connect to the voice server, False to disconnect |
SetVoiceGroupOid
SetVoiceGroupOid( OID )
Set the player's current voice group. See also GetVoiceGroupOid.
Returns
No return value.
Parameters
| Parameter | Datatype | Default Value | Description |
|---|---|---|---|
| OID | integer | N/A | Value to which to set the player's voice group OID. |
UnlockPushToTalk
UnlockPushToTalk()
Unlock the push-to-talk setting. See also LockPushToTalk.
Returns
No return value.
Parameters
None
Events
The MarsVoice module generates the following UI events:
VOICE_CONNECT
This event is generated whenever the voice manager connects to or disconnects from a voice server.
Arguments
None
VOICE_ALLOCATION
This event is generated whenever the configuration of the voice manager changes.
Arguments
playerOid
VOICE_DEALLOCATION
This event is generated whenever the user disables the client voice manager.
Arguments
playerOid
Messages
The MarsVoice module uses the following extension messages:
-
voice_parms_response
