Skip to content
Merged
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
17 changes: 12 additions & 5 deletions src/mock/engineMock/talkModelMock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,16 +182,23 @@ export async function textToActtentPhrasesMock(text: string, styleId: number) {
for (const token of tokens) {
// 記号の場合は無音を入れて区切る
if (token.pos == "記号") {
if (textPhrase.length == 0) continue;

const accentPhrase = textToAccentPhraseMock(textPhrase);
accentPhrase.pauseMora = {
const pauseMora = {
text: "、",
vowel: "pau",
vowelLength: 1 - 1 / (accentPhrases.length + 1),
pitch: 0,
};
accentPhrases.push(accentPhrase);

// テキストが空の場合は前のアクセント句に無音を追加、空でない場合は新しいアクセント句を追加
let accentPhrase: AccentPhrase;
if (textPhrase.length === 0) {
accentPhrase = accentPhrases[accentPhrases.length - 1];
} else {
accentPhrase = textToAccentPhraseMock(textPhrase);
accentPhrases.push(accentPhrase);
}
accentPhrase.pauseMora = pauseMora;

textPhrase = "";
continue;
}
Expand Down
Loading