Skip to content

BGM・効果音計画 / BGM & Sound Effects Plan

本ドキュメントでは、24時間配信のAI同棲生活シミュレーション「AI Prize Cohabitation Life」における BGM・効果音 (SE) の設計を定義する。24時間ループで視聴者が疲れない音響設計、投げ銭ティアに応じた演出音、著作権安全なライセンス運用、Web Audio API による技術実装を含む。

This document defines the BGM and sound effects (SE) design for the 24/7 AI cohabitation life simulation "AI Prize Cohabitation Life." Covers 24-hour loop audio design that avoids listener fatigue, tip-tier-based sound effects, copyright-safe licensing, and Web Audio API technical implementation.


1. オーディオ設計方針 / Audio Design Philosophy

1.1 基本方針 / Core Principles

#方針 / Principle説明 / Description
P124時間耐性 / 24-Hour Endurance長時間聴いても疲れないアンビエント寄りの楽曲。音量控えめ、テンポ穏やか / Ambient-leaning tracks that don't cause fatigue. Low volume, gentle tempo
P2ピクセルアート親和性 / Pixel Art Affinityチップチューン要素を取り入れたレトロ風サウンド。8bit/16bit 風の音色を基調とする / Retro-style sound with chiptune elements. Based on 8bit/16bit tone colors
P3生活感の演出 / Daily Life Atmosphere日常の音(時計、キッチン、犬の鳴き声)でリアリティとかわいさを両立 / Balance realism and cuteness with daily sounds (clock, kitchen, dog barking)
P4投げ銭演出の差別化 / Tip Effect Differentiationティアごとに明確に異なるサウンド演出で視聴者の貢献を視覚+聴覚で強調 / Clearly different sound effects per tier emphasizing viewer contributions through both visual and audio
P5著作権安全 / Copyright SafetyYouTube/TikTok の Content ID に引っかからない素材のみ使用 / Use only materials that won't trigger YouTube/TikTok Content ID
P6バイリンガル対応 / Bilingual Support音声通知やジングルはインストゥルメンタルのみ。言語依存なし / Audio notifications and jingles are instrumental only. No language dependency

1.2 音量バランス / Volume Balance

全オーディオの出力レベル基準。OBS 出力時に適切なミックスになるよう設定する。

Output level standards for all audio. Configured for proper mix at OBS output.

レイヤー / Layer音量 / Volume備考 / Notes
BGM0.15 - 0.25背景音楽。常に最も控えめ / Background music. Always the quietest
環境音 / Ambient SE0.10 - 0.20時計の音、窓の外の音など / Clock ticking, outside window sounds, etc.
アクション SE / Action SE0.30 - 0.50料理、掃除、食事などのアクション音 / Cooking, cleaning, eating action sounds
キャラクター SE / Character SE0.35 - 0.55足音、吹き出し、Eve の鳴き声 / Footsteps, speech bubble, Eve barking
投げ銭 SE / Tip SE0.50 - 0.80ティアに応じて音量が上がる / Volume increases with tier
通知 SE / Notification SE0.40 - 0.60コメント応答、マイルストーン / Comment response, milestones

2. 時間帯別 BGM / Time-Based BGM

2.1 24時間 BGM スケジュール / 24-Hour BGM Schedule

ゲーム内時刻に連動して BGM が自動切り替わる。各時間帯は screen-layout.md の時間帯オーバーレイと同期する。

BGM automatically changes based on in-game time. Each period syncs with the time-of-day overlays defined in screen-layout.md.

#時間帯 / Periodゲーム内時刻 / In-Game TimeBGM ID曲調 / MoodBPM長さ / Length
B1早朝 / Early Morning5:00 - 7:59bgm_morning穏やかなアコースティック風チップチューン。鳥のさえずりを混ぜた目覚めの音 / Gentle acoustic chiptune. Bird chirps mixed in for a waking-up feel80-903:00
B2日中 / Daytime8:00 - 16:59bgm_daytime明るく軽快なピクセルポップ。生活感のある爽やかさ / Bright, upbeat pixel pop. Fresh daily-life feel100-1104:00
B3夕方 / Evening17:00 - 19:59bgm_eveningノスタルジックなチップチューンワルツ。夕焼けの温かさ / Nostalgic chiptune waltz. Sunset warmth85-953:30
B4夜 / Night20:00 - 23:59bgm_nightローファイ風チップチューン。落ち着いたリラックスタイム / Lo-fi style chiptune. Calm relaxation time70-804:00
B5深夜・睡眠 / Late Night / Sleep0:00 - 4:59bgm_sleep極めて静かなアンビエント。微かなパッド音+環境音のみ / Ultra-quiet ambient. Faint pad sounds + environmental sounds only605:00

2.2 BGM 切替ルール / BGM Transition Rules

ルール / Rule説明 / Description
クロスフェード / Crossfade3秒かけて現在の BGM をフェードアウトし、次の BGM をフェードインする / 3-second crossfade between current and next BGM
ループ / Loop各 BGM はシームレスループ再生する。ループポイントをメタデータで指定 / Each BGM plays as a seamless loop. Loop points specified in metadata
バリエーション / Variation同じ時間帯でも2〜3曲のバリエーションをランダムで選択し、単調さを回避 / 2-3 variations per time period, randomly selected to avoid monotony
イベント割り込み / Event Interrupt投げ銭イベントBGM再生後、元の時間帯BGMに復帰する / After tip event BGM plays, return to the current time-period BGM
睡眠中の音量 / Sleep Volumeキャラ全員が睡眠中は BGM 音量を 0.10 まで下げる / When all characters are sleeping, reduce BGM volume to 0.10

2.3 24時間ループ設計の工夫 / 24-Hour Loop Design Techniques

24時間配信で BGM が耳障りにならないための設計。

Design to prevent BGM from becoming annoying during 24-hour streaming.

#手法 / Technique説明 / Description
T1マイクロバリエーション / Micro-Variationsループごとに微妙にアレンジを変える(楽器追加/削除、オクターブシフト)/ Subtle arrangement changes per loop (add/remove instruments, octave shifts)
T2生成的アンビエント / Generative Ambient深夜帯は固定楽曲ではなく、ランダムなパッド音+環境音の組み合わせで生成 / Late night uses random pad + ambient sound combinations instead of fixed tracks
T3サイレンスギャップ / Silence Gaps3〜5ループごとに10〜30秒の無音(環境音のみ)を挿入 / Insert 10-30 seconds of silence (ambient sounds only) every 3-5 loops
T4ダイナミックレイヤー / Dynamic Layersキャラクターの活動レベルに応じてBGMのレイヤー数を増減 / Increase/decrease BGM layer count based on character activity level
T5時間帯境界のグラデーション / Period Boundary Gradation切替の15分前から徐々にテンポ・キーを次の時間帯に近づける / Gradually shift tempo/key toward next period starting 15 minutes before transition

3. イベント BGM / Event BGM

3.1 投げ銭イベント BGM / Tip Event BGM

投げ銭受信時に一時的に再生される BGM/ジングル。ティア別に異なる。

BGM/jingles temporarily played when tips are received. Different per tier.

#イベント / EventBGM ID曲調 / Mood長さ / Duration再生ルール / Playback Rule
E1Small Tip (100-499 LC)bgm_tip_small短いコイン音ジングル(SE扱い、BGM変更なし)/ Short coin jingle (treated as SE, no BGM change)1.5s現在のBGMに重ねて再生 / Play overlaid on current BGM
E2Medium Tip (500-4,999 LC)bgm_tip_medium明るいファンファーレ風チップチューン / Bright fanfare-style chiptune4s現在のBGM音量を50%に下げて再生 / Play with current BGM at 50% volume
E3Large Tip (5,000+ LC)bgm_tip_large壮大なレトロRPGファンファーレ。勝利BGM風 / Grand retro RPG fanfare. Victory BGM style8s現在のBGMをフェードアウト→ファンファーレ→フェードバック / Fade out current BGM → fanfare → fade back

3.2 ストーリーイベント BGM / Story Event BGM

特定のゲームイベント中に再生される専用 BGM。

Dedicated BGM played during specific game events.

#イベント / EventBGM ID曲調 / Mood長さ / Duration
S1喧嘩 / Argumentbgm_argument緊迫感のあるチップチューン。不協和音を含むテンション / Tense chiptune with dissonant tension2:00 (loop)
S2仲直り / Makeupbgm_makeup温かいオルゴール風メロディ。ゆっくりとした回復感 / Warm music-box melody. Slow healing feel1:30
S3デート / Datebgm_date甘いボサノバ風チップチューン。おしゃれで楽しい / Sweet bossa-nova style chiptune. Stylish and fun3:00 (loop)
S4マイルストーン達成 / Milestone Reachedbgm_milestoneレベルアップ風ファンファーレ → 祝福BGM / Level-up fanfare → celebratory BGM6s + loop
S5散歩(外出)/ Walk (Outing)bgm_walk爽やかな冒険風チップチューン。フィールドBGM風 / Fresh adventure-style chiptune. Field BGM style3:00 (loop)

3.3 イベント BGM の優先順位 / Event BGM Priority

複数イベントが同時に発生した場合の優先ルール。

Priority rules when multiple events occur simultaneously.

