添加音频文件

This commit is contained in:
xsl
2026-05-18 19:05:54 +08:00
parent 9c5d9e586c
commit 380868500a
117 changed files with 77 additions and 81 deletions
+10 -10
View File
@@ -95,7 +95,7 @@ class GameEngine {
// 开始主BGM
await sleep(3000);
Snd.startBGM(`${MUS}/lv11_bgm_m1_main_loop_v1.wav`, { vol: 0.3 });
Snd.startBGM(`${MUS}/lv11_bgm_m1_main_loop_v1.mp3`, { vol: 0.3 });
}
_scheduleSpecialEvents() {
@@ -116,7 +116,7 @@ class GameEngine {
if (this.vars.HE_BACK === true && !this._doorbell) {
this._doorbell = true;
Snd.playFX ? null : null;
Snd.playVoice([`${SFX}/sfx_door_knock_gentle_v1.wav`]);
Snd.playVoice([`${SFX}/sfx_door_knock_gentle_v1.mp3`]);
Haptic.ring();
}
});
@@ -128,7 +128,7 @@ class GameEngine {
const unread = Object.values(this.msgState).filter(s => s === 'unread').length
+ (Object.keys(this.msgState).length === 0 ? MESSAGES.length : 0);
if (this.vars.UNREAD >= 8) {
Snd.playVoice([`${TDIR}/lv11_sys_battery_01_wav_v1.wav`]);
Snd.playVoice([`${TDIR}/lv11_sys_battery_01_wav_v1.mp3`]);
Haptic.system();
}
}
@@ -716,13 +716,13 @@ class GameEngine {
async _endingA() {
// 妈妈语音播完→厨房→烧水
Snd.startAmbience(`${AMB}/amb_kitchen_morning_v1.wav`, { vol: 0.3 });
Snd.startAmbience(`${AMB}/amb_kitchen_morning_v1.mp3`, { vol: 0.3 });
await sleep(2000);
Snd.playVoice([`${SFX}/sfx_kettle_whistle_v1.wav`]);
Snd.playVoice([`${SFX}/sfx_kettle_whistle_v1.mp3`]);
await sleep(4000);
this._showCaption('明天再说。');
await sleep(3000);
Snd.playVoice([`${SFX}/sfx_ending_chime_v1.wav`]);
Snd.playVoice([`${SFX}/sfx_ending_chime_v1.mp3`]);
}
async _endingB() {
@@ -741,13 +741,13 @@ class GameEngine {
}
async _endingD() {
Snd.playVoice([`${TDIR}/lv11_sys_battery_01_wav_v1.wav`]);
Snd.playVoice([`${TDIR}/lv11_sys_battery_01_wav_v1.mp3`]);
await sleep(2000);
Haptic.ring();
await sleep(1000);
// 屏幕"彻底黑了"→清晨鸟叫
await sleep(3000);
Snd.startAmbience(`${AMB}/amb_dawn_birds_v1.wav`, { vol: 0.4 });
Snd.startAmbience(`${AMB}/amb_dawn_birds_v1.mp3`, { vol: 0.4 });
await sleep(4000);
this._showCaption('早上好。');
}
@@ -759,11 +759,11 @@ class GameEngine {
await TTS.speak('那我下次出差来北京,请你吃饭好不好。', { rate: 0.9 });
await sleep(2000);
// 林夏的轻笑(用self3y音色)
Snd.playVoice([`${TDIR}/lv11_sys_goodnight_wav_v1.wav`]);
Snd.playVoice([`${TDIR}/lv11_sys_goodnight_wav_v1.mp3`]);
await sleep(3000);
this._showCaption('好。');
await sleep(2000);
Snd.playVoice([`${SFX}/sfx_ending_chime_v1.wav`]);
Snd.playVoice([`${SFX}/sfx_ending_chime_v1.mp3`]);
}
_showCaption(text) {
+2 -2
View File
@@ -19,8 +19,8 @@ async function main() {
// 预加载关键短音效
await Promise.allSettled([
Snd.preload('sfx_keyboard', `${SFX}/sfx_keyboard_slow_v1.wav`),
Snd.preload('sfx_chime', `${SFX}/sfx_ending_chime_v1.wav`),
Snd.preload('sfx_keyboard', `${SFX}/sfx_keyboard_slow_v1.mp3`),
Snd.preload('sfx_chime', `${SFX}/sfx_ending_chime_v1.mp3`),
]);
// 请求屏幕常亮(Android Chrome 支持)
+65 -65
View File
@@ -1,6 +1,6 @@
// story.js — 《林夏》全部16条消息数据
const A = '../audio/00_raw';
const A = '../audio/mp3';
const TDIR = `${A}/tts`;
const MUS = `${A}/music`;
const SFX = `${A}/sfx`;
@@ -21,9 +21,9 @@ const MESSAGES = [
id: 1, gameTime: '21:03', triggerAt: gt(21, 3),
type: 'call',
sender: 'mom', senderName: '妈妈',
ringtone: `${MUS}/lv11_ring_mom_v1.wav`,
ringtone: `${MUS}/lv11_ring_mom_v1.mp3`,
ringDuration: 28,
audio: [`${TDIR}/lv11_2103_mom_call_01_wav_v1.wav`],
audio: [`${TDIR}/lv11_2103_mom_call_01_wav_v1.mp3`],
note: '今晚煮了你爱吃的排骨',
stateOnAnswer: { MOM_LINK: true },
profileOnMiss: { avoidance: 2 },
@@ -36,9 +36,9 @@ const MESSAGES = [
type: 'wechat_voice',
sender: 'xiaomei', senderName: '小美',
audio: [
`${TDIR}/lv11_2115_xiaomei_voice_01_wav_v1.wav`,
`${TDIR}/lv11_2115_xiaomei_voice_02_wav_v1.wav`,
`${TDIR}/lv11_2115_xiaomei_voice_03_wav_v1.wav`,
`${TDIR}/lv11_2115_xiaomei_voice_01_wav_v1.mp3`,
`${TDIR}/lv11_2115_xiaomei_voice_02_wav_v1.mp3`,
`${TDIR}/lv11_2115_xiaomei_voice_03_wav_v1.mp3`,
],
note: '你被甩了我都听说了,明天喝酒',
isTutorial: true,
@@ -58,9 +58,9 @@ const MESSAGES = [
id: 3, gameTime: '21:20', triggerAt: gt(21, 20),
type: 'call',
sender: 'delivery', senderName: '外卖小哥',
ringtone: `${MUS}/lv11_ring_delivery_v1.wav`,
ringtone: `${MUS}/lv11_ring_delivery_v1.mp3`,
ringDuration: 20,
audio: [`${TDIR}/lv11_2120_delivery_call_01_wav_v1.wav`],
audio: [`${TDIR}/lv11_2120_delivery_call_01_wav_v1.mp3`],
note: '你好,你的麻辣烫到了',
profileOnMiss: { avoidance: 1 },
profileOnAnswer:{ engagement: 1 },
@@ -71,7 +71,7 @@ const MESSAGES = [
id: 4, gameTime: '21:30', triggerAt: gt(21, 30),
type: 'wechat_voice',
sender: 'azhe', senderName: '阿哲',
audio: [`${TDIR}/lv11_2130_azhe_voice_01_wav_v1.wav`],
audio: [`${TDIR}/lv11_2130_azhe_voice_01_wav_v1.mp3`],
note: 'AirPods落你那了,方便寄一下吗',
detailReplies: [
{ label: '好,明天寄。', dir: 'left', state: { HE_BACK: false }, profile: { engagement: 1 } },
@@ -92,7 +92,7 @@ const MESSAGES = [
id: 5, gameTime: '21:45', triggerAt: gt(21, 45),
type: 'wechat_voice',
sender: 'hr', senderName: 'HR王姐',
audio: [`${TDIR}/lv11_2145_hr_voice_01_wav_v1.wav`],
audio: [`${TDIR}/lv11_2145_hr_voice_01_wav_v1.mp3`],
note: '离职流程周三前办完哈',
detailReplies: [
{ label: '好的,我知道了。谢谢王姐。', dir: 'left', profile: { engagement: 1 } },
@@ -110,9 +110,9 @@ const MESSAGES = [
id: 6, gameTime: '22:00', triggerAt: gt(22, 0),
type: 'wechat_voice',
sender: 'anan', senderName: '安安',
audio: [`${TDIR}/lv11_2200_anan_voice_01_wav_v1.wav`],
audio: [`${TDIR}/lv11_2200_anan_voice_01_wav_v1.mp3`],
note: '我在helens!要不要过来!',
bgUnder: `${AMB}/amb_bar_loud_01_v1.wav`, // 酒吧底噪混入
bgUnder: `${AMB}/amb_bar_loud_01_v1.mp3`, // 酒吧底噪混入
detailReplies: [
{ label: '我今晚不方便,你们玩好啊。', dir: 'left', profile: { avoidance: 1 } },
{ label: '在哪儿啊?我……看看吧。', dir: 'right', profile: { engagement: 1 } },
@@ -130,11 +130,11 @@ const MESSAGES = [
type: 'wechat_voice',
sender: 'dorm', senderName: '我们寝室的(4人群)',
audio: [
`${TDIR}/lv11_2215_dorm_a_voice_01_wav_v1.wav`,
`${TDIR}/lv11_2215_dorm_a_voice_02_wav_v1.wav`,
`${TDIR}/lv11_2215_dorm_b_voice_01_wav_v1.wav`,
`${TDIR}/lv11_2215_dorm_b_voice_02_wav_v1.wav`,
`${TDIR}/lv11_2215_dorm_c_voice_01_wav_v1.wav`,
`${TDIR}/lv11_2215_dorm_a_voice_01_wav_v1.mp3`,
`${TDIR}/lv11_2215_dorm_a_voice_02_wav_v1.mp3`,
`${TDIR}/lv11_2215_dorm_b_voice_01_wav_v1.mp3`,
`${TDIR}/lv11_2215_dorm_b_voice_02_wav_v1.mp3`,
`${TDIR}/lv11_2215_dorm_c_voice_01_wav_v1.mp3`,
],
note: '室友A升职了,最后她@你',
isGroup: true,
@@ -156,12 +156,12 @@ const MESSAGES = [
id: 8, gameTime: '22:30', triggerAt: gt(22, 30),
type: 'call',
sender: 'unknown', senderName: '未知号码',
ringtone: `${MUS}/lv11_ring_unknown_v1.wav`,
ringtone: `${MUS}/lv11_ring_unknown_v1.mp3`,
ringDuration: 20,
audio: [`${SFX}/sfx_breathing_unknown_v1.wav`],
audio: [`${SFX}/sfx_breathing_unknown_v1.mp3`],
note: '接通后只有呼吸声,6秒挂断',
autoHangup: 6, // 接通后自动挂断秒数
sfxAfter: `${SFX}/sfx_heartbeat_fast_v1.wav`,
sfxAfter: `${SFX}/sfx_heartbeat_fast_v1.mp3`,
profileOnMiss: { avoidance: 1 },
profileOnAnswer:{ nostalgia: 1 },
},
@@ -172,14 +172,14 @@ const MESSAGES = [
type: 'wechat_voice',
sender: 'xiaomei', senderName: '小美',
audio: [
`${TDIR}/lv11_2245_xiaomei_voice_01_seg1_wav_v1.wav`,
`${TDIR}/lv11_2245_xiaomei_voice_01_seg2_wav_v1.wav`,
`${TDIR}/lv11_2245_xiaomei_voice_01_seg3_wav_v1.wav`,
`${TDIR}/lv11_2245_xiaomei_voice_01_seg4_wav_v1.wav`,
`${TDIR}/lv11_2245_xiaomei_voice_01_seg1_wav_v1.mp3`,
`${TDIR}/lv11_2245_xiaomei_voice_01_seg2_wav_v1.mp3`,
`${TDIR}/lv11_2245_xiaomei_voice_01_seg3_wav_v1.mp3`,
`${TDIR}/lv11_2245_xiaomei_voice_01_seg4_wav_v1.mp3`,
],
note: '阿哲大三追过我,我没答应他',
isDrunk: true,
bgm: `${MUS}/lv11_bgm_m2_suspense_v1.wav`, // 悬疑BGM
bgm: `${MUS}/lv11_bgm_m2_suspense_v1.mp3`, // 悬疑BGM
detailReplies: [
{ label: '我知道了。', dir: 'left', profile: { avoidance: 1 } },
{ label: '你……为什么现在才说。', dir: 'right', profile: { engagement: 2 } },
@@ -217,9 +217,9 @@ const MESSAGES = [
id: 11, gameTime: '23:15', triggerAt: gt(23, 15),
type: 'call',
sender: 'azhe', senderName: '阿哲',
ringtone: `${MUS}/lv11_ring_azhe_v1.wav`,
ringtone: `${MUS}/lv11_ring_azhe_v1.mp3`,
ringDuration: 30,
audio: [`${TDIR}/lv11_2315_azhe_call_01_wav_v1.wav`],
audio: [`${TDIR}/lv11_2315_azhe_call_01_wav_v1.mp3`],
note: '我能过去拿吗?就5分钟',
// 通话中的选择(接通后听完再做)
inCallChoices: [
@@ -236,7 +236,7 @@ const MESSAGES = [
id: 12, gameTime: '23:30', triggerAt: gt(23, 30),
type: 'wechat_voice',
sender: 'zhounan', senderName: '周南',
audio: [`${TDIR}/lv11_2330_zhounan_voice_01_wav_v1.wav`],
audio: [`${TDIR}/lv11_2330_zhounan_voice_01_wav_v1.mp3`],
note: '林夏,是我,周南。初三坐你后桌那个',
detailReplies: [
{ label: '嗯……你好。', dir: 'left', state: { ZHOUNAN_DEPTH: 1 }, profile: { nostalgia: 1 } },
@@ -256,13 +256,13 @@ const MESSAGES = [
type: 'wechat_voice',
sender: 'zhounan', senderName: '周南',
audio: [
`${TDIR}/lv11_2345_zhounan_voice_01_wav_v1.wav`,
`${TDIR}/lv11_2345_zhounan_voice_02_wav_v1.wav`,
`${TDIR}/lv11_2345_zhounan_voice_03_wav_v1.wav`,
`${TDIR}/lv11_2345_zhounan_voice_04_wav_v1.wav`,
`${TDIR}/lv11_2345_zhounan_voice_01_wav_v1.mp3`,
`${TDIR}/lv11_2345_zhounan_voice_02_wav_v1.mp3`,
`${TDIR}/lv11_2345_zhounan_voice_03_wav_v1.mp3`,
`${TDIR}/lv11_2345_zhounan_voice_04_wav_v1.mp3`,
],
note: '高考、复读、二本、回老家……今天我生日',
bgm: `${MUS}/lv11_bgm_m3_zhounan_v1.wav`,
bgm: `${MUS}/lv11_bgm_m3_zhounan_v1.mp3`,
detailReplies: [
{ label: '你讲了好多。我都听了。', dir: 'left', state: { ZHOUNAN_DEPTH_ADD: 1 }, profile: { engagement: 2, nostalgia: 1 } },
{ label: '你一个人在北京,还好吗?', dir: 'right', state: { ZHOUNAN_DEPTH_ADD: 1 }, profile: { engagement: 2 } },
@@ -280,9 +280,9 @@ const MESSAGES = [
id: 14, gameTime: '00:15', triggerAt: gt(0, 15),
type: 'call',
sender: 'mom', senderName: '妈妈',
ringtone: `${MUS}/lv11_ring_mom_v1.wav`,
ringtone: `${MUS}/lv11_ring_mom_v1.mp3`,
ringDuration: 30,
audio: [`${TDIR}/lv11_0015_mom_call_01_wav_v1.wav`],
audio: [`${TDIR}/lv11_0015_mom_call_01_wav_v1.mp3`],
note: '夏夏,你不接电话我有点担心',
stateOnAnswer: { MOM_LINK: true },
profileOnMiss: { avoidance: 2 },
@@ -295,11 +295,11 @@ const MESSAGES = [
type: 'system_notification',
sender: 'self', senderName: '时光胶囊',
text: '3年前的今晚,你给自己录过一段备忘录。是否播放?',
systemAudio: `${TDIR}/lv11_sys_memo_01_wav_v1.wav`,
systemAudio: `${TDIR}/lv11_sys_memo_01_wav_v1.mp3`,
audioByProfile: {
avoidance: `${TDIR}/lv11_0030_self3y_voice_02_wav_v1.wav`,
engagement: `${TDIR}/lv11_0030_self3y_voice_01_wav_v1.wav`,
nostalgia: `${TDIR}/lv11_0030_self3y_voice_03_wav_v1.wav`,
avoidance: `${TDIR}/lv11_0030_self3y_voice_02_wav_v1.mp3`,
engagement: `${TDIR}/lv11_0030_self3y_voice_01_wav_v1.mp3`,
nostalgia: `${TDIR}/lv11_0030_self3y_voice_03_wav_v1.mp3`,
},
note: 'self-3y,由PROFILE决定版本',
stateOnPlay: { SELF_RECORD: true },
@@ -313,20 +313,20 @@ const MESSAGES = [
type: 'wechat_voice',
sender: 'mom', senderName: '妈妈',
audio: [
`${TDIR}/lv11_0200_mom_voice_01_seg1_wav_v1.wav`,
`${TDIR}/lv11_0200_mom_voice_01_seg2_wav_v1.wav`,
`${TDIR}/lv11_0200_mom_voice_01_seg3_wav_v1.wav`,
`${TDIR}/lv11_0200_mom_voice_01_seg4_wav_v1.wav`,
`${TDIR}/lv11_0200_mom_voice_01_seg5_wav_v1.wav`,
`${TDIR}/lv11_0200_mom_voice_01_seg6_wav_v1.wav`,
`${TDIR}/lv11_0200_mom_voice_01_seg7_wav_v1.wav`,
`${TDIR}/lv11_0200_mom_voice_01_seg8_wav_v1.wav`,
`${TDIR}/lv11_0200_mom_voice_01_seg1_wav_v1.mp3`,
`${TDIR}/lv11_0200_mom_voice_01_seg2_wav_v1.mp3`,
`${TDIR}/lv11_0200_mom_voice_01_seg3_wav_v1.mp3`,
`${TDIR}/lv11_0200_mom_voice_01_seg4_wav_v1.mp3`,
`${TDIR}/lv11_0200_mom_voice_01_seg5_wav_v1.mp3`,
`${TDIR}/lv11_0200_mom_voice_01_seg6_wav_v1.mp3`,
`${TDIR}/lv11_0200_mom_voice_01_seg7_wav_v1.mp3`,
`${TDIR}/lv11_0200_mom_voice_01_seg8_wav_v1.mp3`,
],
note: '妈妈讲她24岁那年,结局起点',
bgm: `${MUS}/lv11_bgm_m4_ending_v1.wav`,
bgm: `${MUS}/lv11_bgm_m4_ending_v1.mp3`,
sfxAfter: [
`${SFX}/sfx_night_bus_v1.wav`,
`${SFX}/sfx_cat_yowl_v1.wav`,
`${SFX}/sfx_night_bus_v1.mp3`,
`${SFX}/sfx_cat_yowl_v1.mp3`,
],
isEnding: true,
requiresMomLink: true, // 必须 MOM_LINK=true 才自动播放
@@ -335,24 +335,24 @@ const MESSAGES = [
// 角色→铃声映射(用于收件箱读出)
const SENDERS = {
mom: { name: '妈妈', ringtone: `${MUS}/lv11_ring_mom_v1.wav` },
azhe: { name: '阿哲', ringtone: `${MUS}/lv11_ring_azhe_v1.wav` },
xiaomei: { name: '小美', ringtone: `${MUS}/lv11_ring_xiaomei_v1.wav` },
delivery: { name: '外卖小哥', ringtone: `${MUS}/lv11_ring_delivery_v1.wav` },
hr: { name: 'HR王姐', ringtone: `${MUS}/lv11_ring_hr_v1.wav` },
anan: { name: '安安', ringtone: `${MUS}/lv11_ring_anan_v1.wav` },
dorm: { name: '寝室群', ringtone: `${MUS}/lv11_ring_dorm_group_v1.wav` },
unknown: { name: '未知号码', ringtone: `${MUS}/lv11_ring_unknown_v1.wav` },
zhounan: { name: '周南', ringtone: `${MUS}/lv11_ring_zhounan_v1.wav` },
mom: { name: '妈妈', ringtone: `${MUS}/lv11_ring_mom_v1.mp3` },
azhe: { name: '阿哲', ringtone: `${MUS}/lv11_ring_azhe_v1.mp3` },
xiaomei: { name: '小美', ringtone: `${MUS}/lv11_ring_xiaomei_v1.mp3` },
delivery: { name: '外卖小哥', ringtone: `${MUS}/lv11_ring_delivery_v1.mp3` },
hr: { name: 'HR王姐', ringtone: `${MUS}/lv11_ring_hr_v1.mp3` },
anan: { name: '安安', ringtone: `${MUS}/lv11_ring_anan_v1.mp3` },
dorm: { name: '寝室群', ringtone: `${MUS}/lv11_ring_dorm_group_v1.mp3` },
unknown: { name: '未知号码', ringtone: `${MUS}/lv11_ring_unknown_v1.mp3` },
zhounan: { name: '周南', ringtone: `${MUS}/lv11_ring_zhounan_v1.mp3` },
self: { name: '时光胶囊', ringtone: null },
};
const SFX_UI = {
wechat_msg: `${SFX}/sfx_deep_breath_v1.wav`, // 微信消息提示(用sfx模拟)
keyboard: `${SFX}/sfx_keyboard_slow_v1.wav`,
chime: `${SFX}/sfx_ending_chime_v1.wav`,
transition: `${SFX}/sfx_transition_chapter_v1.wav`,
wechat_msg: `${SFX}/sfx_deep_breath_v1.mp3`, // 微信消息提示(用sfx模拟)
keyboard: `${SFX}/sfx_keyboard_slow_v1.mp3`,
chime: `${SFX}/sfx_ending_chime_v1.mp3`,
transition: `${SFX}/sfx_transition_chapter_v1.mp3`,
};
const AMBIENCE_DEFAULT = `${AMB}/amb_apartment_night_01_v1.wav`;
const AMBIENCE_RAIN = `${AMB}/amb_rain_window_01_v1.wav`;
const AMBIENCE_DEFAULT = `${AMB}/amb_apartment_night_01_v1.mp3`;
const AMBIENCE_RAIN = `${AMB}/amb_rain_window_01_v1.mp3`;