Dissonance Comms组件是配置Dissonance的中心位置。要使Dissonance工作,场景中必须有一个活跃的人。(好比信号台)
Config
Members | Name | Describe |
---|---|---|
Playback Prefab | - | 这是音频播放系统的预制件 |
Mute | - | 静音 |
Access Tokens | - | 访问令牌 |
Voice Settings | - | 语音设定 |
Configure Rooms | - | 配置房间 |
Diagnostic Settings | - | 诊断设定 |
Script
ReadOnly Property | Name | Describe |
---|---|---|
IsNetworkInitialised | - | 否已成功初始化 |
Rooms | - | |
PlayerChannels | - | |
RoomChannels | - | |
Text | - | |
Players | ReadOnlyCollection<VoicePlayerState> | 对象列表 |
TopPrioritySpeaker | - | 有远程播放器的最高优先级 |
Tokens | - | 本地玩家拥有的令牌集 |
MicrophoneCapture | - | 麦克风捕捉(unity api) |
Property | Name | Describe |
---|---|---|
LocalPlayerName | string | 本地播放器的名称,当Dissonance开始时,它将被初始化为每个播放器的唯一ID。一旦Dissonance开始,则可能无法更改。 |
PlayerPriority | ChannelPriority | 本地播放器的优先级 |
MicrophoneName | string | 获取或设置用于捕获语音的麦克风名称 |
PlaybackPrefab | prefab | 语音播放组件 |
IsMuted | bool | 是否静音(即禁止发送任何语音传输) |
IsDeafened | bool | 本地播放器是否震耳欲聋(即无法听见任何远程语音传输) |
Event | Name | Describe |
---|---|---|
OnPlayerJoinedSession | Action<VoicePlayerState> | |
OnPlayerLeftSession | Action<VoicePlayerState> | |
OnPlayerStartedSpeaking | - | |
OnPlayerStoppedSpeaking | - | |
OnPlayerEnteredRoom | Action<VoicePlayerState, string> | |
OnPlayerExitedRoom | - | |
LocalPlayerNameChanged | - | |
TokenAdded | - | |
TokenRemoved | - |
Methods | Return | Describe |
---|---|---|
FindPlayer(string name) | VoicePlayerState | 给定Dissonance ID的播放器 |
SubcribeToVoiceActivation | - | 将给定的侦听器对象订阅到本地播放器的语音激活检测器(VAD)VoiceActivationStartVoiceActivationStop |
UnsubscribeFromVoiceActivation(IVoiceActivationListener) | - | |
UnsubscribeFromVoiceActivation(IVoiceActivationListener) | - | |
SubcribeToRecordedAudio(IMicrophoneSubscriber) | - | 添加语音侦听监听 |
UnsubscribeFromRecordedAudio(IMicrophoneSubscriber) | - | 取消订阅先前订阅的侦听器对象 |
TrackPlayerPosition(IDissonancePlayer) | - | 开始跟踪由给定对象 |
StopTracking(IDissonancePlayer) | - | 停止跟踪 |
ResetMicrophoneCapture | - | 强制完全重新启动音频捕获管道 |