From fabfaf9e4b29bb4204652457553c84beb1cd017d Mon Sep 17 00:00:00 2001 From: tsukumi Date: Wed, 1 Jan 2025 05:10:27 +0900 Subject: [PATCH] =?UTF-8?q?Update:=20=E9=9F=B3=E5=A3=B0=E5=90=88=E6=88=90?= =?UTF-8?q?=E5=BE=8C=E3=81=AE=E3=83=86=E3=83=AC=E3=83=A1=E3=83=88=E3=83=AA?= =?UTF-8?q?=E5=8F=8E=E9=9B=86=E3=82=92=E5=AE=9F=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Talk/ToolBar.vue | 2 +- src/composables/useDialogAnalytics.ts | 4 ++-- src/store/audioGenerate.ts | 17 +++++++++++++++++ 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/components/Talk/ToolBar.vue b/src/components/Talk/ToolBar.vue index 227ec1c3..886ee3f8 100644 --- a/src/components/Talk/ToolBar.vue +++ b/src/components/Talk/ToolBar.vue @@ -110,7 +110,7 @@ registerHotkeyWithCleanup({ const trackToolbarAction = (actionName: string) => { void useAnalytics().trackEvent("aisp_toolbar_button_click", { - action_name: actionName, + action: actionName, }); }; diff --git a/src/composables/useDialogAnalytics.ts b/src/composables/useDialogAnalytics.ts index 744df4a8..630087fa 100644 --- a/src/composables/useDialogAnalytics.ts +++ b/src/composables/useDialogAnalytics.ts @@ -14,8 +14,8 @@ export function useDialogAnalytics( () => isOpen.value, (newValue) => { void analytics.trackEvent("aisp_dialog_state_change", { - dialog_name: dialogName, - dialog_state: newValue ? "opened" : "closed", + dialog: dialogName, + state: newValue ? "opened" : "closed", }); }, ); diff --git a/src/store/audioGenerate.ts b/src/store/audioGenerate.ts index c3b7615f..1cb5d26d 100644 --- a/src/store/audioGenerate.ts +++ b/src/store/audioGenerate.ts @@ -8,6 +8,7 @@ import { } from "./type"; import { convertAudioQueryFromEditorToEngine } from "./proxy"; import { generateTempUniqueId } from "./utility"; +import { useAnalytics } from "@/composables/useAnalytics"; const audioBlobCache: Record = {}; @@ -56,12 +57,28 @@ export async function fetchAudioFromAudioItem( morphRate: audioItem.morphingInfo.rate, }); } else { + const startTime = performance.now() / 1000; // ミリ秒から秒に変換 blob = await instance.invoke("synthesisSynthesisPost")({ audioQuery: engineAudioQuery, speaker, enableInterrogativeUpspeak: state.experimentalSetting.enableInterrogativeUpspeak, }); + const synthesisTime = (performance.now() / 1000) - startTime; + void useAnalytics().trackEvent("aisp_synthesis", { + // プライバシーの観点から、テキスト内容は送信しない + engineId: audioItem.voice.engineId, + speakerId: audioItem.voice.speakerId, + styleId: audioItem.voice.styleId, + speedScale: audioQuery.speedScale, + intonationScale: audioQuery.intonationScale, + tempoDynamicsScale: audioQuery.tempoDynamicsScale, + pitchScale: audioQuery.pitchScale, + volumeScale: audioQuery.volumeScale, + prePhonemeLength: audioQuery.prePhonemeLength, + postPhonemeLength: audioQuery.postPhonemeLength, + synthesisTime: synthesisTime, + }); } audioBlobCache[id] = blob; return { audioQuery, blob };