Editar

Compartilhar via


PartyLocalChatControl::SetAudioInput

Configures the preferred microphone or recording device that the chat control will use for audio input.

Syntax

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

Parameters

audioDeviceSelectionType   PartyAudioDeviceSelectionType

If PartyAudioDeviceSelectionType::None is specified, the audio input 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. Note that PartyAudioDeviceSelectionType::Manual is not supported on Android, iOS, or macOS.

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 input 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 recording device associated with this local chat control. If the method succeeds, a PartyLocalChatAudioInputChangedStateChange will be provided by PartyManager::StartProcessingStateChanges() with details about the input device status and a PartySetChatAudioInputCompletedStateChange will be provided upon completion of the operation, indicating success or failure. After completion, an additional PartyLocalChatAudioInputChangedStateChange 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::GetAudioInput
PartyLocalChatControl::SetAudioOutput