Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/crowdin.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Crowdin Action
name: THAI CVVC-VCCV

on:
workflow_dispatch: {}
Expand Down
1,945 changes: 1,945 additions & 0 deletions DiffSinger_colab_notebook.ipynb

Large diffs are not rendered by default.

61 changes: 61 additions & 0 deletions OpenUtau.Plugin.Builtin/Data/ThaiArpasingBydeltaVOCALOID
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
using System;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be a .cs file

using System.Collections.Generic;
using System.IO;
using System.Linq;
using OpenUtau.Api;
using Serilog;

namespace OpenUtau.Plugin.Builtin {
/// <summary>
/// The Thai Arpasing Phonemizer.
/// <para>
/// Arpasing is a system that uses CMUdict as dictionary to convert Thai words to phoneme symbols.
/// See http://www.speech.cs.cmu.edu/cgi-bin/cmudict and https://arpasing.neocities.org/en/faq.html.
/// </para>
/// </summary>
[Phonemizer("Thai Arpasing Phonemizer", "THAI ARPA")]
public class ArpasingPhonemizer : LatinDiphonePhonemizer {
public ArpasingPhonemizer() {
try {
Initialize();
} catch (Exception e) {
Log.Error(e, "Failed to initialize.");
}
}

protected override IG2p LoadG2p() {
var g2ps = new List<IG2p>();

// Load dictionary from plugin folder.
string path = Path.Combine(PluginDir, "Thai arpasing.yaml");
if (!File.Exists(path)) {
Directory.CreateDirectory(PluginDir);
File.WriteAllBytes(path, Data.Resources.arpasing_template);
}
g2ps.Add(G2pDictionary.NewBuilder().Load(File.ReadAllText(path)).Build());

// Load dictionary from singer folder.
if (singer != null && singer.Found && singer.Loaded) {
string file = Path.Combine(singer.Location, "arpasing.yaml");
if (File.Exists(file)) {
try {
g2ps.Add(G2pDictionary.NewBuilder().Load(File.ReadAllText(file)).Build());
} catch (Exception e) {
Log.Error(e, $"Failed to load {file}");
}
}
}

// Load base g2p.
g2ps.Add(new ArpabetG2p());

return new G2pFallbacks(g2ps.ToArray());
}

protected override Dictionary<string, string[]> LoadVowelFallbacks() {
return "aa=ah,ae;ae=ah,aa;ah=aa,ae;ao=ow;ow=ao;eh=ae;ih=iy;iy=ih;uh=uw;uw=uh;aw=ao".Split(';')
.Select(entry => entry.Split('='))
.ToDictionary(parts => parts[0], parts => parts[1].Split(','));
}
}
}
Loading