Giter Club home page Giter Club logo

Comments (15)

lexkoro avatar lexkoro commented on July 19, 2024 3

Hi, thanks for the kind words. :)

Overall structure of the metadata is

wav file | text | speaker | emotion | speech rate

Here is a sample from the metadata used https://pastebin.com/NiBrw6yw

So each speaker has several wav files for training, which range from 1 to ~8 seconds.
The wav files have a sampling rate of 22050 Hz and 16 bit encoding.
The wav files must contain only clean speech!!
So no noise, no background music, as this would affect the quality of the trained model.
On average each speaker has ~600 files. The speaker with least data has ~120 files while the one with most has around ~10.000 files.

For each file there is also a transcript (text) of what is spoken in the file. These texts must be cleaned. For example, numbers must be written out (1 -> one) or abbreviations must be expanded (if they are fully pronounced).

The files and texts must be assigned to a speaker.

This is a rough summary of what is needed.

from gametts.

lexkoro avatar lexkoro commented on July 19, 2024 3
  1. You can train in any language if you have enough data for it.
  2. You can ignore "emotion", it is something I am currently working on. Where you can condition the speech on emotions.
  3. The speech rate is just number of chars / file duration , so I can filter out speech files that are too fast or too slow.

The training of a model itself is not the difficulty. https://github.com/jaywalnut310/vits#pre-requisites
It's the pre-processing (extracting the files, cleaning the data, etc.) which takes a lot of time.
But most importantly, you need enough GPU resources. I would say at least 16 GB if you don't want to wait forever till a model is trained.

from gametts.

reneroth avatar reneroth commented on July 19, 2024 2

Sure, if you help me with extracting, preprocessing and cleaning of the data :)

What format do you need the data in? This TTS system is a godsend for mod developers, and your work at creating an easy-to-use GUI and providing pre-trained models might just turn out to be a game changer for the modding community as a whole.

from gametts.

DanBmh avatar DanBmh commented on July 19, 2024 1

from gametts.

lexkoro avatar lexkoro commented on July 19, 2024 1

@JJDonYT Das Tool bietet lediglich eine Schnittstelle, die die Verwendung des trainierten Modells vereinfachen soll.

Wenn du anhand der dir vorliegenden Voicelines ein eigenes Modell trainieren willst,
ist das die von mir verwendete Repository. https://github.com/jaywalnut310/vits

Dort gibt es auch Beispiele, wie die Metadaten zu strukturieren sind, ähnlich wie ich es oben aufgezeigt habe.
Nur anstatt des Sprechernamens, nimmst du die zugehörige Sprecher ID, ähnlich hier.

Ich kann aber nicht garantieren, dass das trainierte Modell dann direkt mit der GUI funktioniert. Es könnte sein, dass weitere Anpassungen notwendig sind. Müsste mich sich dann durch den Code wurschteln...

from gametts.

lexkoro avatar lexkoro commented on July 19, 2024 1

Hallo, ich habe was sehr interessantes entdeckt: https://github.com/neonbjb/tortoise-tts

Hey TorToise kenne ich, aber man muss bedenken, dass der Name Programm ist...
Tortoise is a bit tongue in cheek: this model is insanely slow. It leverages both an autoregressive decoder and a diffusion decoder; both known for their low sampling rates. **On a K80, expect to generate a medium sized sentence every 2 minutes.**
Ohne eine leistungsstarke GPU wird man es kaum produktiv nutzen können.

Dort braucht es nur 3-5 Audiodateien die ca. 10 Sekunden gehen um eine Stimme unerwartet gut zu klonen.

Theoretisch wäre dies auch mit dem von mir verwendeten VITS Modell möglich, wenn ich mit einer Datenmenge wie TorToise trainiert hätte.
They were trained on a dataset consisting of ~50k hours of speech data
Ein solcher Datensatz ist mir für die deutsche Sprache aber nicht bekannt.
Zusätzlich dann noch die Trainingsdauer und Ressourcen Anforderungen...
These models were trained on my "homelab" server with 8 RTX 3090s over the course of several months.

