-
Notifications
You must be signed in to change notification settings - Fork 5
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
(Feature): Natural voice playback using tts for edge #25
Comments
This comment was marked as outdated.
This comment was marked as outdated.
I'm just realizing; are you talking about these voices? https://www.ghacks.net/2018/08/11/unlock-all-windows-10-tts-voices-system-wide-to-get-more-of-them/ |
It should read whichever tts voice is configured in chrome/chromium. This is separate from windows' voices and would require to pass the text through the browser API in order to be read. |
I think you might mean this? https://learn.microsoft.com/en-us/archive/msdn-magazine/2019/june/speech-text-to-speech-synthesis-in-net Couple of questions if not:
|
Hi, sorry for the delay in response. Was busy working on other stuff. You could check the forked repository I made for testing the changes, it works well. it requires ffmpeg, mpv and edge-tts to be installed. Then it would work like this: As for your questions:
|
If you want to communicate on discord I'm in the server I could integrate a change where there is an option in the menu that allows this option to be toggled on or off. As well as a script to setup the mpv, ffmpeg and all that on windows to make it easier for installation. Let me know if that sounds good. |
Thanks for providing a PoC of it, and no worries about taking time :) |
|
Yeah, it requires internet to be connected for natural voices. My bad, however I'll be able to work on a simple proper integration with the existing tts possibly after january 12th. |
@Iheuzio Saw your video on the owl-cat forum. Looks promising with a bit of delay still 👍 |
I just dabbled a bit with this in LinqPad, and I got it to work without having the python program installed, which would probably be preferred? |
hey, are you still working on that idea? I do have experience in coding wiht C# and unity but none in tts so i don't know if I would be of any help |
@Wazard Yes, and I've gotten it to work, but discovered that the service that is being used to generate the audio does not support multiple voices in one request. So I'm currently working on parallelizing calls for each section of the dialog. |
@Osmodium sorry for the probably dumb question, but: I saw that from the narrator you can add and download the natural voices. Couldn't be possible to use em within windows itself in this way? |
Hi, currently I won't have time to focus on this mod. I'm working on other stuff at the moment, I may be able to try helping out later however not for the meantime. |
Hey @Osmodium it's awesome ot hear that you have it working. Would it be possible to have a release not including multiple voices? How's the progress so far? |
Hi! I have just uploaded the experimental version of the mod (0.9.4-EXP) here which includes Natural Voices through the Bing service. It is the version from over a month ago, but progress has been slow. |
@Osmodium does this mod also work for pathfinder wotr, if not how can i make it work there? |
OK. I have found NaturlaVoiceSAPIAdapter repo on GitHub that enables us to use Natural voices (including those for Edge) with TTS. But it needs slight adjustment in SpeechMod to function. Just five new lines in Put these lines: if (voices[i].Contains("(Natural)"))
{
voices[i] = voices[i].Replace("(Natural)", "");
voices[i] = voices[i].Replace("(", "Natural (");
} just under if (!voices[i].Contains('-'))
voices[i] = $"{voices[i]}#Unknown";
else
voices[i] = voices[i].Replace(" - ", "#"); Whole method should look like this: public static string[] GetAvailableVoices()
{
string voicesDelim = getVoicesAvailable();
if (string.IsNullOrWhiteSpace(voicesDelim))
return Array.Empty<string>();
string[] voices = voicesDelim.Split(new[] { '\n' }, StringSplitOptions.RemoveEmptyEntries);
for (int i = 0; i < voices.Length; ++i)
{
if (!voices[i].Contains('-'))
voices[i] = $"{voices[i]}#Unknown";
else
voices[i] = voices[i].Replace(" - ", "#");
if (voices[i].Contains("(Natural)"))
{
voices[i] = voices[i].Replace("(Natural)", "");
voices[i] = voices[i].Replace("(", "Natural (");
}
}
return voices;
} You will get something like thise: Only tried if for few dialogs and books, but it seems to work just fine. |
@BelegCufea That looks awesome and interesting! It looks like it only works for Windows 11, or I might be missing something. |
@Osmodium I have no idea, but on the Repo page there is a mention about Win 10 in I'm using Windows 10. Can I use the Narrator natural voices on Windows 11? Yes, as long as your Windows 10 build number is 17763 or above (version 1809). You can choose and install Windows 11 Narrator voices here. Windows 10's Narrator doesn't support natural voices directly, but it does support SAPI 5 voices. So you can make Windows 11 Narrator voices work on Windows 10 via this engine. |
@BelegCufea I will test this out, since I'm on a Windows 10. Thanks! |
It seems to be working pretty well, apart from it crashing when issued to stop. I have to look into this, but otherwise this is a pretty elegant solution for those who want those voices, and possibly others too. |
@Osmodium Nice. Works fine on Win 11. No crashing at all. Even when interrupting dialogs. Sometimes there is a slight delay when using Edge voices, but not always. And even when there is one, it is acceptable (me thinks :-) ) And it seems it has some problem with
|
@Osmodium Update after a few more hours of play.
|
Hey All, just thought id add my own experience to the above mentioned ^. I cloned the repo and made the changes you mentioned above (plus using NaturlaVoiceSAPIAdapter). I was able to get it working and detecting all online and locally downloaded natural voices. After using for a bit i can confirm that using online voices seems to every so often (far more often than 1%) hang the game indefinitely. I have not delved into where exactly it is throwing (i cant see any errors) but there is definitely an issue there. If I find any other issues ill post here :) |
@LeapSoftware Thanks for info. Unfortunately, that is true. It is unstable when using online voices. Nevertheless, I have had no problems so far using offline natural voices. For anyone interested, I compiled the changes at my fork. It is highly experimental though! Use at your own risk :-) |
how do i make it to work? The only 2 available are Zira and David. I'm on win11 with natural voices installed |
I'll add the code to the project and I guess I can do a small writeup about having to use NaturalVoiceSAPIAdapter to make it work. |
Hi,
I've recently saw the project here and it is using the services directly in windows. However the natural voices do sound much better, but are locked from the normal api in windows. They could be accessed with the edge/chrome api through
chrome.ttsEngine
orchrome.tts
.The added benefit is you do not need windows to run this and you can relay the calls to windows, or possibly whatever text reader is configured for the browser. There is the github project here, the work is already done there and you can simply pass the command from unity into the edge-tts command from the program there.
If this sounds reasonable, I could try working on a possible integration.
The text was updated successfully, but these errors were encountered: