0.7.7 play update (#47)

This commit is contained in:
two56
2022-11-14 12:39:51 +00:00
committed by GitHub
parent 653b71501b
commit 7074169afa

View File

@@ -4,7 +4,10 @@ The play command is used to stream recorded audio to a call.
```json ```json
{ {
"verb": "play", "verb": "play",
"url": "https://example.com/example.mp3" "url": "https://example.com/example.mp3",
"timeoutSecs": 10,
"seekOffset": 8000,
"actionHook": "/play/action"
} }
``` ```
@@ -15,6 +18,19 @@ You can use the following options in the `play` action:
| url | a single url or array of urls (will play in sequence) to a wav or mp3 file | yes | | url | a single url or array of urls (will play in sequence) to a wav or mp3 file | yes |
| loop | number of times to play the url(s) | no (default: 1) | | loop | number of times to play the url(s) | no (default: 1) |
| earlyMedia | if true and the call has not yet been answered, play the audio without answering call. Defaults to false | no | | earlyMedia | if true and the call has not yet been answered, play the audio without answering call. Defaults to false | no |
| timeoutSecs | the number of seconds to play the url | no |
| seekOffset | how many samples to seek into the url | no |
| actionHook | webhook that is called when the play verb completes | no |
<h5 id="message-action-properties">actionHook properties</h5>
The actionHook that is invoked when the `play` command completes will include the following properties:
| property name | description |
| ------------- |-------------|
| playback_seconds | the number of seconds played |
| playback_milliseconds | the number of milliseconds played |
| playback_last_offset_pos | the last offset position in samples |
<p class="flex"> <p class="flex">
<a href="/docs/webhooks/pause">Prev: pause</a> <a href="/docs/webhooks/pause">Prev: pause</a>