feat(tts): add pitch and volume configuration options for Edge TTS - #21935
Closed
ariel-ai-bot wants to merge 2 commits into
Closed
feat(tts): add pitch and volume configuration options for Edge TTS#21935ariel-ai-bot wants to merge 2 commits into
ariel-ai-bot wants to merge 2 commits into
Conversation
- Add DEFAULT_EDGE_PITCH constant (+0Hz) - Read pitch from tts.edge.pitch in _generate_edge_tts - Pass pitch to edge-tts Communicate when configured - Update documentation with pitch option and format examples Fixes: edge-tts 預設 config.yaml 沒有讀取音高的選項
- Add DEFAULT_EDGE_VOLUME = "+0%" constant - Modified _generate_edge_tts() to read volume from tts.edge.volume config - Pass volume to edge_tts.Communicate() when configured - Update documentation with volume option and format examples edge-tts.Communicate accepts: rate, volume, pitch parameters
Collaborator
|
Duplicate of #2965 which adds the same rate/pitch/volume controls for Edge TTS. Consider consolidating. |
Author
|
This PR is a duplicate of #2965, which already implements the same Thank you @alt-glitch for the review and for pointing this out! 🙏 |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add support for configurable pitch and volume adjustment in the Edge TTS provider. Previously, the
_generate_edge_tts()function only readvoiceandspeedfrom the config, ignoring pitch and volume entirely.Changes
tools/tts_tool.py:DEFAULT_EDGE_PITCH = "+0Hz"andDEFAULT_EDGE_VOLUME = "+0%"constants_generate_edge_tts()to readpitchfromtts.edge.pitchandvolumefromtts.edge.volumeconfigedge_tts.Communicate()when configured (defaults skip the parameters to maintain backward compatibility)website/docs/user-guide/configuration.md:pitch: "+0Hz"andvolume: "+0%"options undertts.edge:in the config exampleConfig Usage
Verification
Confirmed that
edge_tts.Communicateacceptspitchandvolumeparameters:Source: https://github.com/rany2/edge-tts/blob/master/src/edge_tts/communicate.py
Type Safety
Added explicit type annotation
kwargs: Dict[str, Any]for the kwargs dict to satisfy type checkers.