Class ConferenceService
The conference service allows joining and leaving conferences as well as subscribing to conference events.
To use the conference service, follow these steps:
- Open a session using OpenAsync(UserInfo) from the SessionService..
- Subscribe to events exposed through the service, for example StatusUpdated and ParticipantUpdated.
- Create a conference using the CreateAsync(ConferenceOptions) method.
- Join the created conference using the JoinAsync(Conference, JoinOptions) method or use the ListenAsync(Conference, ListenOptions) method to join the conference as a listener.
- Leave the conference using the LeaveAsync() method.
Inherited Members
Namespace: DolbyIO.Comms.Services
Assembly: DolbyIO.Comms.Sdk.dll
Syntax
public sealed class ConferenceService
Properties
| Improve this Doc View SourceIsInConference
Gets whether the SDK is connected to a conference.
Declaration
public bool IsInConference { get; }
Property Value
Type | Description |
---|---|
Boolean |
|
Methods
| Improve this Doc View SourceCreateAsync(ConferenceOptions)
Creates a conference and returns information about the conference upon completion.
Declaration
public async Task<Conference> CreateAsync(ConferenceOptions options)
Parameters
Type | Name | Description |
---|---|---|
ConferenceOptions | options | The conference options. |
Returns
Type | Description |
---|---|
Task<Conference> | The Task<TResult> that represents the asynchronous operation. The Result property returns the newly created Conference. |
DeclineInvitationAsync(String)
Declines a conference invitation.
Declaration
public async Task DeclineInvitationAsync(string conferenceId)
Parameters
Type | Name | Description |
---|---|---|
String | conferenceId | The conference identifier. |
Returns
Type | Description |
---|---|
Task | A Task that represents the asynchronous operation. |
DemoAsync(SpatialAudioStyle)
Creates a demo conference and joins it upon completion.
Declaration
public async Task<Conference> DemoAsync(SpatialAudioStyle audioStyle = SpatialAudioStyle.Individual)
Parameters
Type | Name | Description |
---|---|---|
SpatialAudioStyle | audioStyle | The spatial audio style to be used in the demo conference. |
Returns
Type | Description |
---|---|
Task<Conference> | The Task<TResult> that represents the asynchronous operation. The Result property returns the joined Conference object. |
GetCurrentAsync()
Gets information about the current conference.
Declaration
public async Task<Conference> GetCurrentAsync()
Returns
Type | Description |
---|---|
Task<Conference> | The Task<TResult> that represents the asynchronous operation. The Result property returns the currently active Conference. |
GetParticipantsAsync()
Gets the list of participants that are present in the current conference.
Declaration
public async Task<List<Participant>> GetParticipantsAsync()
Returns
Type | Description |
---|---|
Task<List<Participant>> | The Task<TResult> that represents the asynchronous operation. The Result property returns a List<T> of Participant objects. |
JoinAsync(Conference, JoinOptions)
Joins an existing conference as a user.
Declaration
public async Task<Conference> JoinAsync(Conference conference, JoinOptions options)
Parameters
Type | Name | Description |
---|---|---|
Conference | conference | The conference object that represents the conference to join. |
JoinOptions | options | The join options for the current participant. |
Returns
Type | Description |
---|---|
Task<Conference> | The Task<TResult> that represents the asynchronous operation. The Result property returns the joined Conference object. |
LeaveAsync()
Leaves a conference.
Declaration
public async Task LeaveAsync()
Returns
Type | Description |
---|---|
Task | A Task that represents the asynchronous operation. |
ListenAsync(Conference, ListenOptions)
Joins an existing conference as a listener.
Declaration
public async Task<Conference> ListenAsync(Conference conference, ListenOptions options)
Parameters
Type | Name | Description |
---|---|---|
Conference | conference | The conference object that represents the conference to listen to. |
ListenOptions | options | The join options for the current participant. |
Returns
Type | Description |
---|---|
Task<Conference> | The Task<TResult> that represents the asynchronous operation. The Result property returns the joined Conference object. |
SendMessageAsync(String)
Sends a message to the current conference.
Declaration
public async Task SendMessageAsync(string message)
Parameters
Type | Name | Description |
---|---|---|
String | message | The message to send to the conference. |
Returns
Type | Description |
---|---|
Task | A Task that represents the asynchronous operation. |
Remarks
Attention: The message size is limited to 16KB.
SetSpatialDirectionAsync(Vector3)
Sets the direction the local participant is facing in space. This method is available only for participants who joined the conference using the join method with enabled spatial audio. To set a spatial direction for listeners, use the Set Spatial Listeners Audio REST API.
If the local participant hears audio from the position (0,0,0) facing down the Z-axis and locates a remote participant in the position (1,0,1), the local participant hears the remote participant from their front-right. If the local participant chooses to change the direction they are facing and rotate +90 degrees about the Y-axis, then instead of hearing the speaker from the front-right position, they hear the speaker from the front-left position.
For more information about spatial audio, see the Spatial Audio guide.
Declaration
public async Task SetSpatialDirectionAsync(Vector3 direction)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | direction | The direction the local participant is facing in space. |
Returns
Type | Description |
---|---|
Task | A Task that represents the asynchronous operation. |
SetSpatialEnvironmentAsync(Vector3, Vector3, Vector3, Vector3)
Configures a spatial environment of an application, so the audio renderer understands which directions the application considers forward, up, and right and which units it uses for distance. This method is available only for participants who joined a conference using the join method with enabled spatial audio. To set a spatial environment for listeners, use the Set Spatial Listeners Audio REST API. If not called, the SDK uses the default spatial environment, which consists of the following values:
- forward = (0, 0, 1), where +Z axis is in front
- up = (0, 1, 0), where +Y axis is above
- right = (1, 0, 0), where +X axis is to the right
- scale = (1, 1, 1), where one unit on any axis is 1 meter
For more information about spatial audio, see the Spatial Audio guide.
Declaration
public async Task SetSpatialEnvironmentAsync(Vector3 scale, Vector3 forward, Vector3 up, Vector3 right)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | scale | A scale that defines how to convert units from the coordinate system of an application (pixels or centimeters) into meters used by the spatial audio coordinate system. For example, if SpatialScale is set to (100,100,100), it indicates that 100 of the applications units (cm) map to 1 meter for the audio coordinates. In such a case, if the listener's location is (0,0,0)cm and a remote participant's location is (200,200,200)cm, the listener has an impression of hearing the remote participant from the (2,2,2)m location. |
Vector3 | forward | A vector describing the direction the application considers as forward. The value can be either +1, 0, or -1 and must be orthogonal to up and right. |
Vector3 | up | A vector describing the direction the application considers as up. The value can be either +1, 0, or -1 and must be orthogonal to forward and right. |
Vector3 | right | A vector describing the direction the application considers as right. The value can be either +1, 0, or -1 and must be orthogonal to forward and up. |
Returns
Type | Description |
---|---|
Task | A Task that represents the asynchronous operation. |
SetSpatialPositionAsync(String, Vector3)
Sets a participant's position in space to enable the spatial audio experience during a Dolby Voice conference. This method is available only for participants who joined the conference using the join method with enabled spatial audio. To set a spatial position for listeners, use the Set Spatial Listeners Audio REST API.
Depending on the specified participant in the participant parameter, the setSpatialPosition method impacts the location from which audio is heard or from which audio is rendered:
- When the specified participant is the local participant, setSpatialPosition sets a location from which the local participant listens to a conference. If the local participant does not have an established location, the participant hears audio from the default location (0, 0, 0).
- When the specified participant is a remote participant, setSpatialPosition ensures the remote participant's audio is rendered from the specified location in space. Setting the remote participants’ positions is required in conferences that use the individual spatial audio style. In these conferences, if a remote participant does not have an established location, the participant does not have a default position and will remain muted until a position is specified. The shared spatial audio style does not support setting the remote participants' positions. In conferences that use the shared style, the spatial scene is shared by all participants, so that each client can set a position and participate in the shared scene.
For example, if a local participant Eric, who uses the individual spatial audio style and does not have a set direction, calls setSpatialPosition(VoxeetSDK.session.participant, {x:3,y:0,z:0}), Eric hears audio from the position (3,0,0). If Eric also calls setSpatialPosition(Sophia, {x:7,y:1,z:2}), he hears Sophia from the position (7,1,2). In this case, Eric hears Sophia 4 meters to the right, 1 meter above, and 2 meters in front.
For more information about spatial audio, see the Spatial Audio guide.
Declaration
public async Task SetSpatialPositionAsync(string participantId, Vector3 position)
Parameters
Type | Name | Description |
---|---|---|
String | participantId | The selected participant. Using the local participant sets the location from which the participant will hear a conference. Using a remote participant sets the position from which the participant's audio will be rendered. |
Vector3 | position | The participant's audio location. |
Returns
Type | Description |
---|---|
Task | A Task that represents the asynchronous operation. |
Events
| Improve this Doc View SourceActiveSpeakerChange
Sets the ActiveSpeakerChangeEventHandler that is raised when an active speaker has changed.
_sdk.Conference.ActiveSpeakerChange += (string conferenceId, int count, string[] activeSpeakers) =>
{
}
Declaration
public event ActiveSpeakerChangeEventHandler ActiveSpeakerChange
Event Type
Type | Description |
---|---|
ActiveSpeakerChangeEventHandler | The ActiveSpeakerChangeEventHandler event handler. |
DvcError
Sets the DvcErrorEventHandler that is raised when an error related to the Dolby Voice Codec (DVC) occurs.
Declaration
public event DvcErrorEventHandler DvcError
Event Type
Type | Description |
---|---|
DvcErrorEventHandler | The DvcErrorEventHandler event handler. |
Examples
_sdk.Conference.DvcError += (string reason) =>
{
}
|
Improve this Doc
View Source
InvitationReceived
Sets the ConferenceInvitationReceivedEventHandler that is raised when a participant receives a conference invitation.
Declaration
public event ConferenceInvitationReceivedEventHandler InvitationReceived
Event Type
Type | Description |
---|---|
ConferenceInvitationReceivedEventHandler | The ConferenceInvitationReceivedEventHandler event handler. |
Examples
_sdk.Conference.InvitationReceived += (string conferenceId, string conferenceAlias, ParticipantInfo info) =>
{
}
|
Improve this Doc
View Source
MessageReceived
Sets the ConferenceMessageReceivedEventHandler that is raised when a participant receives a message.
Declaration
public event ConferenceMessageReceivedEventHandler MessageReceived
Event Type
Type | Description |
---|---|
ConferenceMessageReceivedEventHandler | The ConferenceMessageReceivedEventHandler event handler. |
Examples
_sdk.Conference.MessageReceived += (string conferenceId, string userId, ParticipantInfo info, string message) =>
{
}
|
Improve this Doc
View Source
ParticipantAdded
Sets the ParticipantAddedEventHandler that is raised when a new participant has been added to a conference.
_sdk.Conference.ParticipantAdded += (Participant participant) =>
{
}
Declaration
public event ParticipantAddedEventHandler ParticipantAdded
Event Type
Type | Description |
---|---|
ParticipantAddedEventHandler | The ParticipantAddedEventHandler event handler. |
ParticipantUpdated
Sets the ParticipantUpdatedEventHandler that is raised when a conference participant has changed a status.
_sdk.Conference.ParticipantUpdated += (Participant participant) =>
{
}
Declaration
public event ParticipantUpdatedEventHandler ParticipantUpdated
Event Type
Type | Description |
---|---|
ParticipantUpdatedEventHandler | The ParticipantUpdatedEventHandler event handler. |
PeerConnectionError
Sets the PeerConnectionErrorEventHandler that is raised when a peer connection problem occurs.
Declaration
public event PeerConnectionErrorEventHandler PeerConnectionError
Event Type
Type | Description |
---|---|
PeerConnectionErrorEventHandler | The PeerConnectionErrorEventHandler event handler. |
Examples
_sdk.Conference.PeerConnectionError += (string reason, string description) =>
{
}
|
Improve this Doc
View Source
StatusUpdated
Sets the ConferenceStatusUpdatedEventHandler that is raised when a conference status has changed.
See ConferenceStatus
_sdk.Conference.StatusUpdated += (ConferenceStatus status, string conferenceId) =>
{
}
Declaration
public event ConferenceStatusUpdatedEventHandler StatusUpdated
Event Type
Type | Description |
---|---|
ConferenceStatusUpdatedEventHandler | The ConferenceStatusUpdatedEventHandler event handler. |
VideoTrackAdded
Sets the VideoTrackAddedEventHandler that is raised when a VideoTrack is added.
Declaration
public event VideoTrackAddedEventHandler VideoTrackAdded
Event Type
Type | Description |
---|---|
VideoTrackAddedEventHandler |
VideoTrackRemoved
Sets the VideoTrackRemovedEventHandler that is raised when a VideoTrack is removed.
Declaration
public event VideoTrackRemovedEventHandler VideoTrackRemoved
Event Type
Type | Description |
---|---|
VideoTrackRemovedEventHandler |