Skip to main content

SignalWire.Relay.Calling.PlayAction

This object returned from one of the asynchronous Play methods that represent a play operation that is currently active on a call.

Properties​

PropertyTypeDescription
ControlIDstringThe identifier used for controlling the operation.
ResultSignalWire.Relay.Calling.PlayResultFinal result of playing.
StateSignalWire.Relay.Calling.CallPlayStateCurrent state of the play operation.
CompletedboolWhether the play operation has completed.
PayloadList<SignalWire.Relay.Calling.CallMedia>Payload sent to Relay to start playing.

Methods​

Stop​

Stop the action immediately.

Parameters

None

Returns

SignalWire.Relay.Calling.StopResult - The result object to interact with.

Examples

Start playing an audio file and stop it after 5 seconds.

PlayAction actionPlay = call.PlayAudioAsync("https://cdn.signalwire.com/default-music/welcome.mp3");

Thread.Sleep(5000);

StopResult resultStop = actionPlay.Stop();

Volume​

Change the volume of the action immediately.

Parameters

ParameterTypeRequiredDescription
volumedoublerequiredThe volume from -40dB to +40dB where 0 is unchanged.

Returns

SignalWire.Relay.Calling.PlayVolumeResult - The result object to interact with.

Examples

Start playing an audio file and change the volume after after 5 seconds.

PlayAction actionPlay = call.PlayAudioAsync("https://cdn.signalwire.com/default-music/welcome.mp3");

Thread.Sleep(5000);

actionPlay.Volume(4.0);

Pause​

Pause playback of the action immediately.

Parameters

None

Returns

SignalWire.Relay.Calling.PlayPauseResult - The result object to interact with.

Examples

Start playing an audio file and pause it after 5 seconds.

PlayAction actionPlay = call.PlayAudioAsync("https://cdn.signalwire.com/default-music/welcome.mp3");

Thread.Sleep(5000);

actionPlay.Pause();

Resume​

Resume playback of the action immediately.

Parameters

None

Returns

SignalWire.Relay.Calling.PlayResumeResult - The result object to interact with.

Examples

Start playing an audio file and pause it after 5 seconds, then resume it after 5 seconds.

PlayAction actionPlay = call.PlayAudioAsync("https://cdn.signalwire.com/default-music/welcome.mp3");

Thread.Sleep(5000);

actionPlay.Pause();

Thread.Sleep(5000);

actionPlay.Resume();