-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[resampler] Media Player Components Docs PR1 (#4628)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
- Loading branch information
1 parent
337a258
commit d0bba87
Showing
3 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
Resampler Speaker | ||
================== | ||
|
||
.. seo:: | ||
:description: Instructions for setting up resampler speakers in ESPHome. | ||
:image: waveform.svg | ||
|
||
The ``resampler`` speaker platform allows you to convert the sample rate of an audio stream and output it to another :doc:`speaker component </components/speaker/index>`. | ||
|
||
If the audio stream doesn't require resampling, it is automatically sent directly to the output speaker. | ||
|
||
This platform only works on ESP32 based chips. | ||
|
||
.. warning:: | ||
|
||
Audio and voice components consume a significant amount of resources (RAM and CPU) on the device. | ||
|
||
**Crashes are likely to occur** if you include too many additional components in your device's | ||
configuration. In particular, Bluetooth/BLE components are known to cause issues when used in | ||
combination with Voice Assistant and/or other audio components. | ||
|
||
.. code-block:: yaml | ||
# Example configuration entry | ||
speaker: | ||
- platform: resampler | ||
output_speaker: output_speaker_id | ||
sample_rate: 48000 | ||
Configuration variables: | ||
------------------------ | ||
|
||
- **output_speaker** (**Required**, :ref:`config-id`): The :doc:`speaker </components/speaker/index>` to output the resampled audio. | ||
- **buffer_duration** (*Optional*, :ref:`config-time`): The duration of the internal ring buffer. Larger values may reduce stuttering but use more memory. Defaults to ``500ms``. | ||
- **bits_per_sample** (*Optional*, positive integer): The audio sample bit depth after resampling. Defaults to the output speaker's bits per sample. | ||
- **sample_rate** (*Optional*, positive integer): Sample rate to convert to. Must be between ``8000`` and ``48000``. Defaults to the output speaker's sample rate. | ||
- **filters** (*Optional*, positive integer): The number of windowed sinc interpolation filters to use. Must be between ``2`` and ``1024``. Defaults to ``16``. | ||
- **taps** (*Optional*, positive integer): The number of taps per windowed sinc interpolation filter. Must between ``16`` and ``128`` and divisible by 4. Defaults to ``16``. | ||
- **task_stack_in_psram** (*Optional* boolean): Only with ``esp-idf``. Run the audio tasks in external memory. Defaults to ``false``. | ||
- All other options from :ref:`Speaker Component <config-speaker>`. | ||
|
||
Improving quality | ||
----------------- | ||
|
||
Resampling is processor intensive and should be avoided as much as possible. The audio quality is effected by the number of filters and the number of taps. Increasing the number of filters will increase the memory load. Increasing the number of taps will increase the CPU load. | ||
|
||
See also | ||
-------- | ||
|
||
- `ART Audio Resampler (GitHub) <https://github.com/dbry/audio-resampler>`__ | ||
- :doc:`index` | ||
- :ghedit:`Edit` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters