M1: 녹음 + STT 기본 - 실제 디스코드 음성 E2E 통과
- 테스트봇이 말하고 겜녹이가 따라 들어와 녹음→STT→DB (F&L 서버, VOICE E2E PASS) - 녹음 제외 즉시 반영, 따라간 유저가 나가면 퇴장 - Edge TTS 429 재시도, 워커 로그 레벨 대소문자 오류 수정 - scripts/voice-smoke.mts(M0 DAVE), voice-e2e.mts(M1), vc-list.mts Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -166,7 +166,7 @@ export class Bot {
|
||||
const myCh = this.state.recording.channelId;
|
||||
if (!myCh) return;
|
||||
// 새 사람이 들어오면 안내를 다시 튼다
|
||||
if (n.channelId === myCh && o.channelId !== myCh && n.member && !n.member.user.bot) {
|
||||
if (n.channelId === myCh && o.channelId !== myCh && n.member && (!n.member.user.bot || process.env.GVR_RECORD_BOTS === '1')) {
|
||||
this.touchUser(n.member);
|
||||
this.updateParticipants();
|
||||
if (s.ttsEnabled && s.ttsOnNewMember) void this.announce();
|
||||
@@ -231,7 +231,7 @@ export class Bot {
|
||||
const now = Date.now();
|
||||
this.sessionId = newId(now);
|
||||
this.store.startSession(this.sessionId, channel.guild.id, channel.id, channel.name, now);
|
||||
for (const m of channel.members.values()) if (!m.user.bot) this.touchUser(m);
|
||||
for (const m of channel.members.values()) if (!m.user.bot || process.env.GVR_RECORD_BOTS === '1') this.touchUser(m);
|
||||
this.bus.live({ type: 'users.updated', data: [] });
|
||||
this.state.recording = { active: true, channel: channel.name, channelId: channel.id, since: now, participants: [], reason };
|
||||
this.recorder.attach(conn, this.sessionId);
|
||||
|
||||
@@ -42,7 +42,19 @@ export class Announcer {
|
||||
}
|
||||
}
|
||||
|
||||
export async function synthesize(text: string, voice: string, outFile: string): Promise<void> {
|
||||
/** Edge TTS 는 짧은 시간에 여러 번 부르면 429 를 준다. 몇 번 쉬었다가 다시 시도한다. */
|
||||
export async function synthesize(text: string, voice: string, outFile: string, tries = 4): Promise<void> {
|
||||
for (let i = 1; ; i++) {
|
||||
try {
|
||||
return await synthesizeOnce(text, voice, outFile);
|
||||
} catch (e: any) {
|
||||
if (i >= tries) throw e;
|
||||
await new Promise((r) => setTimeout(r, 1500 * 2 ** i));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function synthesizeOnce(text: string, voice: string, outFile: string): Promise<void> {
|
||||
fs.mkdirSync(path.dirname(outFile), { recursive: true });
|
||||
const tts = new MsEdgeTTS();
|
||||
const tmpDir = fs.mkdtempSync(path.join(path.dirname(outFile), '.tts-'));
|
||||
|
||||
@@ -62,7 +62,8 @@ export async function startCore(opts: CoreOptions) {
|
||||
skip: (uid): boolean => {
|
||||
const u = store.getUser(uid);
|
||||
if (u?.excluded) return true;
|
||||
return !!bot.client?.users.cache.get(uid)?.bot;
|
||||
// 다른 봇(음악봇 등)은 녹음하지 않는다. 자동 테스트에서만 GVR_RECORD_BOTS=1 로 연다.
|
||||
return process.env.GVR_RECORD_BOTS !== '1' && !!bot.client?.users.cache.get(uid)?.bot;
|
||||
},
|
||||
matchAt: (ts) => games.liveMatchAt(ts),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user