-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Add play and speed to cli options #3027
Add play and speed to cli options #3027
Conversation
--play argument uses simpleaudio to play the tts wav --speed <float 0.0-2.0> passes speed argument to Coqui Studio models
Thanks for the PR @David-bfg Would that work on different OSs? On linux you could just pipe to play commands I guess. It'd be better than introducing a new dependency. |
https://simpleaudio.readthedocs.io/en/latest/
Yes, I thought this would be preferable to just add a --pipe_out arg. A lot or all of the logs are print lines so they would need to be suppressed to do so. I was not aware of such a feature beyond putting if statements around each log, but a cursory google search looks like there's something more manageable for that. I'll look into it and circle back. Just hoping there is a similarly simple function to format the raw wav data to stdout as there is for saving it to a file. |
Considering conversion to pipe wav data for audio playback with ohter program like aplay. This is incomplete code. Using to get feedback before proceeding with implementation.
pipe_out = sys.stdout if args.pipe_out else None | ||
|
||
with contextlib.redirect_stdout(None if args.pipe_out else sys.stdout): | ||
# Late-import to make things load faster |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just indentation changes from lines
368-417 and
420-531.
Use hide whitespace to see changes better.
@erogol any comments you could give on commit f1b1f4a I went and looked into getting the wav file sent to standard out instead of the logs. This appears to be generally what I'd be looking to implement. Just wanted to check that the idea looked reasonable before cleaning it up and fully implementing. |
@David-bfg I think piping with standard out makes sense. But we should drop the play argument to keep things simpler. |
removed play and simpleaudio dependency in place of pipe fuctionality to allow passing wav file data to a program dedicated to playing audio.
@erogol unless there are further code comments this should be complete or at it's last stage. |
@David-bfg I'll review it next Monday. Thanks for the update. |
I installed via shows |
@omega3 https://pypi.org/project/TTS/ & latest readme show speed removed from docs. it only worked with ⓍTTS voice model if i recall. |
A quality of life addition for the cli tool.
Add play argument to play TTS after it is generated.
Additionally include speed argument to be used with Coqui Studio models.