Ignore output_frame_size parameter (#210)

This commit is contained in:
Václav Volhejn
2025-04-01 20:10:27 +02:00
committed by GitHub
parent 1f0462371e
commit 06885d06c4
9 changed files with 31 additions and 24 deletions

View File

@@ -92,27 +92,19 @@ stream = Stream(
## Stream Handler Output Audio
You can configure the output audio chunk size of `ReplyOnPause` (and any `StreamHandler`)
with the `output_sample_rate` and `output_frame_size` parameters.
The following code (which uses the default values of these parameters), states that each output chunk will be a frame of 960 samples at a frame rate of `24,000` hz. So it will correspond to `0.04` seconds.
You can configure the output sampling rate of `ReplyOnPause` (and any `StreamHandler`)
with the `output_sample_rate` and parameter. For example:
```python
from fastrtc import ReplyOnPause, Stream
stream = Stream(
handler=ReplyOnPause(..., output_sample_rate=24000, output_frame_size=960),
handler=ReplyOnPause(..., output_sample_rate=16000),
modality="audio",
mode="send-receive"
)
```
!!! tip
In general it is best to leave these settings untouched. In some cases,
lowering the output_frame_size can yield smoother audio playback.
## Audio Icon
You can display an icon of your choice instead of the default wave animation for audio streaming.