In dem aktuell von mir trainierten Modell habe ich auch solche Tests durchgeführt und es funktioniert ganz gut, solange die Merkmale der zu klonende Stimme in einem Spektrum liegt, das so ähnlich in den Trainingsdaten vorkam. Die Datenmenge macht es am ende aus.

Man kann sogar Stimmen miteinander kombinieren und dadurch eine neue erschaffen.

Das ist bereits jetzt möglich, aber nur über den Code.

Ich wollte mal fragen, ob es vielleicht möglich ist, das irgendwie in GameTTS mit einzubauen?

Möglich ist alles, TorToise hat eine recht gut programmierte Schnittstelle. Den Synthesizer https://github.com/lexkoro/GameTTS/blob/main/GameTTS/vits/synthesizer.py müsste man durch deren Interface ersetzen.

Die Frage ob es auch andere Sprachen als Englisch unterstützen kann: "There's no reason to believe it couldn't support other languages, but you'd need to re-train the model. I've decided to release details on how I trained these models (it's not really that complicated, just requires a lot of data and compute) in a paper I'll release on arxiv in the next month or two."

Der Autor sagt ja schon richtig, dass es keinen Grund gibt, warum andere Sprachen nicht funktionieren sollten. Aber man muss diese erst trainieren. Wie oben schon erwähnt, sind die Anforderungen an eine solches Training aber enorm. Da müsste sich erst einmal jemanden finden, der das angehen will.

PS: Ich hatte auch schon ein multilinguales VITS Modell trainiert, heißt die deutschen Sprecher konnten dann auch englisch, französisch oder auch polnisch sprechen. So auch umgekehrt für die nicht deutsch sprechenden Sprecher. Wenn ich das Thema wieder angehe, werden dementsprechend auch mehr stimmliche Merkmale aufgrund der anderen Sprachen zur Verfügung stehen...

from gametts.

lexkoro avatar lexkoro commented on July 19, 2024

Sure, if you help me with extracting, preprocessing and cleaning of the data :)

from gametts.

TeemoCell avatar TeemoCell commented on July 19, 2024

Sure, if you tell me how to. I would like add tons of new Voices. Do you have discord?
TeemoCell#4915

from gametts.

reneroth avatar reneroth commented on July 19, 2024

This sounds like it'd be near-impossible to do by hand... and really feasible for video games with access to sound and subtitle files!

Please let me ask a few more questions:

  • English language is supported as well as German?
  • Can "emotion" be ignored for now, as long as it's all set to the same value, or does this offer functionality we need?
  • How is the "speech rate" calculated?

Given access to subtitles and voice files, as long as they are at least by some way assigned to each other - as they should be with most video games! - programmatically formatting the data in this way wouldn't be too hard. We could probably harness community power by providing an easy-to-follow Readme on how to train models, and maybe a few useful bash scripts (like using ffmpeg to convert arbitrary audio files into the required wav format).

from gametts.

DanBmh avatar DanBmh commented on July 19, 2024

I recently was able to extract the dialogs from Elex. The combined length is about 26h, with the following top speaker durations:

IKENI7 34705.877333
WEIDMANNX6 24668.373333
PANKRATZI7 23515.557333
GARTMANNI3 2309.482667
DIRKSI5 1114.154667

@lexkoro: Hast du dein Mozilla Discourse Account noch? Dann kann ich's dir da so wie die anderen wieder schicken.

@all-others: You can find the extraction steps at: https://gitlab.com/Jaco-Assistant/corcua. The instructions for Skyrim and Witcher can be found there as well, for those interested in training the model in a different language.

from gametts.

lexkoro avatar lexkoro commented on July 19, 2024

@DanBmh Sollte den Account noch haben, bin dort aber nicht mehr aktiv.

