Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ソング:labファイルを書き出す機能を追加 #2383

Merged
merged 27 commits into from
Dec 27, 2024

Conversation

sigprogramming
Copy link
Contributor

内容

labファイルを書き出す機能を追加します。

書き出し対象のトラックを指定できた方が良いと思いますが、ひとまず全てのトラックを対象として書き出す形で実装しています。

関連 Issue

その他

@voicevox-preview-pages
Copy link

voicevox-preview-pages bot commented Nov 30, 2024

🚀 プレビュー用ページを作成しました 🚀

更新時点でのコミットハッシュ:673bd4e

@sigprogramming sigprogramming marked this pull request as ready for review December 1, 2024 15:38
@sigprogramming sigprogramming requested a review from a team as a code owner December 1, 2024 15:38
@sigprogramming sigprogramming requested review from Hiroshiba and removed request for a team December 1, 2024 15:38
// 「ファイル」メニュー
const fileSubMenuData = computed<MenuItemData[]>(() => [
{
type: "button",
label: "音声を出力",
label: "音声書き出し",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

トーク側と合わせました。

@Hiroshiba
Copy link
Member

ちょっと実際に動かしてみて挙動だけチェックさせていただきました!
しっかり波形と合うlabが出力されてそうでした!!

Copy link
Member

@sevenc-nanashi sevenc-nanashi left a comment

Choose a reason for hiding this comment

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

ちょっと試していました。
各トラックの最初各トラックの最初のフレーズの始点が0になる感じだとかなり不便(1キャラに複数トラックが割り当たっている場合)なのでここは挙動を変えるべきだと思います。

@sigprogramming
Copy link
Contributor Author

各トラックの最初が0になる感じだとかなり不便

トラックの先頭を0秒としてlabファイル(音素タイミング)が書き出される形だと不便、ということでしょうか…?

@sevenc-nanashi
Copy link
Member

あ、明らかに書き方を間違えました...

トラックの最初のPhraseの始点が0秒だと不便、ですね。

@sigprogramming
Copy link
Contributor Author

なるほどです!
確かにトラックの最初のPhraseの始点が0秒で書き出されてますね。
これは意図した挙動ではないので(どこかバグってる)、修正します…!

@sigprogramming
Copy link
Contributor Author

修正しました!

@sevenc-nanashi
Copy link
Member

sevenc-nanashi commented Dec 15, 2024

トラックの始点じゃなく、最初のpauが0票の基準になってそう?

image
例えばこう言うケースで音声と一致しなくなります。
マイナス時間に行ったものは消して良いかなと思います(ヒホさんも同意見 at Discord

@sigprogramming
Copy link
Contributor Author

マイナス時間のところを書き出さないようにしました!

Copy link
Member

@sevenc-nanashi sevenc-nanashi left a comment

Choose a reason for hiding this comment

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

挙動は大丈夫そうでした。

Copy link
Member

@sevenc-nanashi sevenc-nanashi left a comment

Choose a reason for hiding this comment

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

あれ、また最初のフレーズが始点になってそう?

@sigprogramming
Copy link
Contributor Author

必要な処理を消してました…修正しました!

Comment on lines +3131 to +3140
const characterInfo = getters.CHARACTER_INFO(
trackSinger.engineId,
trackSinger.styleId,
);
if (characterInfo == undefined) {
// NOTE: characterInfoが存在しないというのは起こり得ないはずなので、存在しなかった場合はエラー
throw new Error(
"CharacterInfo corresponding to engineId and styleId does not exist.",
);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

元のコードはcharacterInfoが無かったときにcontinueするようになっていましたが、characterInfoが無いというのは起こり得ないと思うので、エラーをthrowするように変更しました。

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 5 out of 11 changed files in this pull request and generated 1 comment.

Files not reviewed (6)
  • src/components/Sing/ExportOverlay.vue: Evaluated as low risk
  • src/components/Sing/SingEditor.vue: Evaluated as low risk
  • src/mock/engineMock/synthesisMock.ts: Evaluated as low risk
  • src/store/audio.ts: Evaluated as low risk
  • src/components/Dialog/Dialog.ts: Evaluated as low risk
  • src/store/type.ts: Evaluated as low risk
Comments suppressed due to low confidence (3)

src/store/singing.ts:2948

  • The createArray function is not defined in the provided code, which could lead to runtime errors. Ensure that this function is defined or properly imported.
return createArray(

src/helpers/fileDataGenerator.ts:1

  • [nitpick] The function writeUint32 should have a proper type annotation for the value parameter.
writeUint32 = (value: number) => {

src/helpers/fileDataGenerator.ts:1

  • [nitpick] The function writeSample should have proper type annotations for the offset and value parameters.
writeSample = (offset: number, value: number) => {

Copy link
Member

@Hiroshiba Hiroshiba left a comment

Choose a reason for hiding this comment

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

ほぼLGTMです!!

いくつかミスがあるかも&提案まで!!

@Hiroshiba Hiroshiba requested a review from Copilot December 27, 2024 15:07
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 5 out of 12 changed files in this pull request and generated 1 comment.

Files not reviewed (7)
  • src/components/Sing/ExportOverlay.vue: Evaluated as low risk
  • src/components/Sing/SingEditor.vue: Evaluated as low risk
  • src/mock/engineMock/synthesisMock.ts: Evaluated as low risk
  • src/store/audio.ts: Evaluated as low risk
  • src/components/Dialog/Dialog.ts: Evaluated as low risk
  • src/store/type.ts: Evaluated as low risk
  • src/sing/domain.ts: Evaluated as low risk
Comments suppressed due to low confidence (4)

src/store/utility.ts:518

  • Add a test case to cover the generateLabelFileDataFromFramePhonemes function.
export async function generateLabelFileDataFromFramePhonemes(

src/store/singing.ts:3006

  • The error message should include the actual frame rates being compared. Suggestion: throw new Error(The frame rate between the phrase query (${phraseQuery.frameRate}) and the editor (${frameRate}) does not match.);
throw new Error("The frame rate between the phrase query and the editor does not match.");

src/helpers/fileDataGenerator.ts:66

  • [nitpick] The parameter name 'obj' is ambiguous. It should be renamed to 'options' for clarity.
export async function generateTextFileData(obj: {

src/helpers/fileDataGenerator.ts:72

  • Ensure that the encoding types are correctly handled and that there are no potential issues with the conversion.
const textBlob = {

Copy link
Member

@Hiroshiba Hiroshiba left a comment

Choose a reason for hiding this comment

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

LGTM!!!

数か所コメントしているのですが、ロジック的には問題ないと思うのでこちらで勝手に変えさせていただいてマージしたいと思います!!

@Hiroshiba Hiroshiba merged commit e0b2f6d into VOICEVOX:main Dec 27, 2024
10 checks passed
@Hiroshiba
Copy link
Member

こんな感じで28日の18時ごろに宣伝ポストさせていただこうと思います!
Xのアカウントをメンションさせていただいても大丈夫でしたっけ・・・?(ちなみにメンションを書いてる理由は、これを見た人が開発に興味を持ってくださる確率をちょっとでもあげたいなと思っているためです)
問題あればコメントいただけると!!

#VOICEVOX開発状況
ソングでもリップシンクなどに便利なlabファイルを出力できるようになりました🎉(今後のアップデートで実装されます。)
【開発者:@m_sig_tw】
https://github.com/VOICEVOX/voicevox/pull/2383

@sigprogramming
Copy link
Contributor Author

@Hiroshiba
メンション大丈夫です!

@sigprogramming sigprogramming deleted the add_feature_to_output_lab_file branch December 28, 2024 02:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants