This repository has been archived by the owner on Sep 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Added Possibility for ESpeak Config #3020
Merged
Merged
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
460fca6
Added Possibility for ESpeak Config
Genei180 8c4123d
Merge branch 'dev' of https://github.com/Genei180/mycroft-core into dev
Genei180 4be773e
Merge branch 'MycroftAI:dev' into dev
Genei180 3ff4fc2
Merge branch 'MycroftAI:dev' into dev
Genei180 b9f0001
Improved after krisgesling feedback
Genei180 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
|
@@ -32,8 +32,32 @@ def get_tts(self, sentence, wav_file): | |
Returns: | ||
tuple ((str) file location, None) | ||
""" | ||
subprocess.call(['espeak', '-v', self.lang + '+' + self.voice, | ||
'-w', wav_file, sentence]) | ||
|
||
# Create Argument String for Espeak | ||
arguments = ['espeak', '-v', self.lang + '+' + self.voice] | ||
argument = self.config.get("amplitude") | ||
if argument: | ||
arguments.append("-a "+argument) | ||
|
||
argument = self.config.get("gap") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The rest of this module is using single quotes - would be great to keep that consistency. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also thanks for the Feedback :) |
||
if argument: | ||
arguments.append("-g "+argument) | ||
|
||
argument = self.config.get("capital") | ||
if argument: | ||
arguments.append("-k "+argument) | ||
|
||
argument = self.config.get("pitch") | ||
if argument: | ||
arguments.append("-p "+argument) | ||
|
||
argument = self.config.get("speed") | ||
if argument: | ||
arguments.append("-s "+argument) | ||
|
||
arguments.extend(['-w', wav_file, sentence]) | ||
|
||
subprocess.call(arguments) | ||
return wav_file, None | ||
|
||
|
||
|
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.
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.
I know it's not a complex function, however I think we can make it clearer by using the name of each argument as the variable names eg:
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.
Thanks for the Feedback :)
Improved it