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 };