Compartir a través de


LegacyGipGameControllerProvider.SetHeadsetOperation Método

Definición

Establece una operación de auriculares.

public:
 virtual void SetHeadsetOperation(HeadsetOperation operation, Platform::Array <byte> ^ buffer) = SetHeadsetOperation;
void SetHeadsetOperation(HeadsetOperation const& operation, winrt::array_view <byte> const& buffer);
public void SetHeadsetOperation(HeadsetOperation operation, byte[] buffer);
function setHeadsetOperation(operation, buffer)
Public Sub SetHeadsetOperation (operation As HeadsetOperation, buffer As Byte())

Parámetros

operation
HeadsetOperation

Configuración que se va a cambiar.

buffer

Byte[]

byte[]

Búfer con el formato adecuado para operation. Consulta HeadsetOperation para conocer los formatos correspondientes.

Ejemplos

public void SetupHeadset(IGameControllerProvider headsetProvider)
{
    LegacyGipGameControllerProvider legacyGipGameControllerProvider =
        LegacyGipGameControllerProvider.FromGameControllerProvider(headsetProvider);

    // Reset the device
    legacyGipGameControllerProvider.ExecuteCommand(DeviceCommand.Reset);

    // Check the smart mute level
    byte[] smartMuteBuffer =
        legacyGipGameControllerProvider.GetHeadsetOperation(HeadsetOperation.SmartMute);
    HeadsetLevel smartMuteValue = (HeadsetLevel)smartMuteBuffer[0];

    // Set bass boost to 3db
    byte[] bassBuffer = BitConverter.GetBytes((UInt32)3);
    legacyGipGameControllerProvider.SetHeadsetOperation(HeadsetOperation.BassBoostGain,
        bassBuffer);
}

Comentarios

Precaución

Para evitar daños en los dispositivos, las API de control de auriculares solo deben usarse con hardware que haya desarrollado.

Se aplica a

Consulte también