語法
參數
audioDeviceSelectionType PartyAudioDeviceSelectionType
如果指定 PartyAudioDeviceSelectionType::None,則會清除音訊輸入。如果指定 PartyAudioDeviceSelectionType::SystemDefault,Party 程式庫會嘗試使用系統的預設通訊裝置。如果指定 PartyAudioDeviceSelectionType::PlatformUserDefault,Party 程式庫會嘗試使用與 audioDeviceSelectionContext 相關聯的預設通訊裝置。如果指定 PartyAudioDeviceSelectionType::Manual,Party 程式庫會嘗試使用裝置識別碼相符的通訊裝置。請注意,Android、iOS 或 macOS 不支援 PartyAudioDeviceSelectionType::Manual。
audioDeviceSelectionContext PartyString選用 使用 PartyAudioDeviceSelectionType::None 或 PartyAudioDeviceSelectionType::SystemDefault 時,會忽略
audioDeviceSelectionContext。使用 PartyAudioDeviceSelectionType::PlatformUserDefault 時,audioDeviceSelectionContext 必須是聊天控制項選取音訊裝置時應使用的非 null、非空白平台專屬使用者內容。使用 PartyAudioDeviceSelectionType::Manual 時,audioDeviceSelectionContext 必須是聊天控制項應使用之音訊裝置的非 null、非空白識別碼。
asyncIdentifier void*選用 選用的應用程式定義指標大小內容值,可用來將完成狀態變更與此呼叫相關聯。
傳回值
PartyErrorc_partyErrorSuccess (如果設定音訊輸入的非同步作業已開始),否則為錯誤碼。如果此方法失敗,將不會產生任何相關的狀態變更。可透過 PartyManager::GetErrorMessage() 擷取錯誤碼的人類可讀形式。
備註
此方法會將非同步作業排入佇列,以設定與此本機聊天控制項相關聯的慣用錄音裝置。如果方法成功,PartyManager::StartProcessingStateChanges() 會提供包含輸入裝置狀態詳細資料的 PartyLocalChatAudioInputChangedStateChange,並在作業完成時提供 PartySetChatAudioInputCompletedStateChange,表示成功或失敗。完成後,每當音訊裝置狀態變更 (例如因裝置移除) 時,都會再提供 PartyLocalChatAudioInputChangedStateChange。如果指定的裝置不存在,聊天控制項會訂閱音訊裝置變更,並在裝置出現時使用該裝置。
在 XBOX 平台上使用
PlatformUserDefault 選項時,必須將 XBOX 使用者識別碼 (XUID) 作為 audioDeviceSelectionContext 值傳遞。
需求
標頭: Party.h另請參閱
PartyLocalChatControlPartyLocalChatControl::GetAudioInput
PartyLocalChatControl::SetAudioOutput
