using System; using System.Collections.Generic; namespace Adrenak.UniVoice { /// /// Audio client interface. /// The implementation of this class is generally based on some networking /// framework such as Mirror, FishNet, Unity Netcode, etc. /// /// /// The identifier data type used by the framework you're using in your implementation. /// For example, Mirror identifies players using int. So, a MirrorAudioClient class /// that implements this interface would be MirrorAudioClient : IAudioClient /// public interface IAudioClient : IDisposable { /// /// The clients peer ID in the voice chat /// T ID { get; } /// /// IDs of all the peers (except this client) in the voice chat /// List PeerIDs { get; } /// /// The voice settings of this client. Call /// after making changes to this object to submit the updates to the server. /// VoiceSettings YourVoiceSettings { get; } /// /// Fired when this client connects and joins the voice chat /// Includes the following parameters /// - own peer ID (int). This should also get assigned to /// - IDs of other peers. This should also get assigned to /// event Action> OnJoined; /// /// Fired when this client disconnects and leaves the voice chat /// event Action OnLeft; /// /// Fired when a new peer joins the voice chat. /// Provides the ID of the client as event data. /// event Action OnPeerJoined; /// /// Fired when a client leaves the chatroom. /// Provides the ID of the client as event data. /// event Action OnPeerLeft; /// /// 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 /// event Action OnReceivedPeerAudioFrame; /// /// Sends an audio frame to the server for being /// broadcasted to the other peers /// /// The audio frame to be sent void SendAudioFrame(AudioFrame frame); /// /// Submits voice settings to the server /// void SubmitVoiceSettings(); /// /// Modifies and submits voice settings to the server /// /// void UpdateVoiceSettings(Action modification); } }