Priority (高 → 低 / high → low):
  1. Large Tip BGM          (最高優先、他を全て中断)
  2. Milestone BGM           (Medium Tip より優先)
  3. Medium Tip BGM          (ストーリーBGMより優先)
  4. Story Event BGM         (通常BGMより優先)
  5. Time-Based BGM          (デフォルト)
  6. Sleep Ambient            (最低優先)

4. 効果音 (SE) 一覧 / Sound Effects List

4.1 投げ銭 SE / Tip Sound Effects

ティア別に視覚エフェクト (asset-spec.md) と同期して再生される SE。

SE played in sync with visual effects per tier (see asset-spec.md).

Tier 別サウンド / Sounds by Tier

TierLC 範囲 / LC RangeSE ID効果音の説明 / Sound Description再生タイミング / Timing
Micro1-99 LCse_tip_micro小さなコインドロップ音(チャリン)/ Small coin drop sound (clink)バナー表示時 / On banner display
Small100-499 LCse_tip_smallコイン積み上げ音 + 短いキラキラ / Coin stacking + short sparkleバナー表示時 / On banner display
Medium500-4,999 LCse_tip_medium_knockドアノック音(コンコン)/ Door knock (knock-knock)配達演出開始時 / On delivery start
se_tip_medium_open段ボール開封音(ベリベリ)/ Cardboard opening (rip)箱開封時 / On box opening
se_tip_medium_revealアイテム出現音(キラーン)/ Item reveal (sparkle shine)アイテム出現時 / On item appear
Large5,000-9,999 LCse_tip_large_flashフラッシュ音(ドーン)/ Flash sound (boom)スクリーンフラッシュ時 / On screen flash
se_tip_large_fanfareファンファーレ(パパパパーン)/ Fanfare (ta-da-da-daaa)バナー表示時 / On banner display
se_tip_large_sparkleレインボーパーティクル音(シャラララ)/ Rainbow particle (shimmering)パーティクル再生中 / During particles
Mega10,000+ LCse_tip_mega上記 Large + 追加の壮大なオーケストラヒット風チップチューン / Large sounds + additional grand orchestra-hit chiptuneフルシーケンス / Full sequence

投げ銭 SE 再生フロー / Tip SE Playback Flow

Small Tip (100-499 LC):
  0.0s: se_tip_small (コイン音 / coin sound)
  0.3s: (アイテムドロップ中は無音 / silent during item drop)
  0.5s: se_tip_small_land (着地キラキラ / landing sparkle)

Medium Tip (500-4,999 LC):
  0.0s: se_tip_medium_knock  (ノック / knock)
  1.0s: se_tip_medium_open   (開封 / unbox)
  2.0s: se_tip_medium_reveal (アイテム出現 / item reveal)
  2.5s: (金キラキラSEループ / gold sparkle SE loop)

Large Tip (5,000+ LC):
  0.0s: se_tip_large_flash   (フラッシュ / flash)
  0.5s: se_tip_large_fanfare (ファンファーレ / fanfare)
  2.0s: se_tip_large_sparkle (シャラララ / shimmer, loops 3s)
  5.0s: (BGM復帰 / BGM returns)

4.2 アクション SE / Action Sound Effects

キャラクターの10アクションカテゴリに対応する SE。

SE corresponding to the 10 action categories of characters.

#アクション / ActionSE ID効果音の説明 / Sound Descriptionループ / Loop
A1料理 / Cookse_cook_chop包丁で切る音(トントントン)/ Chopping sound (chop-chop-chop)Yes (アクション中 / during action)
se_cook_sizzleフライパンで炒める音(ジュージュー)/ Frying pan sizzleYes
se_cook_boil鍋の沸騰音(グツグツ)/ Pot boilingYes
A2掃除 / Cleanse_clean_sweep箒で掃く音(サッサッ)/ Sweeping with broom (swish-swish)Yes
se_clean_wipe雑巾で拭く音(キュッキュッ)/ Wiping with cloth (squeak-squeak)Yes
A3食事 / Eatse_eat_chopsticks箸で食べる音(パクパク、カチャカチャ)/ Eating with chopsticks (munch, clatter)Yes
se_eat_drink飲む音(ゴクゴク)/ Drinking sound (gulp-gulp)No
A4散歩 / Walkse_footstep_woodフローリングの足音(コツコツ)/ Footsteps on wood (tap-tap)Yes (移動中 / while moving)
se_footstep_outside外の足音(ザッザッ)/ Outdoor footsteps (crunch-crunch)Yes
A5睡眠 / Sleepse_sleep_breathe静かな寝息(スースー)/ Quiet breathing (soft snoring)Yes (極低音量 / very low volume)
A6仕事 / Workse_work_keyboardキーボードタイピング音(カタカタ)/ Keyboard typing (clatter-clatter)Yes
A7休憩 / Restse_rest_sighくつろぎのため息(ふぅー)/ Relaxation sigh (phew)No (開始時1回 / once at start)
A8会話 / Talkse_talk_bubble吹き出し出現音(ポワン)/ Speech bubble pop-in (boing)No (吹き出しごと / per bubble)
A9Eve と遊ぶ / Play with Evese_play_throwおもちゃを投げる音(ヒュッ)/ Throwing toy (whoosh)No
se_play_catchおもちゃをキャッチする音(パフッ)/ Catching toy (poof)No
A10アイドル / IdleSE なし(BGM + 環境音のみ)/ No SE (BGM + ambient only)

4.3 キャラクター SE / Character Sound Effects

Eve(柴犬)SE / Eve (Shiba Inu) SE

#SE ID効果音の説明 / Sound Descriptionトリガー / Trigger
1se_eve_bark元気な吠え(ワンッ!)/ Energetic bark (Woof!)嬉しい時、来客時 / When happy, when visitors arrive
2se_eve_bark_double二連吠え(ワンワン!)/ Double bark (Woof-woof!)投げ銭受信時のリアクション / Tip received reaction
3se_eve_whine甘え鳴き(クゥーン)/ Whimpering (whiine)お腹が空いた時、寂しい時 / When hungry, when lonely
4se_eve_pantハアハア(パンティング)/ Panting散歩帰り、遊んだ後 / After walk, after play
5se_eve_yawnあくび(ふぁーあ)/ Yawn (yaaawn)眠い時 / When sleepy
6se_eve_eatガツガツ食べる音 / Eager eating sounds食事中 / During eating
7se_eve_tail_wagしっぽ振り(パタパタ)/ Tail wagging (pat-pat)嬉しいリアクション / Happy reaction
8se_eve_sniffクンクンと嗅ぐ音 / Sniffing sounds新しいアイテム到着時 / When new item arrives

吹き出し SE / Speech Bubble SE

#SE ID効果音の説明 / Sound Descriptionトリガー / Trigger
1se_bubble_appear吹き出し出現(ポワン)/ Bubble appear (boing)通常会話の吹き出し / Normal dialogue bubble
2se_bubble_appear_tip投げ銭リアクション吹き出し(キラッ + ポワン)/ Tip reaction bubble (sparkle + boing)投げ銭お礼の吹き出し / Tip thank-you bubble
3se_bubble_appear_commentコメント返信吹き出し(ピコッ + ポワン)/ Comment reply bubble (ping + boing)コメント返信の吹き出し / Comment reply bubble
4se_bubble_disappear吹き出し消滅(フッ)/ Bubble disappear (poof)全タイプ共通 / Common to all types

4.4 コメント応答 SE / Comment Response SE

#SE ID効果音の説明 / Sound Descriptionトリガー / Trigger
1se_comment_receiveコメント受信音(ピコン)/ Comment received (ping)10分サイクルでコメント処理開始時 / When 10-min cycle comment processing starts
2se_comment_readコメント読み上げ開始音(ポロン)/ Comment read-start (plonk)キャラがコメントに反応開始 / Character starts responding to comment

4.5 環境音 / Ambient Sound Effects

時間帯や状況に応じたバックグラウンド環境音。

Background ambient sounds based on time period and situation.

#SE ID効果音の説明 / Sound Description再生条件 / Conditionループ / Loop
1amb_clock_tick壁掛け時計のカチカチ音 / Wall clock ticking常時(音量極小)/ Always (very low volume)Yes
2amb_birds鳥のさえずり / Bird chirping早朝〜日中(5:00-16:00)/ Early morning to daytimeYes
3amb_cicadaセミの鳴き声(夏季)/ Cicada sounds (summer)夏の日中 / Summer daytimeYes
4amb_crickets虫の声(秋季)/ Cricket sounds (autumn)秋の夜 / Autumn nightYes
5amb_rain雨音 / Rain soundsランダム天候イベント / Random weather eventYes
6amb_wind窓の外の風音 / Wind outside window冬季・強風時 / Winter, strong windYes
7amb_night_quiet夜の静けさ(微かな虫の声)/ Night quiet (faint insects)深夜(0:00-4:59)/ Late nightYes

4.6 UI SE / UI Sound Effects

