steep-balloon-41261
11/14/2023, 4:47 PMacoustic-engineer-41666
11/14/2023, 6:59 PMacoustic-engineer-41666
11/14/2023, 7:00 PMdry-elephant-14928
11/15/2023, 8:32 AMScreenShareCaptureOptions?important-megabyte-62876
11/15/2023, 5:21 PMScreenShareCaptureOptions code above (nothing happens). If I comment it out again, then screen share does initialize and I can select which window I want to share, choose whether or not to share audio, etc.
@acoustic-engineer-41666 Screenshare audio is definitely supported in Unity. Audio is enabled if I create a ScreenShareCaptureOptions with Audio = true . We've been using it to do virtual speaking events (streaming a Zoom call into a virtual space), but where we are having a big problem is streaming music into the space and getting really garbled/low-quality music audio. When I set the additional options (commented out in my above code) then I have the issue where screen share doesn't initialize at all.important-megabyte-62876
11/20/2023, 5:03 PMboundless-energy-78552
11/20/2023, 5:06 PMimportant-megabyte-62876
11/20/2023, 5:08 PMboundless-energy-78552
11/21/2023, 6:27 PMimportant-megabyte-62876
11/21/2023, 8:23 PMprivate IEnumerator BeginScreenShareRoutineNew()
{
TrackPublishOptions trackPublishOptions = new TrackPublishOptions
{
Name = "ScreenShare_" + GameManager.Instance.GetUserID(), // Append the instigator's user ID to the name of the screen share.
Source = TrackSource.ScreenShare,
videoEncoding = new VideoEncoding{ MaxBitrate = 1_700_000, MaxFramerate = 30 },
ScreenShareEncoding = new VideoEncoding { MaxBitrate = 2_500_000, MaxFramerate = 15 },
VideoCodec = LiveKit.VideoCodec.VP8,
AudioBitrate = 32_000,
DTX = false,
Simulcast = true,
StopMicTrackOnMute = false
//VideoSimulcastLayers = , // ???
//ScreenShareSimulcastLayers = // ???
};
ScreenShareCaptureOptions screenShareCaptureOptions = new ScreenShareCaptureOptions
{
Audio = true, // *Need* to set 'Audio = true' in order for screen share to include audio.
AudioOptions = new AudioCaptureOptions // *** Setting an AudioCaptureOptions within ScreenShareCaptureOptions BREAKS screen share. ***
{
AutoGainControl = true,
ChannelCount = 2,
//DeviceId = , // ???
EchoCancellation = false,
//Latency = , // ???
NoiseSuppression = false
//SampleRate = , // ???
//SampleSize = // ???
}
//Resolution = new VideoResolution
//{
//Width = , // Does all of this get automatically set?
//Height = ,
//FrameRate = ,
//AspectRatio =
//}
};
yield return room.LocalParticipant.SetScreenShareEnabled(true, screenShareCaptureOptions, trackPublishOptions);
}
In the above, I included all of the options but commented out anything I wasn't sure about.
For the above, could you please help me verify that I haven't made any mistakes, and help me add the missing settings that are necessary for high-fidelity audio via Unity C#? I really appreciate your help! 🙂
Also, maybe there is a bug and it would be best to directly test out high-fidelity music audio for Unity WebGL on your end? (This may also be a useful opportunity to form updated documentation for Unity high-fidelity audio)boundless-energy-78552
11/27/2023, 10:34 AMimportant-megabyte-62876
11/27/2023, 3:41 PMimportant-megabyte-62876
11/27/2023, 3:42 PMimportant-megabyte-62876
11/28/2023, 4:38 PM