Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Improved TTS Integration documentation #39207

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 27, 2025

Conversation

lukakama
Copy link
Contributor

@lukakama lukakama commented May 25, 2025

Proposed change

Added all missing options for both "say" and "speak" actions for TSS integration, including ones for audio format transcoding (added by home-assistant/core#102814 2 years ago) and clarified how specific platforms may support further settings or may override, with different supported values, settings already handled by the main TTS integration.

Also, I added a troubleshooting section regarding audio format issues that I experienced on my Google Cast devices, which made me discover the existence of transcoding support for the TTS integration by looking at the source code while starting the development of a patch to do the exact same thing, wasting a great amount of time for something already discovered and supported 2 years ago.

Type of change

  • Spelling, grammar or other readability improvements (current branch).
  • Adjusted missing or incorrect information in the current documentation (current branch).
  • Added documentation for a new integration I'm adding to Home Assistant (next branch).
  • Added documentation for a new feature I'm adding to Home Assistant (next branch).
  • Removed stale or deprecated documentation.

Additional information

Checklist

  • [x ] This PR uses the correct branch, based on one of the following:
    • I made a change to the existing documentation and used the current branch.
    • I made a change that is related to an upcoming version of Home Assistant and used the next branch.
  • [ x] The documentation follows the Home Assistant documentation standards.

Summary by CodeRabbit

  • Documentation
    • Expanded documentation for TTS integration to detail supported options for tts.speak and legacy say actions.
    • Added a section on specifying preferred audio settings, including format, sample rate, channels, and bytes.
    • Updated REST API documentation for /api/tts_get_url with new parameter details.
    • Introduced troubleshooting guidance for resolving issues with partial or corrupted audio on media players.

Added all missing options for both "say" and "speak" actions, including ones for audio format transcoding and clarified how specific platforms may support further settings or may override with different supported values handling of settings already handled by the main TTS integration.

Also added a troubleshooting section regarding audio format issues.
@lukakama lukakama requested a review from a team as a code owner May 25, 2025 10:12
@home-assistant home-assistant bot added current This PR goes into the current branch has-parent This PR has a parent PR in a other repo in-progress This PR/Issue is currently being worked on needs-rebase The PR has been branched of the wrong base branch or targets an incorrect target branch labels May 25, 2025
@home-assistant
Copy link

It seems that this PR is targeted against an incorrect branch since it has a parent PR on one of our codebases. Documentation that needs to be updated for an upcoming release should target the next branch. Please change the target branch of this PR to next and rebase if needed.

Copy link

netlify bot commented May 25, 2025

Deploy Preview for home-assistant-docs ready!

Name Link
🔨 Latest commit db12a56
🔍 Latest deploy log https://app.netlify.com/projects/home-assistant-docs/deploys/68341bb6dfd2800008057f9f
😎 Deploy Preview https://deploy-preview-39207--home-assistant-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

coderabbitai bot commented May 25, 2025

📝 Walkthrough

Walkthrough

The documentation for the TTS integration was updated to detail supported options for the tts.speak and legacy say actions, including new sections on preferred audio settings and troubleshooting. The REST API documentation was clarified, and specific advice for Google Cast devices and audio sampling rates was added.

Changes

File(s) Change Summary
source/_integrations/tts.markdown Expanded documentation for tts.speak/say actions, added preferred audio settings, updated REST API section, and added troubleshooting tips for audio issues.

Sequence Diagram(s)

sequenceDiagram
    User ->> HomeAssistant: Call tts.speak or tts.speak REST API
    HomeAssistant ->> TTS Platform: Pass message, language, cache, options (incl. preferred audio settings)
    TTS Platform ->> FFmpeg: (If needed) Transcode audio to preferred format/sample rate
    TTS Platform -->> HomeAssistant: Return processed audio
    HomeAssistant ->> Media Player: Play audio
Loading

Assessment against linked issues

Objective Addressed Explanation
Document preferred_format, preferred_sample_rate, preferred_sample_channels, preferred_sample_bytes in "options" (#39135)
Add troubleshooting tip for Google Cast devices and sample rate issue (#39135)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (8)
source/_integrations/tts.markdown (8)

49-49: Add missing article “the”
Insert “the” before cache to read “information on the cache option”.

- See [cache section](#cache) for information on `cache` option.
+ See [cache section](#cache) for information on the `cache` option.
🧰 Tools
🪛 LanguageTool

[uncategorized] ~49-~49: You might be missing the article “the” here.
Context: ...che section](#cache) for information on cache option. Additional settings can b...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)


62-62: Add missing article “the”
Insert “the” before cache to read “information on the cache option”.

- See [cache section](#cache) for information on `cache` option.
+ See [cache section](#cache) for information on the `cache` option.
🧰 Tools
🪛 LanguageTool

[uncategorized] ~62-~62: You might be missing the article “the” here.
Context: ...che section](#cache) for information on cache option. Additional settings can b...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)


108-108: Use lowercase YAML booleans and hyphenate “long-term”
YAML booleans are lowercase (true/false), and “long time cache” should be “long-term cache”:

- ...setting it to `True` to enable it (default), or `False` to disable it. A long time cache will be located...
+ ...setting it to `true` to enable it (default), or `false` to disable it. A long-term cache will be located...
🧰 Tools
🪛 LanguageTool

[uncategorized] ~108-~108: This adjective is normally spelled with a hyphen (British English) or as one word (American English).
Context: ... (default), or False to disable it. A long time cache will be located on the file syste...

(TIME_HYPHEN)


114-114: Fix verb agreement
Change “does not supports” to “does not support”:

- ...when target entity platform does not supports one or all the specified preferred audio format settings...
+ ...when target entity platform does not support one or all the specified preferred audio format settings...
🧰 Tools
🪛 LanguageTool

[grammar] ~114-~114: The auxiliary verb ‘do’ requires the base form of the verb.
Context: ...ng when target entity platform does not supports one or all the specified preferred audi...

(DID_BASEFORM)


122-122: Ensure blank line before code block
For better Markdown rendering, add an empty line between the example heading and the code fence:

- Example to produce an MP3 audio at 22050Hz:
- ```yaml
+ Example to produce an MP3 audio at 22050Hz:
+
+ ```yaml
🧰 Tools
🪛 LanguageTool

[uncategorized] ~122-~122: Possible missing comma found.
Context: ...red). Example to produce an MP3 audio at 22050Hz: ```yaml action: tts.speak tar...

(AI_HYDRA_LEO_MISSING_COMMA)


196-196: Add Oxford comma for consistency
Include a comma before “or” in the header:

- ### Partial, corrupted or no audio
+ ### Partial, corrupted, or no audio

198-198: Improve clarity and add missing commas
Include Oxford comma and soften phrasing:

- Some media players could reproduce only partial, corrupted or no audio at all when the audio format is not fully supported. In such cases it is required to experiment with different combinations of audio formats, channels, sample rates and bits using [preferred audio settings](#preferred-audio-settings) options.
+ Some media players could reproduce only partial, corrupted, or no audio at all when the audio format is not fully supported. In such cases, you may need to experiment with different combinations of audio formats, channels, sample rates, and bits using [preferred audio settings](#preferred-audio-settings) options.
🧰 Tools
🪛 LanguageTool

[typographical] ~198-~198: It appears that a comma is missing.
Context: ... format is not fully supported. In such cases it is required to experiment with diffe...

(DURING_THAT_TIME_COMMA)


200-200: Simplify phrasing and add missing “the”
Enhance readability and correct grammar:

- For example, some Google Cast devices skip initial audio part when the audio is sampled at 22050Hz, and to fix the problem it is required to set the `preferred_sample_rate` setting in the `options` option to `44100`. 
+ For example, some Google Cast devices skip the initial audio part when the audio is sampled at 22050Hz. To fix this issue, set the `preferred_sample_rate` option to `44100`.
🧰 Tools
🪛 LanguageTool

[uncategorized] ~200-~200: You might be missing the article “the” here.
Context: ... example, some Google Cast devices skip initial audio part when the audio is sampled at...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)


[style] ~200-~200: Consider using a different verb for a more formal wording.
Context: ...the audio is sampled at 22050Hz, and to fix the problem it is required to set the `...

(FIX_RESOLVE)

🪛 markdownlint-cli2 (0.17.2)

200-200: Trailing spaces
Expected: 0 or 2; Actual: 1

(MD009, no-trailing-spaces)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 6e02f0d and af0442e.

📒 Files selected for processing (1)
  • source/_integrations/tts.markdown (4 hunks)
🧰 Additional context used
🪛 LanguageTool
source/_integrations/tts.markdown

[uncategorized] ~49-~49: You might be missing the article “the” here.
Context: ...che section](#cache) for information on cache option. Additional settings can b...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)


[uncategorized] ~62-~62: You might be missing the article “the” here.
Context: ...che section](#cache) for information on cache option. Additional settings can b...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)


[uncategorized] ~108-~108: This adjective is normally spelled with a hyphen (British English) or as one word (American English).
Context: ... (default), or False to disable it. A long time cache will be located on the file syste...

(TIME_HYPHEN)


[grammar] ~114-~114: The auxiliary verb ‘do’ requires the base form of the verb.
Context: ...ng when target entity platform does not supports one or all the specified preferred audi...

(DID_BASEFORM)


[uncategorized] ~118-~118: Loose punctuation mark.
Context: ...output files. * preferred_sample_rate: Set the sample rate. When not supported...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~119-~119: Loose punctuation mark.
Context: ...peg tool. * preferred_sample_channels: Set the number of audio channels. When ...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~120-~120: Loose punctuation mark.
Context: ...FFmpeg tool. * preferred_sample_bytes: Set the audio bit sampling. When not su...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~122-~122: Possible missing comma found.
Context: ...red). Example to produce an MP3 audio at 22050Hz: ```yaml action: tts.speak tar...

(AI_HYDRA_LEO_MISSING_COMMA)


[typographical] ~198-~198: It appears that a comma is missing.
Context: ... format is not fully supported. In such cases it is required to experiment with diffe...

(DURING_THAT_TIME_COMMA)


[uncategorized] ~200-~200: You might be missing the article “the” here.
Context: ... example, some Google Cast devices skip initial audio part when the audio is sampled at...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)


[style] ~200-~200: Consider using a different verb for a more formal wording.
Context: ...the audio is sampled at 22050Hz, and to fix the problem it is required to set the `...

(FIX_RESOLVE)

🪛 markdownlint-cli2 (0.17.2)
source/_integrations/tts.markdown

117-117: Unordered list indentation
Expected: 0; Actual: 1

(MD007, ul-indent)


117-117: Lists should be surrounded by blank lines
null

(MD032, blanks-around-lists)


118-118: Unordered list indentation
Expected: 0; Actual: 1

(MD007, ul-indent)


119-119: Unordered list indentation
Expected: 0; Actual: 1

(MD007, ul-indent)


120-120: Unordered list indentation
Expected: 0; Actual: 1

(MD007, ul-indent)


121-121: Trailing spaces
Expected: 0 or 2; Actual: 1

(MD009, no-trailing-spaces)


200-200: Trailing spaces
Expected: 0 or 2; Actual: 1

(MD009, no-trailing-spaces)

🪛 GitHub Actions: home-assistant.io Test
source/_integrations/tts.markdown

[warning] 117-120: Unexpected unordered list marker *, expected - (remark-lint unordered-list-marker-style)

⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Redirect rules - home-assistant-docs
  • GitHub Check: Header rules - home-assistant-docs
  • GitHub Check: Pages changed - home-assistant-docs

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@lukakama
Copy link
Contributor Author

It seems that this PR is targeted against an incorrect branch since it has a parent PR on one of our codebases. Documentation that needs to be updated for an upcoming release should target the next branch. Please change the target branch of this PR to next and rebase if needed.

The PR on the codebase has been merged and closed 2 years ago.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (8)
source/_integrations/tts.markdown (8)

49-49: Add missing articles and Oxford comma in tts.speak parameter list
This line would read more clearly with a leading “the” and a serial comma before the last item.

- The `tts.speak` action supports `message`, `language`, `cache`, `media_player_entity_id` and `options` options.
+ The `tts.speak` action supports the `message`, `language`, `cache`, `media_player_entity_id`, and `options` options.- See [cache section](#cache) for information on `cache` option.
+ See the [cache section](#cache) for information on the `cache` option.
🧰 Tools
🪛 LanguageTool

[uncategorized] ~49-~49: You might be missing the article “the” here.
Context: ...che section](#cache) for information on cache option. Additional settings can b...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)


62-62: Clarify articles and punctuation in legacy say action description
Use “the” for consistency and an Oxford comma, plus tighten the service_name wording.

- The `say` action supports `message`, `language`, `cache` and `options` options.
+ The `say` action supports the `message`, `language`, `cache`, and `options` options.- See [cache section](#cache) for information on `cache` option.
+ See the [cache section](#cache) for information on the `cache` option.
- Since release 0.92, action name can be defined in configuration `service_name` option.
+ Since release 0.92, the action name can be defined via the `service_name` configuration option.
🧰 Tools
🪛 LanguageTool

[uncategorized] ~62-~62: You might be missing the article “the” here.
Context: ...che section](#cache) for information on cache option. Additional settings can b...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)


108-109: Hyphenate “long-term” and streamline caching description
“A long-term cache” is the standard term, and the description can be made more concise.

- The integration cache can be controlled with the `cache` option in the action to `speak` or `say`, setting it to `True` to enable it (default), or `False` to disable it. A long time cache will be located on the file system. The in-memory cache for fast responses to media players will be auto-cleaned after a short period.
+ The integration cache can be controlled with the `cache` option on the `speak` and `say` actions: set it to `True` to enable caching (default) or `False` to disable it. A long-term cache is stored on the file system, and an in-memory cache for fast responses is automatically cleaned after a short period.
🧰 Tools
🪛 LanguageTool

[uncategorized] ~108-~108: This adjective is normally spelled with a hyphen (British English) or as one word (American English).
Context: ... (default), or False to disable it. A long time cache will be located on the file syste...

(TIME_HYPHEN)


112-113: Refactor wording for clarity in preferred format introduction
Make the phrasing more active and consistent with other docs.

- Each TTS platform produces audio samples in different formats, not always compatible with every media player. TTS integration building block supports a way to configure preferred target audio format through `options` option of `speak` or `say` actions.
+ Each TTS platform produces audio samples in different formats that aren’t always compatible with every media player. The TTS integration building block lets you configure a preferred target audio format via the `options` parameter for the `speak` and `say` actions.

114-115: Fix grammar and add missing article in FFmpeg integration note
Correct verb form and add “the” for consistency.

- TTS integration building block uses [FFmpeg integration](/integrations/ffmpeg) to perform audio transcoding when target entity platform does not supports one or all the specified preferred audio format settings (refer to specific platform documentation for any supported setting with related supported values).
+ The TTS integration building block uses the [FFmpeg integration](/integrations/ffmpeg) to perform audio transcoding when the target entity platform does not support one or more of the specified preferred audio format settings (refer to platform documentation for supported settings and values).
🧰 Tools
🪛 LanguageTool

[grammar] ~114-~114: The auxiliary verb ‘do’ requires the base form of the verb.
Context: ...ng when target entity platform does not supports one or all the specified preferred audi...

(DID_BASEFORM)


123-124: Rephrase example heading for consistency
Shorten and align with other examples.

- Example to produce an MP3 audio at 22050Hz:
+ Example: produce MP3 audio at 22050 Hz:
🧰 Tools
🪛 LanguageTool

[uncategorized] ~123-~123: Possible missing comma found.
Context: ...ored). Example to produce an MP3 audio at 22050Hz: ```yaml action: tts.speak tar...

(AI_HYDRA_LEO_MISSING_COMMA)


141-141: Add Oxford comma in REST API parameters list
Maintain consistency with other parameter listings.

- Additional parameters `cache`, `language` and `options` are supported, as JSON attributes, as described for `speak` action.
+ Additional parameters `cache`, `language`, and `options` are supported as JSON attributes, as described for the `speak` action.

196-201: Streamline troubleshooting section and improve examples
Use active voice, Oxford comma, and clarify bit-depth terminology.

- Some media players could reproduce only partial, corrupted or no audio at all when the audio format is not fully supported. In such cases it is required to experiment with different combinations of audio formats, channels, sample rates and bits using [preferred audio settings](#preferred-audio-settings) options.
- For example, some Google Cast devices skip initial audio part when the audio is sampled at 22050Hz, and to fix the problem it is required to set the `preferred_sample_rate` setting in the `options` option to `44100`. 
+ Some media players only play partial, corrupted, or no audio when the format isn’t fully supported. In such cases, experiment with different combinations of audio format, channels, sample rate, and bit depth using the [preferred audio settings](#preferred-audio-settings).
+
+ For example, some Google Cast devices skip the initial audio when sampled at 22050 Hz. To fix this, set `preferred_sample_rate: 44100` under the `options` parameter.
🧰 Tools
🪛 LanguageTool

[typographical] ~199-~199: It appears that a comma is missing.
Context: ... format is not fully supported. In such cases it is required to experiment with diffe...

(DURING_THAT_TIME_COMMA)


[uncategorized] ~201-~201: You might be missing the article “the” here.
Context: ... example, some Google Cast devices skip initial audio part when the audio is sampled at...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)


[style] ~201-~201: Consider using a different verb for a more formal wording.
Context: ...the audio is sampled at 22050Hz, and to fix the problem it is required to set the `...

(FIX_RESOLVE)

🪛 markdownlint-cli2 (0.17.2)

201-201: Trailing spaces
Expected: 0 or 2; Actual: 1

(MD009, no-trailing-spaces)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between af0442e and 2fe3f0a.

📒 Files selected for processing (1)
  • source/_integrations/tts.markdown (4 hunks)
🧰 Additional context used
🪛 LanguageTool
source/_integrations/tts.markdown

[uncategorized] ~49-~49: You might be missing the article “the” here.
Context: ...che section](#cache) for information on cache option. Additional settings can b...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)


[uncategorized] ~62-~62: You might be missing the article “the” here.
Context: ...che section](#cache) for information on cache option. Additional settings can b...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)


[uncategorized] ~108-~108: This adjective is normally spelled with a hyphen (British English) or as one word (American English).
Context: ... (default), or False to disable it. A long time cache will be located on the file syste...

(TIME_HYPHEN)


[grammar] ~114-~114: The auxiliary verb ‘do’ requires the base form of the verb.
Context: ...ng when target entity platform does not supports one or all the specified preferred audi...

(DID_BASEFORM)


[uncategorized] ~118-~118: Loose punctuation mark.
Context: ...all optional, are: - preferred_format: Set the audio format. When not supporte...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~119-~119: Loose punctuation mark.
Context: ... output files. - preferred_sample_rate: Set the sample rate. When not supported...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~120-~120: Loose punctuation mark.
Context: ...mpeg tool. - preferred_sample_channels: Set the number of audio channels. When ...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~121-~121: Loose punctuation mark.
Context: ... FFmpeg tool. - preferred_sample_bytes: Set the audio bit sampling. When not su...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~123-~123: Possible missing comma found.
Context: ...ored). Example to produce an MP3 audio at 22050Hz: ```yaml action: tts.speak tar...

(AI_HYDRA_LEO_MISSING_COMMA)


[typographical] ~199-~199: It appears that a comma is missing.
Context: ... format is not fully supported. In such cases it is required to experiment with diffe...

(DURING_THAT_TIME_COMMA)


[uncategorized] ~201-~201: You might be missing the article “the” here.
Context: ... example, some Google Cast devices skip initial audio part when the audio is sampled at...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)


[style] ~201-~201: Consider using a different verb for a more formal wording.
Context: ...the audio is sampled at 22050Hz, and to fix the problem it is required to set the `...

(FIX_RESOLVE)

🪛 markdownlint-cli2 (0.17.2)
source/_integrations/tts.markdown

201-201: Trailing spaces
Expected: 0 or 2; Actual: 1

(MD009, no-trailing-spaces)

⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Redirect rules - home-assistant-docs
  • GitHub Check: Header rules - home-assistant-docs
  • GitHub Check: Pages changed - home-assistant-docs
🔇 Additional comments (4)
source/_integrations/tts.markdown (4)

110-110: Section header for preferred audio settings looks good
Clear and correctly formatted.


116-117: Preferred audio settings introduction is well formatted
Blank lines around the list ensure good readability.


118-121: Preferred audio settings list is correctly formatted
Using dashes and surrounded by blank lines satisfies pipeline requirements.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~118-~118: Loose punctuation mark.
Context: ...all optional, are: - preferred_format: Set the audio format. When not supporte...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~119-~119: Loose punctuation mark.
Context: ... output files. - preferred_sample_rate: Set the sample rate. When not supported...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~120-~120: Loose punctuation mark.
Context: ...mpeg tool. - preferred_sample_channels: Set the number of audio channels. When ...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~121-~121: Loose punctuation mark.
Context: ... FFmpeg tool. - preferred_sample_bytes: Set the audio bit sampling. When not su...

(UNLIKELY_OPENING_PUNCTUATION)


125-135: YAML code block for options example is clear
Indentation and fencing follow Home Assistant standards.

@frenck frenck requested a review from Copilot May 25, 2025 17:23
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Completes and clarifies the TTS integration documentation by adding missing action parameters, detailing audio transcoding options, and providing troubleshooting steps.

  • Expanded tts.speak and legacy say action parameters to include cache, media_player_entity_id, and richer options
  • Introduced a Preferred audio settings section with FFmpeg-based transcoding parameters
  • Updated REST API docs for new parameters and added a troubleshooting section for partial or corrupted audio playback

Fixed typos and improved used terms

Co-authored-by: Copilot <[email protected]>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (8)
source/_integrations/tts.markdown (8)

49-49: Remove redundant “options” duplication in parameter list
The phrase “options options” is redundant. Simplify the sentence and add a comma before the final item for clarity.

-The `tts.speak` action supports `message`, `language`, `cache`, `media_player_entity_id` and `options` options.
+The `tts.speak` action supports `message`, `language`, `cache`, `media_player_entity_id`, and `options`.
🧰 Tools
🪛 LanguageTool

[uncategorized] ~49-~49: You might be missing the article “the” here.
Context: ...che section](#cache) for information on cache option. Additional settings can b...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)


62-62: Remove redundant “options” duplication in parameter list
Similar to tts.speak, the legacy say action line repeats “options.” Remove the extra word and add the Oxford comma.

-The `say` action supports `message`, `language`, `cache` and `options` options.
+The `say` action supports `message`, `language`, `cache`, and `options`.
🧰 Tools
🪛 LanguageTool

[uncategorized] ~62-~62: You might be missing the article “the” here.
Context: ...che section](#cache) for information on cache option. Additional settings can b...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)


108-108: Improve grammar and boolean formatting in cache description
Use lowercase YAML booleans, convert “long time cache” to “long-term cache,” and streamline wording.

-The integration cache can be controlled with the `cache` option in the action to `speak` or `say`, setting it to `True` to enable it (default), or `False` to disable it. A long time cache will be located on the file system. The in-memory cache for fast responses to media players will be auto-cleaned after a short period.
+The integration cache is controlled with the `cache` option in the `speak` or `say` actions by setting it to `true` (default) to enable, or `false` to disable. A long-term cache is stored on the file system. The in-memory cache for fast responses to media players is automatically cleaned after a short period.
🧰 Tools
🪛 LanguageTool

[uncategorized] ~108-~108: This adjective is normally spelled with a hyphen (British English) or as one word (American English).
Context: ... (default), or False to disable it. A long time cache will be located on the file syste...

(TIME_HYPHEN)


114-114: Refine FFmpeg integration description for clarity
Add missing articles and simplify the conditional wording.

-TTS integration building block uses [FFmpeg integration](/integrations/ffmpeg) to perform audio transcoding when target entity platform does not support one or all the specified preferred audio format settings (refer to specific platform documentation for any supported setting with related supported values).
+The TTS integration uses the [FFmpeg integration](/integrations/ffmpeg) to perform audio transcoding when the target entity platform does not support one or more of the specified preferred audio format settings. Refer to the platform’s documentation for supported values.

141-141: Add serial comma and article in REST API description
Include the Oxford comma and reference “the speak action” for consistency.

-Additional parameters `cache`, `language` and `options` are supported, as JSON attributes, as described for `speak` action.
+Additional parameters `cache`, `language`, and `options` are supported as JSON attributes, as described for the `speak` action.

197-197: Consistent punctuation in troubleshooting heading
Add a comma before “or” to match list styling in other headings.

-### Partial, corrupted or no audio
+### Partial, corrupted, or no audio

199-199: Clarify and streamline troubleshooting guidance
Use serial commas and simplify phrasing for readability.

-Some media players could reproduce only partial, corrupted or no audio at all when the audio format is not fully supported. In such cases it is required to experiment with different combinations of audio formats, channels, sample rates and bits using [preferred audio settings](#preferred-audio-settings) options.
+Some media players may produce partial, corrupted, or no audio when the format is not fully supported. In such cases, experiment with different combinations of formats, channels, sample rates, and bit depths using the [preferred audio settings](#preferred-audio-settings) option.
🧰 Tools
🪛 LanguageTool

[typographical] ~199-~199: It appears that a comma is missing.
Context: ... format is not fully supported. In such cases it is required to experiment with diffe...

(DURING_THAT_TIME_COMMA)


201-201: Simplify Google Cast troubleshooting example
Break into two sentences, remove duplicate “options,” and use a clearer directive.

-For example, some Google Cast devices skip initial audio part when the audio is sampled at 22050Hz, and to fix the problem it is required to set the `preferred_sample_rate` setting in the `options` option to `44100`. 
+For example, some Google Cast devices skip the initial audio when sampled at 22050 Hz. To fix this, set the `preferred_sample_rate` option to `44100`.
🧰 Tools
🪛 LanguageTool

[uncategorized] ~201-~201: You might be missing the article “the” here.
Context: ... example, some Google Cast devices skip initial audio part when the audio is sampled at...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)


[style] ~201-~201: Consider using a different verb for a more formal wording.
Context: ...the audio is sampled at 22050Hz, and to fix the problem it is required to set the `...

(FIX_RESOLVE)

🪛 markdownlint-cli2 (0.17.2)

201-201: Trailing spaces
Expected: 0 or 2; Actual: 1

(MD009, no-trailing-spaces)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 2fe3f0a and db12a56.

📒 Files selected for processing (1)
  • source/_integrations/tts.markdown (4 hunks)
🧰 Additional context used
🪛 LanguageTool
source/_integrations/tts.markdown

[uncategorized] ~49-~49: You might be missing the article “the” here.
Context: ...che section](#cache) for information on cache option. Additional settings can b...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)


[uncategorized] ~62-~62: You might be missing the article “the” here.
Context: ...che section](#cache) for information on cache option. Additional settings can b...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)


[uncategorized] ~108-~108: This adjective is normally spelled with a hyphen (British English) or as one word (American English).
Context: ... (default), or False to disable it. A long time cache will be located on the file syste...

(TIME_HYPHEN)


[uncategorized] ~118-~118: Loose punctuation mark.
Context: ...all optional, are: - preferred_format: Set the audio format. When not supporte...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~119-~119: Loose punctuation mark.
Context: ... output files. - preferred_sample_rate: Set the sample rate. When not supported...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~120-~120: Loose punctuation mark.
Context: ...mpeg tool. - preferred_sample_channels: Set the number of audio channels. When ...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~121-~121: Loose punctuation mark.
Context: ... FFmpeg tool. - preferred_sample_bytes: Set the audio bit sampling. When not su...

(UNLIKELY_OPENING_PUNCTUATION)


[typographical] ~199-~199: It appears that a comma is missing.
Context: ... format is not fully supported. In such cases it is required to experiment with diffe...

(DURING_THAT_TIME_COMMA)


[uncategorized] ~201-~201: You might be missing the article “the” here.
Context: ... example, some Google Cast devices skip initial audio part when the audio is sampled at...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)


[style] ~201-~201: Consider using a different verb for a more formal wording.
Context: ...the audio is sampled at 22050Hz, and to fix the problem it is required to set the `...

(FIX_RESOLVE)

🪛 markdownlint-cli2 (0.17.2)
source/_integrations/tts.markdown

201-201: Trailing spaces
Expected: 0 or 2; Actual: 1

(MD009, no-trailing-spaces)

⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Redirect rules - home-assistant-docs
  • GitHub Check: Header rules - home-assistant-docs
  • GitHub Check: Pages changed - home-assistant-docs
🔇 Additional comments (5)
source/_integrations/tts.markdown (5)

110-110: Preferred audio settings heading is correctly formatted
The “## Preferred audio settings” heading has appropriate blank lines around it and follows the section style.


112-112: Introduction to preferred audio settings reads well
The description clearly explains why platforms may need transcoding. No changes needed.


116-116: Available preferred audio settings heading is correct
This line correctly introduces the list of optional settings.


118-121: Preferred audio settings list items are clear
The bullet list uses dash markers and is properly surrounded by blank lines. No formatting changes needed.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~118-~118: Loose punctuation mark.
Context: ...all optional, are: - preferred_format: Set the audio format. When not supporte...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~119-~119: Loose punctuation mark.
Context: ... output files. - preferred_sample_rate: Set the sample rate. When not supported...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~120-~120: Loose punctuation mark.
Context: ...mpeg tool. - preferred_sample_channels: Set the number of audio channels. When ...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~121-~121: Loose punctuation mark.
Context: ... FFmpeg tool. - preferred_sample_bytes: Set the audio bit sampling. When not su...

(UNLIKELY_OPENING_PUNCTUATION)


125-125: YAML example block start is correct
The code fence is properly introduced; no edits required.

@synesthesiam synesthesiam merged commit b9999c0 into home-assistant:current May 27, 2025
7 checks passed
@home-assistant home-assistant bot removed needs-rebase The PR has been branched of the wrong base branch or targets an incorrect target branch in-progress This PR/Issue is currently being worked on labels May 27, 2025
@synesthesiam
Copy link
Contributor

Thanks!

@github-actions github-actions bot locked and limited conversation to collaborators May 28, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
current This PR goes into the current branch has-parent This PR has a parent PR in a other repo
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Outdated or incomplete documentation for "speak" action of TTS integration
2 participants