Share via


SpeechSynthesisConnector.DetachFlow Method

Detaches the current AudioVideoFlow, freeing the connector to use another.

Namespace:  Microsoft.Rtc.Collaboration.AudioVideo
Assembly:  Microsoft.Rtc.Collaboration (in Microsoft.Rtc.Collaboration.dll)

Syntax

'Declaration
Public Sub DetachFlow
'Usage
Dim instance As SpeechSynthesisConnector

instance.DetachFlow()
public void DetachFlow()

Remarks

Will NO-OP if no flow is attached.

Examples

The following example attaches and detaches a SpeechSynthesisConnector by the time AudioVideoFlow changes its state to Active and Terminated.

C# Attaching and detaching an AudioVideoFlow.

 

            audioVideoFlow.StateChanged += delegate(object sender, MediaFlowStateChangedEventArgs args)
            {
                AudioVideoFlow avFlow = (AudioVideoFlow)sender;

                if(avFlow.State == MediaFlowState.Active)
                {

                    SpeechSynthesisConnector speechSynthesisConnector = new SpeechSynthesisConnector();
                    speechSynthesisConnector.AttachFlow(avFlow);

                }
                else if(avFlow.State == MediaFlowState.Terminated)
                {

                    if (avFlow.SpeechSynthesisConnector != null)
                    {
                        avFlow.SpeechSynthesisConnector.DetachFlow();
                    }

                }
            };

See Also

Reference

SpeechSynthesisConnector Class

SpeechSynthesisConnector Members

Microsoft.Rtc.Collaboration.AudioVideo Namespace