Table of Contents

Class SetPlayoutDeviceRequest

Namespace
LiveKit.Proto

Set the playout device (speaker/headphones).

Call this before connecting to select which speaker to use for audio output. Use the GUID from AudioDeviceInfo for stable device selection across hot-plug events.

Platform Notes

  • Desktop: Works as expected - selects from enumerated devices.
  • Mobile (iOS/Android): No-op. Mobile platforms handle audio routing at the system level. This will succeed but has no effect. For audio routing on mobile:
    • iOS: Use AVAudioSession to control speaker/earpiece/Bluetooth routing
    • Android: Use AudioManager.setSpeakerphoneOn() to switch outputs
public sealed class SetPlayoutDeviceRequest : Google.Protobuf.IMessage<SetPlayoutDeviceRequest>, Google.Protobuf.IBufferMessage
Inheritance
SetPlayoutDeviceRequest
Implements
IBufferMessage
Extension Methods

Constructors

SetPlayoutDeviceRequest()

public SetPlayoutDeviceRequest()

SetPlayoutDeviceRequest(SetPlayoutDeviceRequest)

public SetPlayoutDeviceRequest(SetPlayoutDeviceRequest other)

Parameters

other SetPlayoutDeviceRequest

Fields

DeviceIdFieldNumber

Field number for the "device_id" field.

public const int DeviceIdFieldNumber = 2

Field Value

int

PlatformAudioHandleFieldNumber

Field number for the "platform_audio_handle" field.

public const int PlatformAudioHandleFieldNumber = 1

Field Value

int

Properties

Descriptor

public static Google.Protobuf.Reflection.MessageDescriptor Descriptor { get; }

Property Value

MessageDescriptor

DeviceId

Device GUID from AudioDeviceInfo.guid - stable across device additions/removals.

public string DeviceId { get; set; }

Property Value

string

HasDeviceId

Gets whether the "device_id" field is set

public bool HasDeviceId { get; }

Property Value

bool

HasPlatformAudioHandle

Gets whether the "platform_audio_handle" field is set

public bool HasPlatformAudioHandle { get; }

Property Value

bool

Parser

public static Google.Protobuf.MessageParser<SetPlayoutDeviceRequest> Parser { get; }

Property Value

MessageParser<SetPlayoutDeviceRequest>

PlatformAudioHandle

The PlatformAudio handle.

public ulong PlatformAudioHandle { get; set; }

Property Value

ulong

Methods

CalculateSize()

public int CalculateSize()

Returns

int

ClearDeviceId()

Clears the value of the "device_id" field

public void ClearDeviceId()

ClearPlatformAudioHandle()

Clears the value of the "platform_audio_handle" field

public void ClearPlatformAudioHandle()

Clone()

public SetPlayoutDeviceRequest Clone()

Returns

SetPlayoutDeviceRequest

Equals(SetPlayoutDeviceRequest)

public bool Equals(SetPlayoutDeviceRequest other)

Parameters

other SetPlayoutDeviceRequest

Returns

bool

Equals(object)

public override bool Equals(object other)

Parameters

other object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

MergeFrom(CodedInputStream)

public void MergeFrom(Google.Protobuf.CodedInputStream input)

Parameters

input CodedInputStream

MergeFrom(SetPlayoutDeviceRequest)

public void MergeFrom(SetPlayoutDeviceRequest other)

Parameters

other SetPlayoutDeviceRequest

ToString()

public override string ToString()

Returns

string

WriteTo(CodedOutputStream)

public void WriteTo(Google.Protobuf.CodedOutputStream output)

Parameters

output CodedOutputStream