Devs sprechen jetzt wenn sie was wollen

This commit is contained in:
2024-04-05 17:29:05 +02:00
parent 3a4b2bca76
commit 056a444ed5
9 changed files with 77455 additions and 1853 deletions

View File

@ -32,13 +32,13 @@ public class Text2Speech : MonoBehaviour
private readonly string _googelCloudApiKey = "AIzaSyDNpkVyAUU4AvSwAErVMlZ1lSvGfpkEs0Q";
private readonly string _google_CloudApiUrl = "https://texttospeech.googleapis.com/v1/text:synthesize";
private readonly string _outputPath = "C:\\Users\\PC\\VoiceTest\\Assets\\Scirpts\\audio.wav";
private readonly string _outputPath = "path/to/audio.wav";
private string _tmpPath = "tmp_audio.wav";
private OpenAIAPI _openAiApi;
private Conversation? _conversation;
private readonly string _openAiApiKey = "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";
private readonly string _prompt = "Write a short text for an NPC in a game.The text should be based on the following bullet-point context, which describes the events of the last moments. Remember to only respond with the short text that the ONE NPC should speak! The context is: ";
private readonly string _prompt = "Write a short text for an NPC in a game. The text should be based on the following bullet-point context, which describes the events of the last moments. Remember to only respond with the short text that the ONE NPC should speak! The context is: ";
void Start()
{
@ -71,6 +71,12 @@ public class Text2Speech : MonoBehaviour
}
}
public void Generate(string c)
{
context = c;
generate = true;
}
public void GetRandomGermanVoice(string gender, Action<JToken> callback)
{
StartCoroutine(GetRandomGermanVoiceCoroutine(gender, callback));