Interface IAudioClient<T>
Namespace: Adrenak.UniVoice
Assembly: cs.temp.dll.dll
Syntax
public interface IAudioClient<T> : IDisposable
Type Parameters
Name | Description |
---|---|
T |
Properties
ID
The clients peer ID in the voice chat
Declaration
T ID { get; }
Property Value
Type | Description |
---|---|
T |
PeerIDs
IDs of all the peers (except this client) in the voice chat
Declaration
List<T> PeerIDs { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<T> |
YourVoiceSettings
The voice settings of this client. Call SubmitVoiceSettings() after making changes to this object to submit the updates to the server.
Declaration
VoiceSettings YourVoiceSettings { get; }
Property Value
Type | Description |
---|---|
VoiceSettings |
Methods
SendAudioFrame(AudioFrame)
Sends an audio frame to the server for being broadcasted to the other peers
Declaration
void SendAudioFrame(AudioFrame frame)
Parameters
Type | Name | Description |
---|---|---|
AudioFrame | frame | The audio frame to be sent |
SubmitVoiceSettings()
Submits YourVoiceSettings to the server
Declaration
void SubmitVoiceSettings()
Events
OnJoined
Fired when this client connects and joins the voice chat Includes the following parameters
Declaration
event Action<T, List<T>> OnJoined
Event Type
Type | Description |
---|---|
System.Action<T, System.Collections.Generic.List<T>> |
OnLeft
Fired when this client disconnects and leaves the voice chat
Declaration
event Action OnLeft
Event Type
Type | Description |
---|---|
System.Action |
OnPeerJoined
Fired when a new peer joins the voice chat. Provides the ID of the client as event data.
Declaration
event Action<T> OnPeerJoined
Event Type
Type | Description |
---|---|
System.Action<T> |
OnPeerLeft
Fired when a client leaves the chatroom. Provides the ID of the client as event data.
Declaration
event Action<T> OnPeerLeft
Event Type
Type | Description |
---|---|
System.Action<T> |
OnReceivedPeerAudioFrame
Event fired when an audio frame is received from another peer via the server. Parameters:
- peer ID: the ID of the peer that sent the audio frame
- AudioFrame: the frame containing audio data
Declaration
event Action<T, AudioFrame> OnReceivedPeerAudioFrame
Event Type
Type | Description |
---|---|
System.Action<T, AudioFrame> |