#SE ID効果音の説明 / Sound Descriptionトリガー / Trigger
1se_ui_day_change日付変更ジングル(チャイム風)/ Day change jingle (chime style)ゲーム内日付が変わる時 / When in-game date changes
2se_ui_status_warningステータス警告音(ピピッ)/ Status warning (beep-beep)HP/Hunger が 20 以下 / HP/Hunger below 20
3se_ui_milestoneマイルストーン達成音(レベルアップ音)/ Milestone achieved (level-up sound)LC 累計がマイルストーンに到達 / Cumulative LC reaches milestone
4se_ui_lc_countupLC カウントアップ音(チャリチャリ)/ LC count-up (ching-ching)投げ銭受信時の残高アニメーション / Balance animation on tip received

5. オーディオファイル仕様 / Audio File Specifications

5.1 ファイル形式 / File Format

種別 / Type形式 / Formatサンプルレート / Sample Rateビット深度 / Bit Depthチャンネル / Channels備考 / Notes
BGMOGG Vorbis (.ogg)44,100 Hz16-bitStereoブラウザ互換性最良 / Best browser compatibility
BGM (fallback)MP3 (.mp3)44,100 Hz16-bitStereoSafari 旧バージョン用 / For older Safari
SEOGG Vorbis (.ogg)22,050 Hz16-bitMonoファイルサイズ削減 / File size reduction
SE (fallback)MP3 (.mp3)22,050 Hz16-bitMonoSafari 旧バージョン用 / For older Safari
AmbientOGG Vorbis (.ogg)22,050 Hz16-bitStereo環境音はステレオ維持 / Keep ambient in stereo

5.2 ファイルサイズ目安 / File Size Guidelines

種別 / Type1ファイルの上限 / Max per File合計上限 / Total Max備考 / Notes
BGM(1曲)/ BGM (per track)500 KB3-5分ループ / 3-5 min loop
SE(1音)/ SE (per sound)50 KB0.1-3秒 / 0.1-3 seconds
Ambient(1種)/ Ambient (per type)200 KB10-30秒ループ / 10-30 sec loop
全オーディオ合計 / Total all audio10 MBプリロード時間3秒以内を維持 / Keep preload under 3 seconds

5.3 ファイル構成 / File Structure

packages/frontend/src/assets/
└── audio/
    ├── bgm/
    │   ├── morning_01.ogg         # 早朝BGM バリエーション1
    │   ├── morning_02.ogg         # 早朝BGM バリエーション2
    │   ├── daytime_01.ogg         # 日中BGM バリエーション1
    │   ├── daytime_02.ogg         # 日中BGM バリエーション2
    │   ├── daytime_03.ogg         # 日中BGM バリエーション3
    │   ├── evening_01.ogg         # 夕方BGM
    │   ├── evening_02.ogg         # 夕方BGM バリエーション2
    │   ├── night_01.ogg           # 夜BGM
    │   ├── night_02.ogg           # 夜BGM バリエーション2
    │   ├── sleep_01.ogg           # 深夜アンビエント
    │   ├── tip_medium.ogg         # Medium Tip ファンファーレ
    │   ├── tip_large.ogg          # Large Tip ファンファーレ
    │   ├── argument.ogg           # 喧嘩BGM
    │   ├── makeup.ogg             # 仲直りBGM
    │   ├── date.ogg               # デートBGM
    │   ├── milestone.ogg          # マイルストーンBGM
    │   └── walk_outside.ogg       # 外出BGM
    ├── se/
    │   ├── tip/
    │   │   ├── tip_micro.ogg      # Micro Tip (コインドロップ)
    │   │   ├── tip_small.ogg      # Small Tip (コイン積み上げ)
    │   │   ├── tip_small_land.ogg # Small Tip 着地音
    │   │   ├── tip_medium_knock.ogg   # ドアノック
    │   │   ├── tip_medium_open.ogg    # 箱開封
    │   │   ├── tip_medium_reveal.ogg  # アイテム出現
    │   │   ├── tip_large_flash.ogg    # フラッシュ
    │   │   ├── tip_large_fanfare.ogg  # ファンファーレ
    │   │   ├── tip_large_sparkle.ogg  # レインボーパーティクル
    │   │   └── tip_mega.ogg           # Mega Tip 追加SE
    │   ├── action/
    │   │   ├── cook_chop.ogg      # 包丁
    │   │   ├── cook_sizzle.ogg    # フライパン
    │   │   ├── cook_boil.ogg      # 沸騰
    │   │   ├── clean_sweep.ogg    # 箒
    │   │   ├── clean_wipe.ogg     # 雑巾
    │   │   ├── eat_chopsticks.ogg # 箸
    │   │   ├── eat_drink.ogg      # 飲む
    │   │   ├── footstep_wood.ogg  # 室内足音
    │   │   ├── footstep_outside.ogg # 外足音
    │   │   ├── sleep_breathe.ogg  # 寝息
    │   │   ├── work_keyboard.ogg  # タイピング
    │   │   ├── rest_sigh.ogg      # ため息
    │   │   ├── play_throw.ogg     # 投げる
    │   │   └── play_catch.ogg     # キャッチ
    │   ├── character/
    │   │   ├── eve_bark.ogg       # 吠え
    │   │   ├── eve_bark_double.ogg # 二連吠え
    │   │   ├── eve_whine.ogg      # 甘え鳴き
    │   │   ├── eve_pant.ogg       # パンティング
    │   │   ├── eve_yawn.ogg       # あくび
    │   │   ├── eve_eat.ogg        # ガツガツ食べる
    │   │   ├── eve_tail_wag.ogg   # しっぽ振り
    │   │   └── eve_sniff.ogg      # クンクン
    │   ├── bubble/
    │   │   ├── bubble_appear.ogg        # 通常吹き出し
    │   │   ├── bubble_appear_tip.ogg    # 投げ銭吹き出し
    │   │   ├── bubble_appear_comment.ogg # コメント返信吹き出し
    │   │   └── bubble_disappear.ogg     # 吹き出し消滅
    │   └── ui/
    │       ├── day_change.ogg     # 日付変更
    │       ├── status_warning.ogg # ステータス警告
    │       ├── milestone.ogg      # マイルストーン達成
    │       ├── lc_countup.ogg     # LCカウントアップ
    │       ├── comment_receive.ogg # コメント受信
    │       └── comment_read.ogg   # コメント読み上げ開始
    └── ambient/
        ├── clock_tick.ogg         # 時計
        ├── birds.ogg              # 鳥のさえずり
        ├── cicada.ogg             # セミ
        ├── crickets.ogg           # 虫の声
        ├── rain.ogg               # 雨
        ├── wind.ogg               # 風
        └── night_quiet.ogg        # 夜の静寂

6. 技術実装 / Technical Implementation

6.1 Web Audio API アーキテクチャ / Web Audio API Architecture

ブラウザの Web Audio API を使用してすべてのオーディオを管理する。OBS Browser Source でキャプチャされるため、ブラウザ内完結が必須。

All audio is managed using the browser's Web Audio API. Must be browser-contained since it's captured by OBS Browser Source.

┌──────────────────────────────────────────────────────────────────┐
│                     AudioContext                                  │
│                                                                    │
│  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐              │
│  │ BGM Channel  │  │  SE Channel  │  │ Ambient Ch.  │              │
│  │             │  │             │  │             │              │
│  │ GainNode    │  │ GainNode    │  │ GainNode    │              │
│  │ vol: 0.20   │  │ vol: 0.50   │  │ vol: 0.15   │              │
│  └──────┬──────┘  └──────┬──────┘  └──────┬──────┘              │
│         │                │                │                      │
│         ▼                ▼                ▼                      │
│  ┌──────────────────────────────────────────────────────────┐   │
│  │                   Master GainNode                         │   │
│  │                   vol: 0.80                               │   │
│  └──────────────────────────┬───────────────────────────────┘   │
│                              │                                    │
│                              ▼                                    │
│  ┌──────────────────────────────────────────────────────────┐   │
│  │                   DynamicsCompressorNode                   │   │
│  │                   (ピーク防止 / Peak prevention)            │   │
│  └──────────────────────────┬───────────────────────────────┘   │
│                              │                                    │
│                              ▼                                    │
│  ┌──────────────────────────────────────────────────────────┐   │
│  │                   AudioContext.destination                  │   │
│  │                   (→ OBS Browser Source captures)           │   │
│  └──────────────────────────────────────────────────────────┘   │
└──────────────────────────────────────────────────────────────────┘

6.2 AudioManager クラス設計 / AudioManager Class Design

typescript
interface AudioConfig {
  masterVolume: number       // 0.0 - 1.0
  bgmVolume: number          // 0.0 - 1.0
  seVolume: number           // 0.0 - 1.0
  ambientVolume: number      // 0.0 - 1.0
  crossfadeDuration: number  // seconds (default: 3)
  muteOnHidden: boolean      // ブラウザ非表示時ミュート / Mute when browser hidden
}

interface BGMTrack {
  id: string
  url: string
  loopStart: number   // ループ開始ポイント (秒) / Loop start point (seconds)
  loopEnd: number     // ループ終了ポイント (秒) / Loop end point (seconds)
  bpm: number
  period: 'morning' | 'daytime' | 'evening' | 'night' | 'sleep'
  variation: number   // 同じ時間帯のバリエーション番号 / Variation number for same period
}

interface SEDefinition {
  id: string
  url: string
  volume: number      // 個別音量調整 / Individual volume adjustment (0.0-1.0)
  maxInstances: number // 同時再生上限 / Max simultaneous instances
  cooldownMs: number  // 再生間隔の最小値 / Minimum interval between plays
}

