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​
Property | Type | Description |
---|---|---|
ControlID | string | The identifier used for controlling the operation. |
Result | SignalWire.Relay.Calling.PlayResult | Final result of playing. |
State | SignalWire.Relay.Calling.CallPlayState | Current state of the play operation. |
Completed | bool | Whether the play operation has completed. |
Payload | List<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
Parameter | Type | Required | Description |
---|---|---|---|
volume | double | required | The 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();