steep-balloon-41261
10/16/2023, 4:21 PMacoustic-engineer-41666
10/16/2023, 4:22 PMacoustic-engineer-41666
10/16/2023, 4:23 PMimportant-megabyte-62876
10/16/2023, 5:32 PMprivate IEnumerator BeginScreenShareRoutine()
{
TrackPublishOptions trackPublishOptions = new TrackPublishOptions
{
Name = "ScreenShare_" + GameManager.Instance.GetUserID()
};
ScreenShareCaptureOptions screenShareCaptureOptions = new ScreenShareCaptureOptions
{
Audio = true // <-Need to do this in order for screen share to have audio.
//AudioOptions = new AudioCaptureOptions
//{
// TO DO
//},
//Resolution = new VideoResolution // Commenting this out because adjusting framerate appears to break screen share...
//{
//FrameRate = 60
//}
};
yield return room.LocalParticipant.SetScreenShareEnabled(true, screenShareCaptureOptions, trackPublishOptions);
}
Does it involve setting stuff up in AudioCaptureOptions? If so, looks like these are all of the options available for AudioCaptureOptions:
public struct AudioCaptureOptions
{
[JsonProperty("autoGainControl")]
public ConstrainBoolean? AutoGainControl;
[JsonProperty("channelCount")]
public ConstrainULong? ChannelCount;
[JsonProperty("deviceId")]
public ConstrainDOMString? DeviceId;
[JsonProperty("echoCancellation")]
public ConstrainBoolean? EchoCancellation;
[JsonProperty("latency")]
public ConstrainDouble? Latency;
[JsonProperty("noiseSuppression")]
public ConstrainBoolean? NoiseSuppression;
[JsonProperty("sampleRate")]
public ConstrainULong? SampleRate;
[JsonProperty("sampleSize")]
public ConstrainULong? SampleSize;
}
What should I set all of the above to?important-megabyte-62876
10/16/2023, 5:35 PMTrackPublishOptions :
public struct TrackPublishOptions
{
[JsonProperty("name")]
public string Name;
[JsonProperty("source")]
public TrackSource? Source;
// TrackPublishDefaults copied (no struct inheritance)
[JsonProperty("videoEncoding")]
public VideoEncoding? videoEncoding;
[JsonProperty("screenShareEncoding")]
public VideoEncoding? ScreenShareEncoding;
[JsonProperty("videoCodec")]
public VideoCodec? VideoCodec;
[JsonProperty("audioBitrate")]
public int? AudioBitrate;
[JsonProperty("dtx")]
public bool? DTX;
[JsonProperty("simulcast")]
public bool? Simulcast;
[JsonProperty("stopMicTrackOnMute")]
public bool? StopMicTrackOnMute;
[JsonProperty("videoSimulcastLayers")]
public VideoPreset[] VideoSimulcastLayers;
[JsonProperty("screenShareSimulcastLayers")]
public VideoPreset[] ScreenShareSimulcastLayers;
}important-megabyte-62876
10/16/2023, 5:40 PMAudioCaptureOptions and TrackPublishOptions. Right?
It looks like some of the settings are available, such as ChannelCount, EchoCancellation, NoiseSuppression, and DTX, however I don't see anything for audioPreset or red. I do see AudioBitrate though.
Could you please advise? Thanks!important-megabyte-62876
10/18/2023, 4:19 PMprivate IEnumerator BeginScreenShareRoutine()
{
TrackPublishOptions trackPublishOptions = new TrackPublishOptions
{
Name = "ScreenShare_" + GameManager.Instance.GetUserID()
};
ScreenShareCaptureOptions screenShareCaptureOptions = new ScreenShareCaptureOptions
{
Audio = true // <-Need to do this in order for screen share to have audio.
//AudioOptions = new AudioCaptureOptions
//{
// TO DO
//}
};
yield return room.LocalParticipant.SetScreenShareEnabled(true, screenShareCaptureOptions, trackPublishOptions);
}
To this?
private IEnumerator BeginScreenShareRoutine()
{
TrackPublishOptions trackPublishOptions = new TrackPublishOptions
{
Name = "ScreenShare_" + GameManager.Instance.GetUserID(),
DTX = false,
AudioBitrate = 320000 //???
};
ScreenShareCaptureOptions screenShareCaptureOptions = new ScreenShareCaptureOptions
{
Audio = true, // <-Need to do this in order for screen share to have audio.
AudioOptions = new AudioCaptureOptions
{
ChannelCount = 2,
EchoCancellation = false,
NoiseSuppression = false
}
};
yield return room.LocalParticipant.SetScreenShareEnabled(true, screenShareCaptureOptions, trackPublishOptions);
}
Is this the right way to do it, and am I missing any important settings?