class AudioManager {
  private ctx: AudioContext
  private masterGain: GainNode
  private bgmGain: GainNode
  private seGain: GainNode
  private ambientGain: GainNode
  private compressor: DynamicsCompressorNode

  private bgmBuffers: Map<string, AudioBuffer>
  private seBuffers: Map<string, AudioBuffer>
  private ambientBuffers: Map<string, AudioBuffer>

  private currentBGM: AudioBufferSourceNode | null
  private currentAmbients: Map<string, AudioBufferSourceNode>
  private activeSEInstances: Map<string, number>

  constructor(config: AudioConfig) { /* ... */ }

  // === BGM 制御 / BGM Control ===
  async playBGM(trackId: string, fadeIn?: number): Promise<void>
  async stopBGM(fadeOut?: number): Promise<void>
  async crossfadeBGM(nextTrackId: string, duration?: number): Promise<void>
  setBGMVolume(volume: number, fadeDuration?: number): void

  // === SE 制御 / SE Control ===
  playSE(seId: string): void
  stopSE(seId: string): void
  stopAllSE(): void

  // === Ambient 制御 / Ambient Control ===
  startAmbient(ambientId: string): void
  stopAmbient(ambientId: string, fadeOut?: number): void
  setAmbientMix(activeIds: string[]): void

  // === マスター制御 / Master Control ===
  setMasterVolume(volume: number): void
  mute(): void
  unmute(): void

  // === プリロード / Preload ===
  async preloadAll(): Promise<void>
  async preloadBGM(trackIds: string[]): Promise<void>
  async preloadSE(seIds: string[]): Promise<void>
}

6.3 プリロード戦略 / Preloading Strategy

24時間配信のため、全オーディオファイルを起動時にプリロードする。

For 24-hour streaming, preload all audio files at startup.

typescript
// プリロード優先順位 / Preload priority
const PRELOAD_PHASES = [
  // Phase 1: 即時必要 (最優先) / Immediately needed (highest priority)
  {
    phase: 1,
    assets: [
      'bgm_daytime',           // 起動時のデフォルトBGM / Default BGM at startup
      'se_tip_small',          // 最も頻繁に使用 / Most frequently used
      'se_tip_micro',
      'se_bubble_appear',
      'se_footstep_wood',
      'amb_clock_tick',
    ]
  },
  // Phase 2: 早期に必要 / Needed soon
  {
    phase: 2,
    assets: [
      'bgm_morning', 'bgm_evening', 'bgm_night', 'bgm_sleep',
      'se_tip_medium_knock', 'se_tip_medium_open', 'se_tip_medium_reveal',
      'se_eve_bark', 'se_eve_bark_double',
      'se_cook_chop', 'se_cook_sizzle',
      'se_eat_chopsticks',
      'amb_birds',
    ]
  },
  // Phase 3: 残り全て / Everything else
  {
    phase: 3,
    assets: [
      // 全バリエーション、イベントBGM、残りのSE
      // All variations, event BGM, remaining SE
      '...remaining assets...'
    ]
  }
]

async function preloadAudio(audioManager: AudioManager): Promise<void> {
  for (const phase of PRELOAD_PHASES) {
    await Promise.all(
      phase.assets.map(id => audioManager.loadAsset(id))
    )
    console.log(`Audio preload phase ${phase.phase} complete`)
  }
}

6.4 BGM クロスフェード実装 / BGM Crossfade Implementation

typescript
async function crossfadeBGM(
  ctx: AudioContext,
  bgmGain: GainNode,
  currentSource: AudioBufferSourceNode | null,
  nextBuffer: AudioBuffer,
  duration: number = 3
): Promise<AudioBufferSourceNode> {
  const now = ctx.currentTime

  // 現在のBGMをフェードアウト / Fade out current BGM
  if (currentSource) {
    bgmGain.gain.setValueAtTime(bgmGain.gain.value, now)
    bgmGain.gain.linearRampToValueAtTime(0, now + duration)

    // フェード完了後に停止 / Stop after fade complete
    setTimeout(() => {
      currentSource.stop()
    }, duration * 1000)
  }

  // 次のBGMをフェードイン / Fade in next BGM
  const nextSource = ctx.createBufferSource()
  nextSource.buffer = nextBuffer
  nextSource.loop = true

  const nextGain = ctx.createGain()
  nextGain.gain.setValueAtTime(0, now)
  nextGain.gain.linearRampToValueAtTime(1, now + duration)

  nextSource.connect(nextGain)
  nextGain.connect(bgmGain)
  nextSource.start()

  return nextSource
}

6.5 時間帯BGM自動切替 / Time-Based BGM Auto-Switch

typescript
interface TimePeriod {
  start: number  // 開始時刻 (時) / Start hour
  end: number    // 終了時刻 (時) / End hour
  bgmPool: string[] // BGM候補プール / BGM candidate pool
}

const TIME_PERIODS: TimePeriod[] = [
  { start: 5,  end: 8,  bgmPool: ['morning_01', 'morning_02'] },
  { start: 8,  end: 17, bgmPool: ['daytime_01', 'daytime_02', 'daytime_03'] },
  { start: 17, end: 20, bgmPool: ['evening_01', 'evening_02'] },
  { start: 20, end: 24, bgmPool: ['night_01', 'night_02'] },
  { start: 0,  end: 5,  bgmPool: ['sleep_01'] },
]

class BGMScheduler {
  private audioManager: AudioManager
  private currentPeriod: string | null = null
  private loopCount: number = 0
  private silenceInserted: boolean = false

  constructor(audioManager: AudioManager) {
    this.audioManager = audioManager
  }

  /**
   * ゲーム内時刻に応じてBGMを更新する
   * Update BGM based on in-game time
   */
  update(gameHour: number): void {
    const period = this.getPeriod(gameHour)
    if (!period) return

    const periodKey = `${period.start}-${period.end}`

    if (periodKey !== this.currentPeriod) {
      // 時間帯が変わった → クロスフェード
      // Period changed → crossfade
      this.currentPeriod = periodKey
      this.loopCount = 0
      this.silenceInserted = false

      const track = this.selectVariation(period.bgmPool)
      this.audioManager.crossfadeBGM(track, 3)
    }
  }

  /**
   * BGMループ完了時のハンドラ
   * Handler for BGM loop completion
   */
  onLoopComplete(): void {
    this.loopCount++

    // 3-5ループごとにサイレンスギャップを挿入
    // Insert silence gap every 3-5 loops
    if (this.loopCount % (3 + Math.floor(Math.random() * 3)) === 0) {
      this.insertSilenceGap()
    }

    // 次のバリエーションに切り替え
    // Switch to next variation
    if (this.loopCount % 2 === 0 && this.currentPeriod) {
      const period = TIME_PERIODS.find(p =>
        `${p.start}-${p.end}` === this.currentPeriod
      )
      if (period && period.bgmPool.length > 1) {
        const nextTrack = this.selectVariation(period.bgmPool)
        this.audioManager.crossfadeBGM(nextTrack, 5)
      }
    }
  }

  private insertSilenceGap(): void {
    const gapDuration = 10 + Math.random() * 20 // 10-30秒
    this.audioManager.setBGMVolume(0, 2)
    setTimeout(() => {
      this.audioManager.setBGMVolume(1, 2)
    }, gapDuration * 1000)
  }

  private selectVariation(pool: string[]): string {
    return pool[Math.floor(Math.random() * pool.length)]
  }

  private getPeriod(hour: number): TimePeriod | undefined {
    return TIME_PERIODS.find(p => {
      if (p.start < p.end) {
        return hour >= p.start && hour < p.end
      }
      // 日付をまたぐケース (例: 20-24)
      return hour >= p.start || hour < p.end
    })
  }
}

6.6 SE 同時再生制御 / SE Concurrent Playback Control

同じ SE が短時間に大量にトリガーされた場合のポリフォニー制御。

Polyphony control when the same SE is triggered many times in a short period.

typescript
const SE_DEFINITIONS: Record<string, SEDefinition> = {
  se_footstep_wood: {
    id: 'se_footstep_wood',
    url: 'audio/se/action/footstep_wood.ogg',
    volume: 0.35,
    maxInstances: 2,    // 同時に2つまで / Max 2 simultaneous
    cooldownMs: 250,    // 250ms間隔 / 250ms interval
  },
  se_tip_small: {
    id: 'se_tip_small',
    url: 'audio/se/tip/tip_small.ogg',
    volume: 0.60,
    maxInstances: 1,    // 同時に1つ / Max 1 simultaneous
    cooldownMs: 1000,   // 1秒間隔(連打防止)/ 1s interval (spam prevention)
  },
  se_eve_bark: {
    id: 'se_eve_bark',
    url: 'audio/se/character/eve_bark.ogg',
    volume: 0.45,
    maxInstances: 1,
    cooldownMs: 2000,   // 2秒間隔 / 2s interval
  },
  se_bubble_appear: {
    id: 'se_bubble_appear',
    url: 'audio/se/bubble/bubble_appear.ogg',
    volume: 0.40,
    maxInstances: 3,    // 3キャラ同時発言対応 / Support 3 chars speaking simultaneously
    cooldownMs: 300,
  },
  // ... 他のSE定義 / other SE definitions
}

