-
Notifications
You must be signed in to change notification settings - Fork 246
Add voice switcher for TTS #77
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
Open
igubanov
wants to merge
10
commits into
ramjke:develop
Choose a base branch
from
igubanov:tts-select-voice
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
f7389c5
add voice switcher
56a906a
add reflection hack to use more windows tts voices
550178d
backmerge silero-tts, resolve conflicts
766e21d
try move AvailableVoices to the LangugeSettings VM, but the combobox …
47995a3
leave AvailableVoices in TtsConfiguration, this works
b4197ed
dirty fixes asynchoronous update ui
06d0193
sometimes engine can be null and save to config (when enabling tts en…
a89e4cf
move available languages to view model
0d0d901
another try moved available voices from configuration to vm
889e189
sometimes dialog showes after task completed and never closes
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 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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,10 @@ | ||
| namespace Translumo.TTS.Engines; | ||
|
|
||
| public interface ITTSEngine: IDisposable | ||
| public interface ITTSEngine : IDisposable | ||
| { | ||
| void SpeechText(string text); | ||
|
|
||
| string[] GetVoices(); | ||
|
|
||
| void SetVoice(string voice); | ||
| } |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,6 +8,7 @@ public class SileroTTSEngine : ITTSEngine | |
| { | ||
| private dynamic _ipython; | ||
| private dynamic _model; | ||
| private string[] _voices; | ||
| private string _voice; | ||
| private readonly string _modelPath; | ||
| private readonly PythonEngineWrapper _pythonEngine; | ||
|
|
@@ -51,7 +52,8 @@ private void Init() | |
| _pyObjects.Add(_ipython); | ||
| }); | ||
|
|
||
| _voice = ((string[])_model.speakers).First(); | ||
| _voices = (string[])_model.speakers; | ||
| _voice = _voices.First(); | ||
| } | ||
|
|
||
| public void SpeechText(string text) | ||
|
|
@@ -146,5 +148,9 @@ private string GetModelFullPath(string langCode) | |
| _ => null | ||
| }; | ||
|
|
||
| public string[] GetVoices() => _voices; | ||
|
|
||
| public void SetVoice(string voice) => _voice = _voices.First(x => x.Equals(voice, StringComparison.OrdinalIgnoreCase)); | ||
|
Collaborator
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. There is a bug, exception occurred when TTS with voice is selected, then user switch to another TTS. Need to set TtsConfiguration.CurrentVoice after(before) this update. |
||
|
|
||
| private sealed record ModelDescription(string FileUrl, string WarmUpText); | ||
| } | ||
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| namespace Translumo.TTS; | ||
|
|
||
| public interface IObserverAvailableVoices | ||
| { | ||
| void UpdateVoice(IList<string> currentVoices); | ||
| } |
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.