Skip to content

Commit c16d715

Browse files
committed
adding audio streamer docs
1 parent 595c5d7 commit c16d715

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

README.rst

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,11 +554,29 @@ For more information about OpenTok live streaming broadcasts, see the
554554
Streaming audio to a websocket
555555
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
556556
You can stream audio to a websocket with the ``opentok.stream_audio_to_websocket`` method.
557+
For more information, see the
558+
`Audio Streamer developer guide <https://tokbox.com/developer/guides/audio-streamer/>`_.
557559

558560
.. code:: python
559561
560562
websocket_options = {"uri": "wss://service.com/ws-endpoint"}
561-
websocketopentok.stream_audio_to_websocket(session_id, opentok_token, websocket_options)
563+
websocket_audio_connection = opentok.stream_audio_to_websocket(session_id, opentok_token, websocket_options)
564+
565+
Additionally, you can specify only the streams you want to send to the websocket, and/or the additional headers that are sent,
566+
by adding these fields to the ``websocket_options`` object.
567+
568+
.. code:: python
569+
570+
websocket_options = {
571+
"uri": "wss://service.com/ws-endpoint",
572+
"streams": [
573+
"streamId-1",
574+
"streamId-2"
575+
],
576+
"headers": {
577+
"headerKey": "headerValue"
578+
}
579+
}
562580
563581
Configuring Timeout
564582
-------------------

0 commit comments

Comments
 (0)