6.7 音量のダイナミック制御 / Dynamic Volume Control

ゲーム状態に応じてリアルタイムに音量を調整する。

Adjust volume in real-time based on game state.

typescript
interface VolumeState {
  allSleeping: boolean       // 全キャラ睡眠中 / All characters sleeping
  tipEventActive: boolean    // 投げ銭イベント中 / Tip event active
  tipTier: 'none' | 'small' | 'medium' | 'large'
  argumentActive: boolean    // 喧嘩イベント中 / Argument event active
  outdoors: boolean          // 外出中 / Currently outdoors
}

function calculateVolumes(state: VolumeState): AudioConfig {
  let bgm = 0.20
  let se = 0.50
  let ambient = 0.15

  // 全キャラ睡眠中 → BGM・SE大幅減 / All sleeping → reduce BGM & SE significantly
  if (state.allSleeping) {
    bgm = 0.10
    se = 0.20
    ambient = 0.10
  }

  // 投げ銭イベント中 → ティアに応じてBGM減、SE増
  // Tip event active → reduce BGM by tier, increase SE
  if (state.tipEventActive) {
    switch (state.tipTier) {
      case 'small':
        bgm *= 0.8
        break
      case 'medium':
        bgm *= 0.5
        break
      case 'large':
        bgm = 0  // BGM完全停止 / BGM fully stopped
        se = 0.80
        break
    }
  }

  // 喧嘩イベント → 環境音を下げ、BGMを上げる
  // Argument event → reduce ambient, increase BGM
  if (state.argumentActive) {
    bgm = 0.30
    ambient = 0.05
  }

  return {
    masterVolume: 0.80,
    bgmVolume: bgm,
    seVolume: se,
    ambientVolume: ambient,
    crossfadeDuration: 3,
    muteOnHidden: false, // 配信中は非表示でもミュートしない / Don't mute during stream even if hidden
  }
}

6.8 AudioContext の自動再開 / AudioContext Auto-Resume

ブラウザの自動再生ポリシーへの対応。OBS Browser Source は自動再生を許可するが、デバッグ時のブラウザ直接アクセス用にフォールバックを用意する。

Handling browser autoplay policy. OBS Browser Source allows autoplay, but provide a fallback for direct browser access during debugging.

typescript
class AudioContextManager {
  private ctx: AudioContext | null = null

  async getContext(): Promise<AudioContext> {
    if (!this.ctx) {
      this.ctx = new AudioContext()
    }

    // suspended 状態の場合は resume を試行
    // Attempt resume if in suspended state
    if (this.ctx.state === 'suspended') {
      try {
        await this.ctx.resume()
      } catch (e) {
        console.warn('AudioContext resume failed, waiting for user interaction')
        // ユーザーインタラクション待ち(デバッグ用)
        // Wait for user interaction (for debugging)
        document.addEventListener('click', async () => {
          await this.ctx?.resume()
        }, { once: true })
      }
    }

    return this.ctx
  }

  /**
   * OBS Browser Source 環境かどうかを判定
   * Detect if running in OBS Browser Source environment
   */
  isOBSBrowserSource(): boolean {
    return navigator.userAgent.includes('OBS')
      || window.obsstudio !== undefined
  }
}

7.1 ライセンス方針 / Licensing Policy

YouTube と TikTok の両プラットフォームで 24 時間配信するため、著作権管理が特に重要。Content ID に検出されない素材のみ使用する。

Copyright management is critical for 24-hour streaming on both YouTube and TikTok. Only use materials that won't be detected by Content ID.

優先度 / Priorityソース / Sourceメリット / Prosデメリット / Cons推奨 / Recommended
1AI 生成 / AI-Generated著作権問題なし、カスタム可、大量生成可 / No copyright issues, customizable, mass-producible品質にばらつき / Quality variesMVP 推奨 / MVP Recommended
2自作 / Self-Made完全に安全、独自性 / Completely safe, unique制作コスト高 / High production costPhase 2 で検討 / Consider in Phase 2
3CC0 / パブリックドメイン / Public Domain無料、帰属表示不要 / Free, no attribution required数が限られる / Limited selection環境音に活用 / Use for ambient
4CC-BY ライセンス無料、帰属表示で利用可 / Free with attribution帰属表示の管理が必要 / Must manage attributionSE に活用 / Use for SE
5商用フリー素材 / Royalty-Free高品質、豊富 / High quality, abundant有料の場合あり / May cost money必要に応じて / As needed

使用禁止素材 / Prohibited Materials

以下の素材は絶対に使用しない:

  • JASRAC/NexTone 管理楽曲(カバーを含む)
  • YouTube Audio Library の一部(商用利用制限ありのもの)
  • 帰属表示なしで CC-BY 素材を使用すること
  • AI 生成でも既存楽曲を模倣させたもの

Never use the following:

  • JASRAC/NexTone managed music (including covers)
  • Some YouTube Audio Library tracks (those with commercial restrictions)
  • CC-BY materials without proper attribution
  • AI-generated music that imitates existing copyrighted works

7.2 AI 音楽生成ツール / AI Music Generation Tools

ツール / Tool用途 / Usageライセンス / License備考 / Notes
Suno AIBGM 生成 / BGM generation有料プランで商用利用可 / Commercial use with paid planチップチューン生成に優秀 / Excellent for chiptune generation
UdioBGM 生成 / BGM generation有料プランで商用利用可 / Commercial use with paid plan高品質な楽曲 / High quality tracks
Stable AudioBGM・SE 生成 / BGM & SE generationオープンソース / Open sourceローカル実行可 / Can run locally
sfxr / jsfxrチップチューン SE 生成 / Chiptune SE generation無料・パブリックドメイン / Free, public domainレトロゲーム SE に最適 / Ideal for retro game SE
ChipToneチップチューン SE 生成 / Chiptune SE generation無料 / Freeブラウザベース / Browser-based
ソース / SourceURLライセンス / License用途 / Usage
Freesound.orgfreesound.orgCC0 / CC-BY 混在 / Mixed環境音、SE / Ambient, SE
OpenGameArt.orgopengameart.orgCC0 / CC-BY 混在 / Mixedチップチューン BGM / Chiptune BGM
Incompetechincompetech.comCC-BY 4.0BGM(帰属表示で無料)/ BGM (free with attribution)
効果音ラボ / Sound Effect Labsoundeffect-lab.info無料・商用利用可 / Free, commercial OK日本の生活音 SE / Japanese daily life SE
魔王魂 / Maou Damashiimaou.audio無料・商用利用可 / Free, commercial OKチップチューン BGM / Chiptune BGM
DOVA-SYNDROMEdova-s.jp無料・商用利用可 / Free, commercial OKBGM / BGM

7.4 帰属表示管理 / Attribution Management

CC-BY 素材を使用する場合、帰属表示を一元管理するファイルを用意する。

When using CC-BY materials, maintain a centralized attribution file.

typescript
// packages/frontend/src/assets/audio/ATTRIBUTION.json
{
  "attributions": [
    {
      "file": "ambient/birds.ogg",
      "title": "Morning Bird Song",
      "author": "example_user",
      "source": "https://freesound.org/s/12345",
      "license": "CC-BY 4.0",
      "modifications": "Trimmed to 15 seconds, volume normalized"
    }
    // ... 全CC-BY素材のエントリ / entries for all CC-BY materials
  ]
}

配信画面の概要欄(YouTube / TikTok)に帰属表示リンクを記載する。

Include attribution links in the stream description (YouTube / TikTok).

7.5 MVP 具体的オーディオ素材調達計画 / Concrete MVP Audio Sourcing Plan

MVP で必要なオーディオ素材ごとに、使用するツールと具体的な手順を定義する。

Defines the specific tools and procedures for each audio asset needed in MVP.

7.5.1 BGM: Suno AI(有料プラン / Paid Plan)

時間帯別 BGM 5 種類を Suno AI で生成する。有料プラン(Pro / Premier)で生成した楽曲は商用利用可能。

Generate 5 time-period BGM tracks using Suno AI. Tracks generated on paid plans (Pro / Premier) are cleared for commercial use.

時間帯 / Time PeriodSuno プロンプト例 / Suno Prompt ExampleBPM 目安 / BPM Target長さ / Duration
早朝 / Early Morning (5:00-8:00)"gentle chiptune lo-fi, 8bit morning sunrise, soft arpeggios, ambient pads, peaceful, 70bpm, instrumental"65-752-3 min
日中 / Daytime (8:00-17:00)"cheerful 16bit chiptune, cozy daily life BGM, light pixel game soundtrack, upbeat but calm, 90bpm, instrumental"85-952-3 min
夕方 / Evening (17:00-20:00)"warm lo-fi chiptune, 8bit sunset vibes, nostalgic retro game music, mellow, 80bpm, instrumental"75-852-3 min
夜 / Night (20:00-0:00)"relaxing chiptune ambient, 16bit night time, soft synth pads, dreamy pixel art music, 65bpm, instrumental"60-702-3 min
深夜 / Late Night (0:00-5:00)"minimal ambient chiptune, 8bit lullaby, extremely soft, whisper quiet retro, sleep music, 55bpm, instrumental"50-603-4 min

