'How to use IRDPSRAPIAudioStream

I want to use the IRDPSRAPIAudioStream in my c# rdp program for audio sharing.

But I don't know that where can I get the AudioStream?

try
            {
                Console.WriteLine("Client connected" + MyGuest.RemoteName + MyGuest.ConnectivityInfo + "Session Details");
               
                //////////////
                long thisone = 100;
                IRDPSRAPIAudioStream gq = (IRDPSRAPIAudioStream)currentSession;
                gq.Initialize(out thisone);
                gq.Start();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }

the exception is the same both time. That I can't convert to that type So I can't convert „RDPCOMAPILib.RDPSessionClass” to „RDPCOMAPILib.IRDPSRAPIAudioStream” or to IRDPSRAPIAttendee.

Here is the Documentation but this is not much help... https://docs.microsoft.com/kk-kz/windows/win32/api/rdpencomapi/nn-rdpencomapi-irdpsrapiaudiostream

Somebody can help me?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source