Skip to content

Commit

Permalink
Some docs typos
Browse files Browse the repository at this point in the history
  • Loading branch information
Freddy Boulton committed Feb 18, 2025
1 parent 3c2bf39 commit 9758323
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 19 deletions.
5 changes: 2 additions & 3 deletions docs/advanced-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ webrtc = Stream(

!!! warning

WebRTC may not enforce your constaints. For example, it may rescale your video
(while keeping the same resolution) in order to maintain the desired (or reach a better) frame rate. If you
really want to enforce height, width and resolution constraints, use the `rtp_params` parameter as set `"degradationPreference": "maintain-resolution"`.
WebRTC may not enforce your constraints. For example, it may rescale your video
(while keeping the same resolution) in order to maintain the desired frame rate (or reach a better one). If you really want to enforce height, width and resolution constraints, use the `rtp_params` parameter as set `"degradationPreference": "maintain-resolution"`.

```python
image = Stream(
Expand Down
2 changes: 1 addition & 1 deletion docs/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Stream(
)
```

!!! tip "Automatic Login"
!!! tip "Automatic login"

You can log in automatically with the `get_twilio_turn_credentials` helper

Expand Down
2 changes: 1 addition & 1 deletion docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Make sure you are using a TURN server. See [deployment](../deployment).

By default, the microphone is [configured](https://github.com/freddyaboulton/gradio-webrtc/blob/903f1f70bd586f638ad3b5a3940c7a8ec70ad1f5/backend/gradio_webrtc/webrtc.py#L575) to do echo cancellation.
This is what's causing the recorded audio to sound muffled when the streamed audio starts playing.
You can disable this via the `track_constraints` (see [advanced configuration](../advanced-configuration])) with the following code:
You can disable this via the `track_constraints` (see [Advanced Configuration](../advanced-configuration)) with the following code:

```python
stream = Stream(
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ Learn more about the [Stream](userguide/streams) in the user guide.

:simple-webstorm:{ .lg } Websocket Support - Use the `.mount(app)` method to mount the stream on a FastAPI app and get a websocket endpoint for your own frontend!

:telephone:{ .lg } Automatic Telephone Support - Us the `fastphone()` method of the stream to launch the application and get a free temporary phone number!
:telephone:{ .lg } Automatic Telephone Support - Use the `fastphone()` method of the stream to launch the application and get a free temporary phone number!

:robot:{ .lg } Completely customizable backend - A `Stream` is just a FastAPI app so you can easily extend it to fit your production application. See the [Talk To Claude](https://huggingface.co/spaces/fastrtc/talk-to-claude) demo for an example on how to serve a custom JS frontend.

Expand Down
6 changes: 3 additions & 3 deletions docs/userguide/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ The `ReplyOnPause` handler can also send the following `log` messages.

### Additional Inputs

When the `send_input` message is received, update the inputs of your handler however you like by by using the `set_input` method of the `Stream` object.
When the `send_input` message is received, update the inputs of your handler however you like by using the `set_input` method of the `Stream` object.

A common pattern in to use a `POST` request to send the updated data. The first argument to the `set_input` method is the `webrtc_id` of the handler.
A common pattern is to use a `POST` request to send the updated data. The first argument to the `set_input` method is the `webrtc_id` of the handler.

```python
from pydantic import BaseModel, Field
Expand All @@ -87,7 +87,7 @@ The updated data will be passed to the handler on the **next** call.

The `fetch_output` message is sent to the client whenever an instance of [`AdditionalOutputs`](../streams/#additional-outputs) is available. You can access the latest output data by calling the `fetch_latest_output` method of the `Stream` object.

However, rather than fetching each output manually, a common pattern is to fetch the entire stream of output data by calling `
However, rather than fetching each output manually, a common pattern is to fetch the entire stream of output data by calling the `output_stream` method.

Here is an example:
```python
Expand Down
20 changes: 10 additions & 10 deletions docs/userguide/streams.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@ stream = Stream(
additional_outputs_handler=None # (6)
)

# Optional: Add routes
@stream.get("/") # (7)
stream.ui.launch()

# OR: Mount to a larger FastAPI app and add custom routes

app = FastAPI()
stream.mount(app)

@app.get("/") # (7)
async def _():
return HTMLResponse(content=open("index.html").read())

# launch the stream
# uvicorn app:stream --host 0.0.0.0 --port 8000

# Will print out:
# INFO: Visit /webrtc/docs to test the stream and access WebRTC docs. # (8)
# INFO: Visit /ui to access a sample UI for the stream.
# INFO: Visit /websocket/docs for websocket docs.
# INFO: Visit /telephone/docs for docs on connecting with a telephone
# uvicorn app:app --host 0.0.0.0 --port 8000
```

1. See [Handlers](#handlers) for more information.
Expand Down Expand Up @@ -71,7 +71,7 @@ The `handler` argument is the main component of the `Stream` object. A handler s

| Modality | send-receive | send | receive |
|----------|--------------|------|----------|
| video | Function that takes a video frame and returns modified frame | Function that takes a video frame and returns modified frame | Function that takes a video frame and returns modified frame |
| video | Function that takes a video frame and returns a new video frame | Function that takes a video frame and returns a new frame | Function that takes a video frame and returns a new frame |
| audio | `StreamHandler` or `AsyncStreamHandler` subclass | `StreamHandler` or `AsyncStreamHandler` subclass | Generator yielding audio frames |
| audio-video | `AudioVideoStreamHandler` or `AsyncAudioVideoStreamHandler` subclass | Not Supported Yet | Not Supported Yet |

Expand Down

0 comments on commit 9758323

Please sign in to comment.