Monika-After-Story / MonikaModDev

DDLC fan mod to extend Monika
http://www.monikaafterstory.com/
Other
1.2k stars 683 forks source link

Submod Submission - Monika Text-To-Speech #8518

Open Batcastle opened 2 years ago

Batcastle commented 2 years ago

Name: Monika Text-To-Speech (sometimes written as Monika-TTS or Monika Text To Speech) Link: https://github.com/Batcastle/Monika-TTS About: Put simply, this submod gives Monika a voice!

This submod is based off of @zombiepigdragon's Simple Text-To-Speech. More info on this Submod's README page.

Bugs: Does not work on MacOS (need a Mimic binary for Mac and do not have a Mac to compile Mimic on). A command prompt pops up each time Monika speaks on Windows.

Cosmic-Incantations commented 2 years ago

I like the idea of this submod, I am tired of imagining a future where I can hear her voice can't wait to use it!

Batcastle commented 2 years ago

Just a note

I just released an update to this submod that improves MacOS and Windows support. Unfortunately the submod is roughly 256 MB now due to the 3 separate binaries needed for Windows, MacOS, and Linux. But it SHOULD work on all 3 platforms, albeit with some minor bugs on Windows.

Cosmic-Incantations commented 2 years ago

I wonder how it works, dose it use a voice bank like Hatsune Miku? do you make a few voce lines and then just have a thing that just auto tunes words to the same voice and then uses the words? Do you have to voice act EVERY SINGLE LINE?IDK how this works and it intrigues me, can't wait to pop back at the new year to hear her voice!

Batcastle commented 2 years ago

I wonder how it works, dose it use a voice bank like Hatsune Miku? do you make a few voce lines and then just have a thing that just auto tunes words to the same voice and then uses the words? Do you have to voice act EVERY SINGLE LINE?IDK how this works and it intrigues me, can't wait to pop back at the new year to hear her voice!

It's kinda complex, but someone went in and recorded A LOT of audio of someone's voice. Someone else then took that audio and ran it through some software to create a voice model: essentially a file that dictates how different syllables sound and how their sound changes with context.

Finally, a program, in this case Mimic, is handed the the text Monika is saying on screen, along with some built-in notes denoting where to put emphasis, where to pause, where to slow down or speed up, etc. It then uses that info as well as the model created earlier to synthesize Monika's voice.

The alternate Text-To-Speech engine, eSpeak, uses a similar approach, but the model isn't generated by audio. Someone goes in an manually writes a configuration file that denotes things like pitch, tone, etc. It sounds more robotic but performs better.

SonicCoder commented 2 years ago

It doesn't work for me

Batcastle commented 2 years ago

@SonicCoder What OS are you using? What version of MAS are you on? What version of Monika-TTS are you on?

multimokia commented 2 years ago

I should note the submod doesn't seem to handle cps tags very well as it doesn't parse *value, which MAS uses a lot.

cps tags function a little oddly as you can give them a multiplier MAS more or less never uses a flat cps setting, just the multiplier

Batcastle commented 2 years ago

@multimokia It handles both those situations. I added it in an update recently. If you look at voice.rpy the main block of code that handles the parsing starts at line 56, and there is a function that actually does the math called get_new_speed() farther down, that gets called on line 86.

multimokia commented 2 years ago

Yeah it wasn't there when you originally posted --which was when I checked.

That said, it would be best to move voice.rpy into submods, as no submod script files should be in game due to rpy file checks during updates.

Batcastle commented 2 years ago

That said, it would be best to move voice.rpy into submods, as no submod script files should be in game due to rpy file checks during updates.

Done. It wasn't there already cause Simple Text-To-Speech had you put the file in game, and I was unsure if the wrapping it does of the say() function would still work if it was loaded as a submod instead of as part of the normal mod. Looks like it does tho.

Went ahead and released an update for this since I just got done with the first-run topic I was making.

SonicCoder commented 2 years ago

I think it has something to do with the header thing, cus thats what MAS shows as an error, something about line 62

Batcastle commented 2 years ago

@SonicCoder Do you mind making an issue on the Monika-TTS repo so that we can fix it there and not clog up this chat?

SonicCoder commented 2 years ago

Sorry, geez, was just saying I had a problem

Batcastle commented 2 years ago

@SonicCoder I get that, and I am willing to help out and fix it. I'm just asking that you please report it on the Monika-TTS repo so that this chat doesn't get flooded, so others don't get spammed with emails that is tangential to the original topic of this issue, and so that it's easier for me keep track of your issue and report on it.