From a1d08a1826fb710af63ae95eb1063288c36ae7a3 Mon Sep 17 00:00:00 2001 From: Tsubasa SEKIGUCHI Date: Thu, 13 Aug 2026 20:34:33 +0900 Subject: [PATCH 1/2] =?UTF-8?q?TTS=E3=81=AE=E6=97=A2=E5=AE=9A=E3=83=9C?= =?UTF-8?q?=E3=82=A4=E3=82=B9=E3=82=92=E6=97=A5=E8=8B=B1=E3=81=A7=E5=88=86?= =?UTF-8?q?=E3=81=91=E3=81=A6=E6=97=A9=E5=8F=A3=E5=AF=84=E3=82=8A=E3=81=AB?= =?UTF-8?q?=E8=AA=BF=E6=95=B4=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 日英とも nova だった既定ボイスを、日本語は shimmer、英語は coral に変更する。 どちらも多言語を読めるが、各言語で最も明瞭に聞こえるボイスを選んだ。 あわせて instructions を明るく張りのある調子へ書き換え、読み上げ速度を 通常より一段速い早口気味に指示する。gpt-4o-mini-tts は speed パラメータが 効かないため、速度指定は instructions で行う必要がある。 日英で別ボイスになったことで実態と食い違ったコメントも更新する。 Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01Ns9SudVEY9UzSUiaHoDy5s --- README.md | 4 ++-- src/types.ts | 2 +- src/utils/ttsVoice.ts | 4 ++-- wrangler.jsonc | 19 ++++++++++--------- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 7805d2a..26f1806 100644 --- a/README.md +++ b/README.md @@ -114,8 +114,8 @@ the client sends plain text and steers delivery with `instructions`. "textJa": "次は、オオサキです", "textEn": "The next station is Osaki, J-Y 24.", "model": "gpt-4o-mini-tts", - "jaVoiceName": "nova", - "enVoiceName": "nova", + "jaVoiceName": "shimmer", + "enVoiceName": "coral", "instructionsJa": "…", "instructionsEn": "…" } diff --git a/src/types.ts b/src/types.ts index d46d3dd..28388b6 100644 --- a/src/types.ts +++ b/src/types.ts @@ -19,7 +19,7 @@ export interface Env { AI_TRIAGE_MODEL: string; /** 合成に使う OpenAI TTS モデル(例: gpt-4o-mini-tts) */ TTS_MODEL: string; - /** OpenAI TTS のボイス名(例: nova)。ボイスは多言語対応のため日英で同じ名前を使える */ + /** OpenAI TTS のボイス名(例: shimmer)。ボイスは多言語対応だが日英で別のボイスを指定できる */ TTS_JA_VOICE_NAME: string; TTS_EN_VOICE_NAME: string; /** 読み方の指示(gpt-4o-mini-tts の instructions)の既定値 */ diff --git a/src/utils/ttsVoice.ts b/src/utils/ttsVoice.ts index a37cd09..52d8e7f 100644 --- a/src/utils/ttsVoice.ts +++ b/src/utils/ttsVoice.ts @@ -1,7 +1,7 @@ /** * OpenAI TTS のボイス名を扱うユーティリティ。 * - * gpt-4o-mini-tts のボイスは固定の名前付きプリセット(`nova` など)で、Azure の + * gpt-4o-mini-tts のボイスは固定の名前付きプリセット(`shimmer` など)で、Azure の * ような `-Neural` 形式ではない。ボイスは多言語対応のため日英で * 同じ名前を使える。クライアントから任意文字列が渡るため、未知の名前は * そのまま OpenAI へ流さず既定値へ倒す(400 で放送を落とさないため)。 @@ -27,7 +27,7 @@ export const isOpenAiVoiceName = (voiceName: string): boolean => // 環境変数の設定ミス(Azure 時代の値の残留など)でも合成を落とさないための // 最終フォールバック。ここは検証済みの定数なので必ず OpenAI が受理する。 -export const DEFAULT_TTS_VOICE = 'nova'; +export const DEFAULT_TTS_VOICE = 'shimmer'; export const DEFAULT_TTS_MODEL = 'gpt-4o-mini-tts'; /** diff --git a/wrangler.jsonc b/wrangler.jsonc index f0c7c90..12c5097 100644 --- a/wrangler.jsonc +++ b/wrangler.jsonc @@ -43,12 +43,13 @@ "AI_TRIAGE_MODEL": "@cf/meta/llama-3.1-8b-instruct-fast", // --- TTS(/tts)--- // gpt-4o-mini-tts は SSML 非対応。声色・速度・間の取り方は instructions で指示する。 - // ボイスは多言語対応のため、日英とも同じ女性声にして一人のアナウンサーに揃える。 + // 日英とも明るくはっきりした女性声にする。同じボイスでも多言語を読めるが、 + // 各言語で最も明瞭に聞こえるボイスを選ぶため日英で別のボイスを割り当てている。 "TTS_MODEL": "gpt-4o-mini-tts", - "TTS_JA_VOICE_NAME": "nova", - "TTS_EN_VOICE_NAME": "nova", - "TTS_INSTRUCTIONS_JA": "鉄道の車内自動放送のアナウンサーとして、落ち着いた丁寧な女性の声で読み上げてください。一定の速さを保ち、句読点では短く間を取ります。駅名や路線名は一語ずつ明瞭に発音し、感情を込めすぎず、事務的で聞き取りやすい調子にしてください。", - "TTS_INSTRUCTIONS_EN": "Read this as an automated train announcement in a calm, polite female voice. Keep a steady pace, pause briefly at commas, and pronounce station and line names clearly. Stay neutral and business-like rather than expressive.", + "TTS_JA_VOICE_NAME": "shimmer", + "TTS_EN_VOICE_NAME": "coral", + "TTS_INSTRUCTIONS_JA": "鉄道の車内自動放送のアナウンサーとして、明るくはっきりとした女性の声で読み上げてください。トーンはやや高めに保ち、語尾まで明瞭に発音します。テンポは速め――通常の朗読より一段速い早口気味の速さで、間延びさせずに読み進めてください。句読点での間は最小限にとどめます。速くても駅名や路線名は一語ずつくっきりと発音し、案内らしい張りのある調子にしてください。", + "TTS_INSTRUCTIONS_EN": "Read this as an automated train announcement in a bright, clear female voice. Keep the pitch slightly high and the delivery crisp and articulate. Speak quickly — noticeably faster than normal narration — and keep the momentum up without dragging. Keep pauses at commas minimal. Even at that speed, pronounce station and line names distinctly, and sound professional and welcoming rather than flat.", "SESSION_TOKEN_TTL_SECONDS": "3600", "UPLOAD_PUBLIC_BASE_URL": "https://uploads-dev.trainlcd.app", "FEW_SHOT_KV_KEY": "config:fewshot", @@ -102,10 +103,10 @@ "AI_TRIAGE_MODEL": "@cf/meta/llama-3.1-8b-instruct-fast", // --- TTS(/tts)--- "TTS_MODEL": "gpt-4o-mini-tts", - "TTS_JA_VOICE_NAME": "nova", - "TTS_EN_VOICE_NAME": "nova", - "TTS_INSTRUCTIONS_JA": "鉄道の車内自動放送のアナウンサーとして、落ち着いた丁寧な女性の声で読み上げてください。一定の速さを保ち、句読点では短く間を取ります。駅名や路線名は一語ずつ明瞭に発音し、感情を込めすぎず、事務的で聞き取りやすい調子にしてください。", - "TTS_INSTRUCTIONS_EN": "Read this as an automated train announcement in a calm, polite female voice. Keep a steady pace, pause briefly at commas, and pronounce station and line names clearly. Stay neutral and business-like rather than expressive.", + "TTS_JA_VOICE_NAME": "shimmer", + "TTS_EN_VOICE_NAME": "coral", + "TTS_INSTRUCTIONS_JA": "鉄道の車内自動放送のアナウンサーとして、明るくはっきりとした女性の声で読み上げてください。トーンはやや高めに保ち、語尾まで明瞭に発音します。やや速めの一定の速さで、句読点では短く間を取ります。駅名や路線名は一語ずつくっきりと発音し、案内らしい張りのある調子にしてください。", + "TTS_INSTRUCTIONS_EN": "Read this as an automated train announcement in a bright, clear female voice. Keep the pitch slightly high and the delivery crisp and articulate, at a steady, slightly brisk pace. Pause briefly at commas and pronounce station and line names distinctly. Sound professional and welcoming rather than flat.", "SESSION_TOKEN_TTL_SECONDS": "3600", "UPLOAD_PUBLIC_BASE_URL": "https://uploads.trainlcd.app", "FEW_SHOT_KV_KEY": "config:fewshot", From dab283e93e58f867a4a60b8a18b37f3ea10fed72 Mon Sep 17 00:00:00 2001 From: Tsubasa SEKIGUCHI Date: Thu, 13 Aug 2026 20:38:06 +0900 Subject: [PATCH 2/2] =?UTF-8?q?=E8=AA=AD=E3=81=BF=E4=B8=8A=E3=81=92?= =?UTF-8?q?=E9=80=9F=E5=BA=A6=E3=81=AE=E6=8C=87=E7=A4=BA=E3=82=92=E3=81=95?= =?UTF-8?q?=E3=82=89=E3=81=AB=E6=80=A5=E3=81=8E=E7=9B=AE=E3=81=B8=E5=BC=B7?= =?UTF-8?q?=E3=82=81=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 「一段速い早口気味」では十分に速くならなかったため、ラッシュ時の自動放送を 引き合いに出して速さを指示し、句読点・文の切れ目での間と語尾の伸ばしを 明示的に抑える。 Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01Ns9SudVEY9UzSUiaHoDy5s --- wrangler.jsonc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wrangler.jsonc b/wrangler.jsonc index 12c5097..8b45a13 100644 --- a/wrangler.jsonc +++ b/wrangler.jsonc @@ -48,8 +48,8 @@ "TTS_MODEL": "gpt-4o-mini-tts", "TTS_JA_VOICE_NAME": "shimmer", "TTS_EN_VOICE_NAME": "coral", - "TTS_INSTRUCTIONS_JA": "鉄道の車内自動放送のアナウンサーとして、明るくはっきりとした女性の声で読み上げてください。トーンはやや高めに保ち、語尾まで明瞭に発音します。テンポは速め――通常の朗読より一段速い早口気味の速さで、間延びさせずに読み進めてください。句読点での間は最小限にとどめます。速くても駅名や路線名は一語ずつくっきりと発音し、案内らしい張りのある調子にしてください。", - "TTS_INSTRUCTIONS_EN": "Read this as an automated train announcement in a bright, clear female voice. Keep the pitch slightly high and the delivery crisp and articulate. Speak quickly — noticeably faster than normal narration — and keep the momentum up without dragging. Keep pauses at commas minimal. Even at that speed, pronounce station and line names distinctly, and sound professional and welcoming rather than flat.", + "TTS_INSTRUCTIONS_JA": "鉄道の車内自動放送のアナウンサーとして、明るくはっきりとした女性の声で読み上げてください。トーンはやや高めに保ち、語尾まで明瞭に発音します。テンポはかなり速く、ラッシュ時の自動放送のように急いで一気に読み進めてください。句読点でも文の切れ目でもほとんど間を取らず、詰めて続けます。語尾や伸ばす音を長く引かないでください。速くても駅名や路線名は一語ずつくっきりと発音し、案内らしい張りのある調子にしてください。", + "TTS_INSTRUCTIONS_EN": "Read this as an automated train announcement in a bright, clear female voice. Keep the pitch slightly high and the delivery crisp and articulate. Speak fast — much quicker than normal narration, with the urgency of a rush-hour announcement — and push straight through without dragging. Take almost no pause at commas or sentence breaks, and do not draw out word endings. Even at that speed, pronounce station and line names distinctly, and sound professional and welcoming rather than flat.", "SESSION_TOKEN_TTL_SECONDS": "3600", "UPLOAD_PUBLIC_BASE_URL": "https://uploads-dev.trainlcd.app", "FEW_SHOT_KV_KEY": "config:fewshot",