1

Тема: Потрібна допомога з виводом голоса

Я не знаю бібліотек за допомогою яких я зможу навчити програму говоритию.Допоможіть хто знає(якщо можна поділіться ссилкою або кодом)

2

Re: Потрібна допомога з виводом голоса

https://cloud.google.com/text-to-speech … /libraries

var creds = GoogleCredential.FromFile("local-tenant-01-storage-4e7cb46646b1.json")
    .CreateScoped(TextToSpeechClient.DefaultScopes);

var channel = new Grpc.Core.Channel(TextToSpeechClient.DefaultEndpoint.ToString(), creds.ToChannelCredentials());

var client = TextToSpeechClient.Create(channel);

var input = new SynthesisInput
{
    Text = "test"
};

// Select the type of audio file you want returned.
AudioConfig config = new AudioConfig
{
    AudioEncoding = AudioEncoding.Mp3
};

VoiceSelectionParams voice = new VoiceSelectionParams
{
    LanguageCode = "en-US",
    SsmlGender = SsmlVoiceGender.Neutral
};

// Perform the Text-to-Speech request, passing the text input
// with the selected voice parameters and audio file type
var response = client.SynthesizeSpeech(new SynthesizeSpeechRequest
{
    Input = input,
    Voice = voice,
    AudioConfig = config
});

// Write the binary AudioContent of the response to an MP3 file.
using (Stream output = File.Create("sample.mp3"))
{
    response.AudioContent.WriteTo(output);
    Console.WriteLine($"Audio content written to file 'sample.mp3'");
}