文档

​
​

Development

User Acquisition

Monetization

工业

Vivox Core SDK

Vivox Core SDK

此页面不支持所选语言。
Vivox
​
​
Vivox Core SDK
  • Overview
  • Before you begin
  • Get started
  • Release notes
  • Developer Guide
    • Client SDK basics
    • Channels
    • Presence management
    • Messaging
    • Manage audio
      • Direct voice audio access
      • In-game audio control
        • In-game audio device selection
        • In-game control of audio levels
        • Push to talk
      • Muting
    • Couch co-op
    • Android app development
    • iOS app development
    • macOS app development
    • Windows app development
    • Real-time recording
    • Speech-to-text audio transcription
    • Text-to-speech
    • Troubleshooting
  • Reference
  • Privacy overview
  1. Vivox Core SDK documentation

In-game audio device selection

Allow players to select audio input and output devices.
阅读时间2 分钟
最后更新于 8 个月前

The Vivox SDK automatically uses the default system audio input and output devices.
Changes to available audio devices are performed through system events. When a new device or a new user with a new device is detected, or the currently active device is removed, configure your application to perform the following actions:
  1. Determine if the new device requires a change to either the active capture or render device.
  2. If a change is required, change the capture or render device.
To provide users with a choice of which audio device to use for group voice chat independent of the audio devices that are used for a game, build a user interface that displays a list of available devices to users that they can select a device from. Use the following requests for this user interface, where audio output devices are called render devices, and audio input devices are called capture devices:
  • vx_req_aux_get_render_devices
  • vx_req_aux_get_capture_devices
  • vx_req_aux_set_render_device
  • vx_req_aux_set_capture_device
Each of the
vx_resp_aux_get_*_devices
responses include OS default devices, a list of devices that are available for selection with a
vx_req_aux_set_*_device
request, the current device selection, and the effective device in use. The
current_*_device
is the
vx_device_t
entry as it appears in the list of available devices. In the scenario where the current device is a representative audio device that serves as a reference to some other device (for example, Default System Device),
effective_*_device
is set to the real device in use. The current and effective devices match if a specific, discrete audio device is set.
If either the capture or render device is set to Default System Device, when a compatible audio device is plugged in or the existing in-use audio device is unplugged, audio automatically switches to the other device, and the application is notified with an
evt_audio_device_hot_swap
message. Use this message to provide a visual cue to the user that they are now using a different audio device.
For example, if a user is using a speaker device for audio and a headset is plugged in, set the current Vivox capture and render devices to the headset by using
vx_req_aux_set_capture_device
and
vx_req_aux_set_render_device
. If there is no capture device to fall back to, but there is a render device (for example, HDMI output), set the capture device to No Device.

Copyright © 2026 Unity Technologies
法律信息隐私政策CookiesDocumentation Terms of Use请勿出售或分享我的个人信息您的隐私选择(Cookie 设置)

“Unity”、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属公司在美国和其他地方的商标或注册商标(此处查看更多信息)。其他名称或品牌是其各自所有者的商标。

为方便起见,一些页面是机器翻译的,可能包含不准确的内容。如有信息不一致的情况,以英文版本为准。


    报告此页面的问题