プロンプトのコツ / Prompt Tips

  • 必ず instrumental を指定し、ボーカルを回避する / Always specify instrumental to avoid vocals
  • chiptunelo-fi を組み合わせると 24 時間耐性のある柔らかい音になる / Combining chiptune and lo-fi produces soft sounds suitable for 24h
  • 既存アーティスト名や楽曲名は絶対に指定しない / Never specify existing artist or song names
  • 各時間帯で 5 曲以上生成し、最良のものを選定する / Generate 5+ tracks per period and select the best

7.5.2 SE(効果音): jsfxr(無料・ブラウザベース / Free, Browser-Based)

レトロゲーム風 SE を jsfxr(https://sfxr.me/)で生成する。パブリックドメインのため著作権問題なし。

Generate retro game-style SE using jsfxr (https://sfxr.me/). Public domain, no copyright concerns.

カテゴリ / Category生成する SE / SE to Generatejsfxr プリセット / jsfxr Preset調整ポイント / Adjustment Notes
足音 / Footstepsse_footstepHit/Hurt → 短く軽い音に調整 / Adjust to short, light soundDecay を極小に / Minimize decay
食事 / Eatingse_eatPickup/Coin → 柔らかい音に / Soften the soundFrequency 低め / Lower frequency
料理 / Cookingse_cookExplosion → 短くジュッという音に / Short sizzle soundSustain 短め / Short sustain
睡眠 / Sleepse_sleep_startPower Up → ゆっくり下降音に / Slow descending toneSlide をマイナスに / Negative slide
吹き出し / Speech Bubblese_bubble_open, se_bubble_closeBlip/Select → ポップな音 / Pop soundFrequency 高め / Higher frequency
犬の鳴き声 / Dog Barkse_eve_barkJump → 短い高音 / Short high pitchFrequency Slide で「ワン」感を出す / Use freq slide for bark feel
犬の甘え鳴き / Dog Whinese_eve_whinePower Up → 上昇する細い音 / Rising thin toneDuty cycle で細さを調整 / Adjust thinness with duty cycle
ドアの開閉 / Doorse_doorHit/Hurt → 低い短い音 / Low short soundLow-pass filter 適用 / Apply low-pass filter

7.5.3 環境音(アンビエント): 効果音ラボ(無料・商用利用可 / Free, Commercial OK)

日常の生活音は 効果音ラボ(https://soundeffect-lab.info/)から取得する。無料、商用利用可、クレジット表記不要。

Source daily life ambient sounds from Sound Effect Lab (https://soundeffect-lab.info/). Free, commercial use OK, no attribution required.

環境音 / Ambient Sound効果音ラボのカテゴリ / Category on Siteファイル名 / File Nameループ処理 / Loop Processing
時計の秒針 / Clock Ticking生活 > 時計 / Daily Life > Clockambient_clock.oggシームレスループ加工 / Seamless loop edit
鳥のさえずり / Bird Song自然 > 鳥 / Nature > Birdsambient_birds.ogg朝〜夕方のみ再生 / Play morning-evening only
虫の音 / Insect Sounds自然 > 虫 / Nature > Insectsambient_insects.ogg夜のみ再生(Phase 2)/ Night only (Phase 2)
雨音 / Rain自然 > 天気 / Nature > Weatherambient_rain.oggイベント時使用 / Event use

効果音ラボ利用規約の要点 / Sound Effect Lab Terms Summary

  • 商用利用: OK(YouTubeライブ配信含む)/ Commercial use: OK (including YouTube live streams)
  • クレジット表記: 不要 / Attribution: Not required
  • 素材の再配布: 禁止(ゲーム内で使用する分には問題なし)/ Redistribution: Prohibited (usage in-game is fine)
  • 素材の加工: OK / Modifications: OK

7.5.4 投げ銭ジングル: ChipTone(無料・ブラウザベース / Free, Browser-Based)

ティアごとの投げ銭ジングルは ChipTone(https://sfbgames.itch.io/chiptone)で生成する。ティアに応じて音の豪華さを段階的に上げる。

Generate per-tier tip jingles using ChipTone (https://sfbgames.itch.io/chiptone). Increase sound richness progressively by tier.

ティア / Tier音の方向性 / Sound DirectionChipTone 設定ポイント / ChipTone Settings長さ / Duration
Micro (50-199 LC)シンプルなコインドロップ音 / Simple coin dropWave: Square, 単音、短い減衰 / Single note, short decay~0.3 sec
Small (200-999 LC)2音の軽いメロディ / Light 2-note melodyWave: Square + Triangle, 上昇 2 音 / Rising 2 notes~0.5 sec
Medium (1,000-4,999 LC)3-4 音のファンファーレ風 / 3-4 note fanfare styleWave: Square, アルペジオ上昇 / Arpeggio ascending~1.0 sec
Large (5,000-9,999 LC)豪華なファンファーレ / Grand fanfareWave: Square + Noise, 和音 + ドラムロール感 / Chord + drum roll feel~2.0 sec
Mega (10,000+ LC)最高級ファンファーレ + キラキラ / Premium fanfare + sparkleWave: 全波形ミックス / All waveform mix, ビブラート付き / With vibrato~3.0 sec

7.6 制作ワークフロー / Production Workflow

MVP オーディオ素材を制作する具体的な手順。1-2 日で完了可能な工程。

Concrete steps for producing MVP audio assets. Completable in 1-2 days.

Step 1: BGM 候補生成 / Generate BGM Candidates

  1. Suno AI に有料プラン(Pro: $10/月)でログイン / Log in to Suno AI with paid plan (Pro: $10/month)
  2. 各時間帯のプロンプト(7.5.1 の表参照)を入力 / Enter prompts for each time period (see 7.5.1 table)
  3. 各時間帯で 5 曲以上 生成する / Generate 5+ tracks per time period
  4. 24 時間耐性の観点で最良の 1 曲を選定する(穏やか、繰り返し聴いて疲れない)/ Select best track per period for 24h endurance (calm, not fatiguing on repeat)
  5. 選定基準: ループ感が自然か、音量が安定しているか、チップチューン要素があるか / Selection criteria: natural loop feel, stable volume, chiptune elements present

Step 2: BGM エクスポート / Export BGM

  1. 選定した BGM を Suno からダウンロード(MP3 形式)/ Download selected BGM from Suno (MP3 format)
  2. Audacity または ffmpeg で OGG Vorbis に変換 / Convert to OGG Vorbis using Audacity or ffmpeg
  3. 変換コマンド例 / Conversion command example:
    bash
    ffmpeg -i input.mp3 -c:a libvorbis -q:a 4 -ar 44100 output.ogg
  4. ループポイントの確認: 先頭と末尾のクロスフェード処理 / Verify loop points: crossfade at start and end
  5. ファイルサイズ目安: 各曲 500KB-1MB / Target file size: 500KB-1MB per track

Step 3: SE 生成 / Generate Sound Effects

  1. jsfxr(https://sfxr.me/)をブラウザで開く / Open jsfxr in browser
  2. 7.5.2 の表に従い、各カテゴリの SE を生成 / Generate SE for each category per 7.5.2 table
  3. プリセットを選択 → パラメータ微調整 → Randomize で候補を探る / Select preset, fine-tune, use Randomize to explore
  4. OGG 形式でエクスポート(jsfxr は WAV 出力 → ffmpeg で OGG 変換)/ Export as OGG (jsfxr outputs WAV, convert with ffmpeg)
    bash
    ffmpeg -i input.wav -c:a libvorbis -q:a 6 output.ogg
  5. ChipTone で投げ銭ジングルを生成(7.5.4 の表参照)/ Generate tip jingles with ChipTone (see 7.5.4 table)

Step 4: ゲーム内テスト / In-Game Testing

  1. 生成した全ファイルを packages/frontend/src/assets/audio/ に配置 / Place all generated files in packages/frontend/src/assets/audio/
  2. Web Audio API の AudioManager でロードテスト / Load test with Web Audio API AudioManager
  3. OBS Browser Source 環境での再生確認 / Verify playback in OBS Browser Source environment
  4. 各 SE のトリガータイミング確認(レイテンシ < 50ms)/ Verify SE trigger timing (latency < 50ms)
  5. BGM のループ再生確認(ギャップなし)/ Verify BGM loop playback (no gaps)

Step 5: 音量バランス調整 / Volume Balance Adjustment

  1. 全レイヤーを同時再生(BGM + SE + Ambient)/ Play all layers simultaneously (BGM + SE + Ambient)
  2. BGM が会話・SE の邪魔にならないことを確認 / Verify BGM doesn't interfere with conversation/SE
  3. 投げ銭 SE が BGM より確実に目立つことを確認 / Verify tip SE stands out clearly over BGM
  4. 12 時間連続再生テストで聴覚疲労を評価 / Evaluate listener fatigue with 12-hour continuous playback test
  5. 音量設定値を Section 13 の設定値一覧に反映する / Update volume values in Section 13 configuration table

リリース前に全素材のライセンスを確認するためのチェックリスト。

Pre-release checklist to verify licensing for all assets.

7.7.1 ソース別ライセンス確認 / License Verification by Source

ソース / Sourceライセンス状態 / License Status商用利用 / Commercial UseContent ID リスク / Content ID Risk確認事項 / Verification Items
Suno AI(有料プラン)有料プランで商用利用可 / Commercial OK with paid planOK極低 / Very Lowプラン契約を確認、利用規約の最新版を保存 / Verify plan subscription, save latest ToS
jsfxrパブリックドメイン / Public DomainOKなし / Noneライセンス確認不要 / No license check needed
効果音ラボ独自ライセンス・商用利用可 / Custom license, commercial OKOK(クレジット不要)/ OK (no attribution)なし / None利用規約ページのスクリーンショットを保存 / Save screenshot of terms page
ChipTone無料・自由利用 / Free, unrestricted useOKなし / Noneツールで生成した音は利用者に帰属 / Generated sounds belong to the user

7.7.2 Content ID リスク評価 / Content ID Risk Assessment

リスクレベル / Risk Level対象 / Target対策 / Countermeasure
極低 / Very LowSuno AI 生成 BGMプロンプトに既存楽曲名・アーティスト名を含めない。生成後に Suno の Content ID 登録状況を確認する / Do not include existing song/artist names in prompts. Check Suno's Content ID registration status after generation
なし / Nonejsfxr / ChipTone 生成 SEツール生成のオリジナル音のため Content ID 登録は存在しない / Tool-generated original sounds have no Content ID registrations
なし / None効果音ラボ素材Content ID 未登録を明言している。ただし他者が無断登録する可能性はゼロではない / Explicitly states no Content ID registration. However, unauthorized registration by others is not impossible

Suno AI 利用時の注意 / Suno AI Usage Caution

  • Suno の利用規約は頻繁に更新される。BGM 生成前に必ず最新の規約を確認すること / Suno's ToS updates frequently. Always check the latest terms before generating BGM
  • Free プランで生成した楽曲は商用利用不可。必ず Pro ($10/月) または Premier ($30/月) プランを使用すること / Free plan tracks cannot be used commercially. Always use Pro ($10/mo) or Premier ($30/mo) plan
  • 生成した楽曲の URL とプロンプトを記録しておく(権利証明のため)/ Record generated track URLs and prompts (for rights documentation)

7.7.3 リリース前チェック項目 / Pre-Release Checklist

  • [ ] 全 BGM ファイルが Suno 有料プランで生成されたことを確認 / Confirm all BGM files were generated on Suno paid plan
  • [ ] Suno 利用規約の商用利用条項のスクリーンショットを保存 / Save screenshot of Suno ToS commercial use clause
  • [ ] jsfxr / ChipTone 生成 SE のライセンス表記(パブリックドメイン)を ATTRIBUTION.json に記載 / Document jsfxr/ChipTone SE license (public domain) in ATTRIBUTION.json
  • [ ] 効果音ラボの利用規約確認済みであることを記録 / Record that Sound Effect Lab terms have been verified
  • [ ] YouTube にテスト動画をアップロードし、Content ID の検出がないことを確認 / Upload test video to YouTube and confirm no Content ID detection
  • [ ] TikTok にテスト動画をアップロードし、著作権警告がないことを確認 / Upload test video to TikTok and confirm no copyright warnings
  • [ ] 全素材の出典元 URL・プロンプト・ライセンスを ATTRIBUTION.json に一元管理 / Centralize all asset source URLs, prompts, and licenses in ATTRIBUTION.json

7.8 オーディオ素材 予算見積もり / Audio Asset Budget Estimate

MVP 及び Phase 2 で必要なオーディオ関連コストの見積もり。

Budget estimate for audio-related costs in MVP and Phase 2.

MVP 予算 / MVP Budget

項目 / Itemツール / Toolコスト / Cost備考 / Notes
BGM 生成(5曲)/ BGM generation (5 tracks)Suno AI Pro プラン / Pro Plan$10/月 (1ヶ月分) / $10/mo (1 month)月 500 曲生成可能。5 時間帯 x 5 候補 = 25 曲で十分 / 500 tracks/mo. 5 periods x 5 candidates = 25 tracks sufficient
SE 生成 / SE generationjsfxr$0無料・ブラウザベース / Free, browser-based
環境音 / Ambient sounds効果音ラボ$0無料・商用利用可 / Free, commercial OK
投げ銭ジングル / Tip jinglesChipTone$0無料・ブラウザベース / Free, browser-based
音声編集ツール / Audio editing toolAudacity + ffmpeg$0オープンソース / Open source
MVP 合計 / MVP Total$10最小構成のコスト / Minimum configuration cost

Phase 2 追加予算 / Phase 2 Additional Budget

項目 / Itemツール / Toolコスト / Cost備考 / Notes
BGM バリエーション追加(10-15曲)/ BGM variation expansion (10-15 tracks)Suno AI Pro プラン / Pro Plan$10/月 (1ヶ月分) / $10/mo (1 month)各時間帯 2-3 曲に拡充 / Expand to 2-3 tracks per period
イベント BGM(5曲)/ Event BGM (5 tracks)Suno AI上記に含む / Included above喧嘩、仲直り、デート等 / Argument, makeup, date, etc.
季節別環境音 / Seasonal ambient効果音ラボ + Freesound$0セミ、虫の声、風鈴等 / Cicadas, crickets, wind chimes, etc.
VOICEVOX 音声 / VOICEVOX voiceVOICEVOX$0オープンソース・商用利用可 / Open source, commercial OK
Phase 2 合計 / Phase 2 Total$10

年間運用コスト / Annual Operating Cost

項目 / Itemコスト / Cost備考 / Notes
Suno AI Pro(必要月のみ)/ Suno AI Pro (as needed)$20-40/年 / $20-40/year新曲追加時のみ契約。常時契約は不要 / Subscribe only when adding new tracks. No need for continuous subscription
その他ツール / Other tools$0全て無料ツール / All free tools
年間合計 / Annual Total$20-40極めて低コストで運用可能 / Operable at very low cost

コスト最適化のポイント / Cost Optimization Tips

  • Suno AI は必要な月だけ Pro プランに加入し、まとめて生成する / Subscribe to Suno Pro only in needed months and batch-generate
  • SE・ジングル・環境音は全て無料ツールで賄える / SE, jingles, and ambient sounds can all be covered by free tools
  • Audacity(無料)で十分な音声編集が可能。有料 DAW は不要 / Audacity (free) provides sufficient audio editing. No paid DAW needed

8. WebSocket 連携 / WebSocket Integration

8.1 バックエンド → フロントエンド 音声イベント / Backend → Frontend Audio Events

バックエンドからフロントエンドへの WebSocket メッセージでオーディオイベントをトリガーする。

Trigger audio events via WebSocket messages from backend to frontend.

typescript
// 音声関連 WebSocket イベント型 / Audio-related WebSocket event types
type AudioEvent =
  | { type: 'bgm_change'; trackId: string; fadeIn?: number }
  | { type: 'se_play'; seId: string; volume?: number }
  | { type: 'se_stop'; seId: string }
  | { type: 'ambient_update'; activeIds: string[] }
  | { type: 'volume_update'; channel: 'master' | 'bgm' | 'se' | 'ambient'; volume: number }
  | { type: 'tip_audio_sequence'; tier: 'micro' | 'small' | 'medium' | 'large' | 'mega' }
  | { type: 'event_bgm'; eventType: 'argument' | 'makeup' | 'date' | 'milestone' | 'walk' }

// フロントエンドでの処理 / Frontend handling
function handleAudioEvent(event: AudioEvent, audioManager: AudioManager): void {
  switch (event.type) {
    case 'bgm_change':
      audioManager.crossfadeBGM(event.trackId, event.fadeIn ?? 3)
      break

    case 'se_play':
      audioManager.playSE(event.seId)
      break

    case 'tip_audio_sequence':
      playTipAudioSequence(event.tier, audioManager)
      break

    case 'event_bgm':
      playEventBGM(event.eventType, audioManager)
      break

    case 'ambient_update':
      audioManager.setAmbientMix(event.activeIds)
      break

    case 'volume_update':
      audioManager.setChannelVolume(event.channel, event.volume)
      break
  }
}

8.2 投げ銭オーディオシーケンス / Tip Audio Sequence

投げ銭受信時にビジュアルエフェクト(asset-spec.md)と同期した音声シーケンスを再生する。

Play audio sequences synced with visual effects (asset-spec.md) when tips are received.

typescript
async function playTipAudioSequence(
  tier: 'micro' | 'small' | 'medium' | 'large' | 'mega',
  audio: AudioManager
): Promise<void> {
  switch (tier) {
    case 'micro':
      audio.playSE('se_tip_micro')
      break

    case 'small':
      audio.playSE('se_tip_small')
      await delay(500)
      audio.playSE('se_tip_small_land')
      break

    case 'medium':
      audio.setBGMVolume(0.10, 0.5)
      audio.playSE('se_tip_medium_knock')
      await delay(1000)
      audio.playSE('se_tip_medium_open')
      await delay(1000)
      audio.playSE('se_tip_medium_reveal')
      await delay(2000)
      audio.setBGMVolume(0.20, 1.0)
      break

    case 'large':
      audio.stopBGM(0.5)
      await delay(200)
      audio.playSE('se_tip_large_flash')
      await delay(500)
      audio.playSE('se_tip_large_fanfare')
      await delay(2000)
      audio.playSE('se_tip_large_sparkle')
      await delay(5000)
      audio.crossfadeBGM(getCurrentTimeBGM(), 2)
      break

    case 'mega':
      // Large と同じ + 追加演出
      // Same as Large + additional effects
      audio.stopBGM(0.5)
      await delay(200)
      audio.playSE('se_tip_large_flash')
      await delay(500)
      audio.playSE('se_tip_mega')
      await delay(3000)
      audio.playSE('se_tip_large_sparkle')
      await delay(6000)
      audio.crossfadeBGM(getCurrentTimeBGM(), 2)
      break
  }
}

function delay(ms: number): Promise<void> {
  return new Promise(resolve => setTimeout(resolve, ms))
}

9. 管理コマンド / Admin Commands

9.1 音声関連管理コマンド / Audio Admin Commands

管理者が配信中にリアルタイムで音声設定を調整するためのコマンド。admin-commands.md と連携する。

Commands for administrators to adjust audio settings in real-time during streaming. Integrated with admin-commands.md.

コマンド / Command説明 / Description例 / Example
!audio master <vol>マスター音量設定 / Set master volume!audio master 0.7
!audio bgm <vol>BGM 音量設定 / Set BGM volume!audio bgm 0.15
!audio se <vol>SE 音量設定 / Set SE volume!audio se 0.5
!audio ambient <vol>環境音音量設定 / Set ambient volume!audio ambient 0.1
!audio mute全ミュート / Mute all!audio mute
!audio unmuteミュート解除 / Unmute!audio unmute
!audio bgm play <id>特定BGM再生 / Play specific BGM!audio bgm play night_01
!audio bgm stopBGM停止 / Stop BGM!audio bgm stop
!audio se test <id>SE テスト再生 / Test play SE!audio se test se_eve_bark
!audio status現在の音声状態を表示 / Show current audio state!audio status

10. パフォーマンス指標 / Performance Targets

指標 / Metric目標値 / Target備考 / Notes
オーディオレイテンシ / Audio latency< 50msSE のトリガーから再生まで / From SE trigger to playback
同時再生数 / Concurrent sounds< 8BGM(1) + SE(4) + Ambient(3) / BGM(1) + SE(4) + Ambient(3)
メモリ使用量 / Memory usage< 15 MB全デコード済みバッファ合計 / Total decoded buffers
CPU 使用率(オーディオ)/ CPU (audio)< 5%Web Audio API 処理のみ / Web Audio API processing only
プリロード時間 / Preload time< 3 secPhase 1 のみ / Phase 1 only
ファイル合計サイズ / Total file size< 10 MB全オーディオファイル圧縮後 / All audio files compressed

11. テストケース / Test Cases

11.1 BGM テスト / BGM Tests

#テスト / Test期待結果 / Expected
BT1ゲーム内時刻を 7:59 → 8:00 に変更 / Change in-game time 7:59 → 8:00morning BGM → daytime BGM に 3秒クロスフェード / 3s crossfade to daytime
BT2全時間帯を順番に通過 / Pass through all time periods sequentially5種類のBGMが正しい順序で切替 / 5 BGM types switch in correct order
BT3BGM を4ループ再生 / Play BGM for 4 loops3〜5ループ目でサイレンスギャップが挿入される / Silence gap inserted at loop 3-5
BT4バリエーションテスト / Variation test同時間帯で複数回切り替えると異なるバリエーションが選択される / Different variations selected on repeated switches
BT5全キャラ睡眠開始 / All characters start sleepingBGM音量が 0.10 にフェードダウン / BGM volume fades to 0.10

11.2 投げ銭 SE テスト / Tip SE Tests

#テスト / Test期待結果 / Expected
TT150 LC (Micro) 投げ銭 / 50 LC tipコインドロップ音のみ、BGM変更なし / Coin drop only, no BGM change
TT2200 LC (Small) 投げ銭 / 200 LC tipコイン音 → 0.5秒後に着地音 / Coin → landing sound after 0.5s
TT31,000 LC (Medium) 投げ銭 / 1,000 LC tipノック → 開封 → 出現音の3段階シーケンス / 3-stage: knock → open → reveal
TT45,000 LC (Large) 投げ銭 / 5,000 LC tipBGMフェードアウト → フラッシュ → ファンファーレ → BGM復帰 / BGM fadeout → flash → fanfare → BGM return
TT5連続投げ銭(2秒間隔で3回)/ Rapid tips (3 tips in 2s intervals)クールダウンにより SE が重複しない / SE doesn't overlap due to cooldown

11.3 環境音テスト / Ambient Sound Tests

#テスト / Test期待結果 / Expected
AT1時計音が24時間再生 / Clock ticking plays 24h常時シームレスループ、音量極小 / Always seamless loop, very low volume
AT2時刻 6:00(早朝)/ Time 6:00 (early morning)鳥のさえずり環境音がフェードイン / Bird ambient fades in
AT3時刻 22:00(夜)/ Time 22:00 (night)鳥の音がフェードアウト、夜の静寂に切替 / Birds fade out, switch to night quiet

11.4 パフォーマンステスト / Performance Tests

#テスト / Test期待結果 / Expected
PT1BGM + SE 4種 + Ambient 3種を同時再生 / Play BGM + 4 SE + 3 Ambient simultaneouslyFPS が 30 以上を維持 / FPS stays above 30
PT212時間連続再生 / 12-hour continuous playbackメモリリークなし、音声品質劣化なし / No memory leaks, no audio quality degradation
PT3Phase 1 プリロード / Phase 1 preload3秒以内に完了 / Completes within 3 seconds

12. MVP スコープ / MVP Scope

12.1 MVP に含む / Included in MVP

#項目 / Item備考 / Notes
1時間帯別 BGM(5種類 x 各1バリエーション)/ Time-based BGM (5 types x 1 variation each)最小構成 / Minimum set
2投げ銭 SE(全ティア)/ Tip SE (all tiers)投げ銭体験の核心 / Core of tip experience
3基本アクション SE(歩行、食事、料理、睡眠)/ Basic action SE (walk, eat, cook, sleep)生活感の最低限 / Minimum daily life feel
4Eve 基本 SE(吠え、甘え鳴き)/ Eve basic SE (bark, whine)キャラクター性の最低限 / Minimum character personality
5吹き出し SE / Speech bubble SEUI フィードバック / UI feedback
6BGM クロスフェード / BGM crossfadeスムーズな切替 / Smooth transition
7Web Audio API 基本実装 / Web Audio API basic implementationAudioManager, GainNode 構成 / AudioManager, GainNode setup
8プリロードシステム / Preload systemPhase 1 のみ / Phase 1 only

12.2 Phase 2 以降 / Phase 2+

#項目 / Item備考 / Notes
1BGM バリエーション追加(各時間帯 2-3曲)/ BGM variation expansion (2-3 tracks per period)長時間視聴対応 / Long-term viewing support
2ダイナミックレイヤー BGM / Dynamic layered BGMアクティビティ連動 / Activity-linked
3サイレンスギャップ / Silence gaps24時間配信の最適化 / 24-hour stream optimization
4季節別環境音 / Seasonal ambient soundsセミ、虫の声など / Cicadas, crickets, etc.
5ストーリーイベント BGM / Story event BGM喧嘩、仲直り、デート / Argument, makeup, date
6VOICEVOX 連携音声 / VOICEVOX voice integrationキャラクター音声 / Character voice
7管理コマンド / Admin commands配信中のリアルタイム調整 / Real-time adjustment during stream

13. 設定値一覧 / Configuration Values

運用時に調整可能な音声関連パラメータ。

Audio-related parameters adjustable during operation.

パラメータ / Parameterデフォルト値 / Default説明 / Description
MASTER_VOLUME0.80マスター音量 / Master volume
BGM_VOLUME0.20BGM 音量 / BGM volume
SE_VOLUME0.50SE 音量 / SE volume
AMBIENT_VOLUME0.15環境音音量 / Ambient volume
CROSSFADE_DURATION_SEC3BGM クロスフェード時間(秒)/ BGM crossfade duration (seconds)
SILENCE_GAP_MIN_SEC10サイレンスギャップ最小長(秒)/ Silence gap min length (seconds)
SILENCE_GAP_MAX_SEC30サイレンスギャップ最大長(秒)/ Silence gap max length (seconds)
SILENCE_GAP_INTERVAL_LOOPS3-5サイレンスギャップ挿入間隔(ループ回数)/ Silence gap insertion interval (loops)
SLEEP_BGM_VOLUME0.10全キャラ睡眠時のBGM音量 / BGM volume when all chars sleeping
SE_FOOTSTEP_COOLDOWN_MS250足音 SE のクールダウン(ms)/ Footstep SE cooldown (ms)
SE_TIP_COOLDOWN_MS1000投げ銭 SE のクールダウン(ms)/ Tip SE cooldown (ms)
PRELOAD_TIMEOUT_MS10000プリロードタイムアウト(ms)/ Preload timeout (ms)
MAX_CONCURRENT_SOUNDS8同時再生音数上限 / Max concurrent sound count
COMPRESSOR_THRESHOLD-24DynamicsCompressor 閾値(dB)/ DynamicsCompressor threshold (dB)
COMPRESSOR_RATIO12DynamicsCompressor 比率 / DynamicsCompressor ratio