Elex hatte ich auch schon extrahiert, jedoch habe ich kein mapping zwischen Text und Audio (bzw. Sprecher) hinbekommen, in der strings.csv waren nur IDs.

Weiter hatten auch die Audiofiles zum Teil eine komische Audioqualität, weshalb ich mich mit den Daten nicht weiter auseinander gesetzt habe.

from gametts.

lexkoro avatar lexkoro commented on July 19, 2024

Würde nur noch das mapping zu den Sprechern fehlen. Die oben genannten durations sind nicht nach Sprecher aufgeteilt, bspw. hat IKENI7 mehrere Stimmen. Gilt auch für die anderen.

Ich hatte die Idee mir mit einem speaker-encoder, ähnliche Stimme gruppieren zu lassen.

from gametts.

JJDonYT avatar JJDonYT commented on July 19, 2024

Gibt es eine Möglichkeit, dass du Laien erklärst, wie sie sich selbst ein Model für dein Tool trainieren können?

Ich habe einen Haufen klare Voicelines von vielen Charactern auf dem Rechner und hätte gerne eine Möglichkeit, diese irgendwo einspeisen zu können um sie mit dem Tool zu verwenden. Ich schätze mal, dass wird nicht sehr kompliziert, sondern nur sehr viel Handarbeit sein?

Wenn es für dich einfacher ist, kann ich dir auch nach dem oben genannten Muster, was du auf Pastebin gepostet hast, die Files nachbauen und schicken, damit du die dann in das Tool einbauen kannst.

from gametts.

Highwindine avatar Highwindine commented on July 19, 2024

Hey!
Ich würde prinzipiell auch gern helfen, aber ich bin mit all den Infos irgendwie überfordert.
Wo genau müsste man denn anfangen und weitermachen?
Ich hab ne Menge Voicesamples von verschiedenen Sprechern schon rausgeschnitten, das ist ja wahrscheinlich das wichtigste.

Ist die "metadata" einfach nur ne .txt-Datei im Editor, in die ich das ganze eingeben muss?
Woher weiß ich denn, was die speech rate ist?

Und ansonsten bin ich einfach nur lost, ich hab von sowas -10 Ahnung und frag mich, ob ich überhaupt ne Hilfe sein könnte...
Ich bräuchte deutlich mehr Infos als das, schätze ich. Es sei denn, ich denke zu kompliziert xD

from gametts.

Banduck avatar Banduck commented on July 19, 2024

Hallo, ich habe was sehr interessantes entdeckt:
https://github.com/neonbjb/tortoise-tts
Dort braucht es nur 3-5 Audiodateien die ca. 10 Sekunden gehen um eine Stimme unerwartet gut zu klonen.
Man kann sogar Stimmen miteinander kombinieren und dadurch eine neue erschaffen.
Ich wollte mal fragen, ob es vielleicht möglich ist, das irgendwie in GameTTS mit einzubauen?

Die Frage ob es auch andere Sprachen als Englisch unterstützen kann:
"There's no reason to believe it couldn't support other languages, but you'd need to re-train the model. I've decided to release details on how I trained these models (it's not really that complicated, just requires a lot of data and compute) in a paper I'll release on arxiv in the next month or two."

from gametts.

Banduck avatar Banduck commented on July 19, 2024

Achso okay, ich dachte vielleicht kennst du das noch nicht und das könnte in irgendeiner Form hilfreich für GameTTS sein, aber du scheinst da wohl auf dem neusten Stand zu sein. :)

In dem aktuell von mir trainierten Modell habe ich auch solche Tests durchgeführt und es funktioniert ganz gut, solange die Merkmale der zu klonende Stimme in einem Spektrum liegt, das so ähnlich in den Trainingsdaten vorkam.

Ist es geplant diese Funktion in Zukunft für uns verfügbar zu machen in der GUI? Das wäre extrem nützlich, selbst wenn es nicht perfekt funktionieren sollte.

from gametts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.