Skip to content

Commit

Permalink
Добавил новые параметры голосов
Browse files Browse the repository at this point in the history
  • Loading branch information
gkurbesov committed Mar 24, 2024
1 parent ef1dedc commit 3ff4d5d
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 16 deletions.
6 changes: 3 additions & 3 deletions src/TextToSpeech/YaCloudKit.TTS/Model/VoiceEmotion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ namespace YaCloudKit.TTS;

public class VoiceEmotion
{
public static readonly VoiceEmotion Neutral = new VoiceEmotion("neutral");
public static readonly VoiceEmotion Good = new VoiceEmotion("good");
public static readonly VoiceEmotion Evil = new VoiceEmotion("evil");
public static readonly VoiceEmotion Neutral = new("neutral");
public static readonly VoiceEmotion Good = new("good");
public static readonly VoiceEmotion Evil = new("evil");

public string Value { get; }

Expand Down
8 changes: 5 additions & 3 deletions src/TextToSpeech/YaCloudKit.TTS/Model/VoiceLanguage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ namespace YaCloudKit.TTS;

public class VoiceLanguage
{
public static readonly VoiceLanguage Russian = new VoiceLanguage("ru-RU");
public static readonly VoiceLanguage Kazakh = new VoiceLanguage("kk-KK");
public static readonly VoiceLanguage English = new VoiceLanguage("en-US");
public static readonly VoiceLanguage Russian = new("ru-RU");
public static readonly VoiceLanguage Kazakh = new("kk-KK");
public static readonly VoiceLanguage English = new("en-US");
public static readonly VoiceLanguage German = new("de-DE");
public static readonly VoiceLanguage Uzbek = new("uz-UZ");

public string Value { get; }

Expand Down
22 changes: 13 additions & 9 deletions src/TextToSpeech/YaCloudKit.TTS/Model/VoiceName.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,19 @@ namespace YaCloudKit.TTS;

public class VoiceName
{
public static readonly VoiceName Alena = new VoiceName("alena");
public static readonly VoiceName Filipp = new VoiceName("filipp");
public static readonly VoiceName Jane = new VoiceName("jane");
public static readonly VoiceName Omazh = new VoiceName("omazh");
public static readonly VoiceName Zahar = new VoiceName("zahar");
public static readonly VoiceName Ermil = new VoiceName("ermil");
public static readonly VoiceName Amira = new VoiceName("amira");
public static readonly VoiceName John = new VoiceName("john");

public static readonly VoiceName Lea = new("lea");
public static readonly VoiceName Alena = new("alena");
public static readonly VoiceName Filipp = new("filipp");
public static readonly VoiceName Jane = new("jane");
public static readonly VoiceName Omazh = new("omazh");
public static readonly VoiceName Zahar = new("zahar");
public static readonly VoiceName Ermil = new("ermil");
public static readonly VoiceName Amira = new("amira");
public static readonly VoiceName John = new("john");
public static readonly VoiceName Madi = new("madi");
public static readonly VoiceName Madirus = new("madirus");
public static readonly VoiceName Nigora = new("nigora");

public string Value { get; }

public VoiceName(string value)
Expand Down
38 changes: 37 additions & 1 deletion src/TextToSpeech/YaCloudKit.TTS/Model/VoiceParameters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ namespace YaCloudKit.TTS
/// </summary>
public class VoiceParameters
{
/// <summary>
/// Женский немецкий голос Lea
/// </summary>
public static readonly VoiceParameters Lea = new(VoiceName.Lea);

/// <summary>
/// Женский русский голос Alena
/// </summary>
Expand Down Expand Up @@ -37,6 +42,30 @@ public class VoiceParameters
/// </summary>
public static readonly VoiceParameters Ermil = new(VoiceName.Ermil);

/// <summary>
/// Женский казахский голос
/// </summary>
public static readonly VoiceParameters Amira = new(VoiceName.Amira);

/// <summary>
/// Мужской казахский голос
/// </summary>
public static readonly VoiceParameters Madi = new(VoiceName.Madi);

/// <summary>
/// Мужской английский голос
/// </summary>
public static readonly VoiceParameters John = new(VoiceName.John);

/// <summary>
/// Мужской русский голос
/// </summary>
public static readonly VoiceParameters Madirus = new(VoiceName.Madirus);

/// <summary>
/// Женский узбекский голос
/// </summary>
public static readonly VoiceParameters Nigora = new(VoiceName.Nigora);

/// <summary>
/// Название голоса. Подробнее см. список голосов
Expand Down Expand Up @@ -64,11 +93,18 @@ public class VoiceParameters
/// Инициалзация параметров голоса для генерации речи
/// </summary>
/// <param name="name">Название голоса</param>
public VoiceParameters(VoiceName name)
public VoiceParameters(
VoiceName name,
VoiceLanguage language = null,
string speed = null,
VoiceEmotion emotion = null)
{
if (string.IsNullOrWhiteSpace(name))
throw new ArgumentNullException(nameof(name));
Name = name;
Language = language;
Speed = speed;
Emotion = emotion;
}
}
}

0 comments on commit 3ff4d5d

Please sign in to comment.