# IRiSound Interface Reference

Inherits IDispatch.

List of all members.

## Public Member Functions
HRESULT | AddChannel ([out, retval] VARIANT *pvChannelId)
HRESULT | Add3DChannel ([out, retval] VARIANT *pvChannelId)
HRESULT | SetChannelVolume ([in] VARIANT vChannelId,[in] VARIANT vVolume)
HRESULT | SetChannelPan ([in] VARIANT vChannelId,[in] VARIANT vPan)
HRESULT | SetChannel3DPosition ([in] VARIANT vChannelId,[in] VARIANT vPos,[in] VARIANT vOrient)
HRESULT | SetChannelMinDistance ([in] VARIANT vChannelId,[in] VARIANT vVal)
HRESULT | SetChannelMaxDistance ([in] VARIANT vChannelId,[in] VARIANT vVal)
HRESULT | PlaySound ([in] VARIANT vChannelId,[in] VARIANT vSound,[in] VARIANT vPlayInLoop)
HRESULT | IsPlaying ([in] VARIANT vChannelId,[out, retval] VARIANT *pvVal)
HRESULT | RemoveChannel ([in] VARIANT vChannelId)

## Detailed Description

Sound name space allows you to play sound from scripts
Root-level name in the scripting engine's name space: RsSound

## Member Function Documentation

HRESULT IRiSound::AddChannel | ( | [out, retval] VARIANT * | pvChannelId | ) |

Call to create sound channel.

Parameters:

  | pvChannelId | - Returns the channel's ID. You will use this ID for future channel reference

Returns:
  Standard Error code

HRESULT IRiSound::Add3DChannel | ( | [out, retval] VARIANT * | pvChannelId | ) |

Call to create sound channel with 3D support.

Parameters:

  | pvChannelId | - Returns the channel's ID. You will use this ID for future channel reference

Returns:
  Standard Error code

HRESULT IRiSound::SetChannelVolume | ( | [in] VARIANT | vChannelId,
|  | [in] VARIANT | vVolume |
| ) |  |  |

Set volume for specified channel.

Parameters:

  | vChannelId | - Channel Id for which you want set the new volume
  | vVolume | - Volume for specified channel in percent (range from 0.0 to 1.0).

Returns:
  Standard Error code

HRESULT IRiSound::SetChannelPan | ( | [in] VARIANT | vChannelId,
|  | [in] VARIANT | vPan |
| ) |  |  |

Set pan for specified channel. This method may not be supported by current stream settings or your hardware.

Parameters:

  | vChannelId | - Channel Id for which you want set the new pan
  | vPan | - Pan for specified channel. The allowed range is from -1.0 to 1.0

Returns:
  Standard Error code

Remarks:
  Pan settings isn't used for 3D channels

HRESULT IRiSound::SetChannel3DPosition | ( | [in] VARIANT | vChannelId,
|  | [in] VARIANT | vPos,
|  | [in] VARIANT | vOrient |
| ) |  |  |

Set 3D channel's position in 3D space.

Parameters:

  | vChannelId | - Channel Id for which you want set the new position
  | vPos | - Position in 3D space (Point Data)
  | vOrient | - Front orientation vector (Point Data)

Returns:
  Standard Error code

HRESULT IRiSound::SetChannelMinDistance | ( | [in] VARIANT | vChannelId,
|  | [in] VARIANT | vVal |
| ) |  |  |

Set the minimum 3D distance in case you are using 3D sound channel

Parameters:

  | vChannelId | - Channel Id for which you want set the new volume
  | vVal | - Specify the distance for the channel.

Returns:
  Standard Error code

HRESULT IRiSound::SetChannelMaxDistance | ( | [in] VARIANT | vChannelId,
|  | [in] VARIANT | vVal |
| ) |  |  |

Set the maximum 3D distance in case you are using 3D sound channel

Parameters:

  | vChannelId | - Channel Id for which you want set the new volume
  | vVal | - Specify the distance for the channel.

Returns:
  Standard Error code

HRESULT IRiSound::PlaySound | ( | [in] VARIANT | vChannelId,
|  | [in] VARIANT | vSound,
|  | [in] VARIANT | vPlayInLoop |
| ) |  |  |

Play sound through specified sound channel.

Parameters:

  | vChannelId | - Channel Id
  | vSound | - The object to play (Sound Data) or full connector ID that contains the sound stored in data object (

See also:
  IRdSoundDisp).

Parameters:

  | vPlayInLoop | - Play sound in loop

Returns:
  Standard Error code

Remarks:
  If you want to play sound in 3D, specify sound only with 1 channel. Otherwise the sound will play but not as 3D.

HRESULT IRiSound::IsPlaying | ( | [in] VARIANT | vChannelId,
|  | [out, retval] VARIANT * | pvVal |
| ) |  |  |

Find if channel is playing a sound.

Parameters:

  | vChannelId | - Channel Id that you want to check.
  | bVal | - Returns TRUE if a sound is playing.

Returns:
  Standard Error code

HRESULT IRiSound::RemoveChannel | ( | [in] VARIANT | vChannelId | ) |

Stop play the channel and remove it.

Parameters:

  | vChannelId | - Channel Id that you want to remove.

Returns:
  Standard Error code