Editar

Compartilhar via


PartyLocalChatControl::SetAudioOutput

Configures the preferred speakers or headset device that the chat control will use for audio output.

Syntax

PartyError SetAudioOutput(  
    PartyAudioDeviceSelectionType audioDeviceSelectionType,  
    PartyString audioDeviceSelectionContext,  
    void* asyncIdentifier  
)  

Parameters

audioDeviceSelectionType   PartyAudioDeviceSelectionType

If PartyAudioDeviceSelectionType::None is specified, the audio output will be cleared. If PartyAudioDeviceSelectionType::SystemDefault is specified, the Party library will attempt to use the system's default communication device. If PartyAudioDeviceSelectionType::PlatformUserDefault is specified, the Party library will attempt to use the default communication device associated with audioDeviceSelectionContext. If PartyAudioDeviceSelectionType::Manual is specified, the Party library will attempt to use the communication device whose device identifier matches audioDeviceSelectionContext.

audioDeviceSelectionContext   PartyString
optional

When using PartyAudioDeviceSelectionType::None or PartyAudioDeviceSelectionType::SystemDefault, audioDeviceSelectionContext will be ignored. When using PartyAudioDeviceSelectionType::PlatformUserDefault, audioDeviceSelectionContext must be the non-null, non-empty platform-specific user context that the chat control should use when selecting the audio device. When using PartyAudioDeviceSelectionType::Manual, audioDeviceSelectionContext must be the non-null, non-empty identifier of the audio device that the chat control should use.

asyncIdentifier   void*
optional

An optional, app-defined, pointer-sized context value that can be used to associate the completion state change with this call.

Return value

PartyError

c_partyErrorSuccess if the asynchronous operation to set the audio output began, or an error code otherwise. If this method fails, no related state changes will be generated. The human-readable form of the error code can be retrieved via PartyManager::GetErrorMessage().

Remarks

This method queues an asynchronous operation to configure the preferred speakers or headset device associated with this local chat control. If the method succeeds, a PartyLocalChatAudioOutputChangedStateChange will be provided by PartyManager::StartProcessingStateChanges() with details about the output device status and a PartySetChatAudioOutputCompletedStateChange will be provided upon completion of the operation, indicating success or failure. After completion, an additional PartyLocalChatAudioOutputChangedStateChange will be provided each time the audio device status changes, such as due to device removal.

If the specified device isn't present, the chat control will subscribe to audio device changes and use the device when it does appear.

When using the PlatformUserDefault option on the Xbox platform, the Xbox User Identifier (XUID) must be passed as the audioDeviceSelectionContext value.

Requirements

Header: Party.h

See also

PartyLocalChatControl
PartyLocalChatControl::GetAudioOutput
PartyLocalChatControl::SetAudioInput