v1.3.6: 목소리 깨짐(RTP 기준 쉼 채우기) · 알 수 없음 · 잡음 숨기기/삭제 · 사이트 로그 · 지금 게임 · TTS 속도 · 시작 창
- 녹음기: 패킷 도착 간격 대신 RTP 타임스탬프로 자리를 정한다. 게임 중 몰려 온 패킷 사이에 무음이 끼어 목소리가 깨졌다. 예전 녹음은 한 번 고친 뒤 다시 변환 - users.updated 를 빈 목록으로 보내 사이트에서 말한 사람이 '알 수 없음'이 되던 것 - 잡음은 숨기고 ogg 삭제, 로그에 잡음으로 남김. 짧은 목소리도 Whisper 로, 반복 고리는 줄여서 보여 줌 - 사이트: 재생 음량, 발화 우클릭(자세한 정보 · ogg 다운로드), 사이트 로그(/logs, 게임 PC 꺼져도), 지금 게임 상태 - 앱: 지금 게임 상태, 녹음 안내 말 속도 0.1~2.0, 포터블 · 앱 시작 창 - 발로란트 데스매치 가짜 라운드 · 에이스, 빈 선수 이름 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from gvr_worker.noise import HALLUCINATION_PHRASES, SegInfo, judge_text, judge_vad, thresholds
|
||||
from gvr_worker.noise import HALLUCINATION_PHRASES, SegInfo, collapse_repetition, judge_text, judge_vad, thresholds
|
||||
|
||||
GOOD = [SegInfo(0.05, -0.3, 1.2)]
|
||||
|
||||
@@ -36,5 +36,14 @@ def test_vad_and_sensitivity() -> None:
|
||||
assert judge_vad(0.0, 0.0, 0.5)
|
||||
assert not judge_vad(0.7, 2.0, 0.5)
|
||||
lo, hi = thresholds(0.0), thresholds(1.0)
|
||||
assert lo.vad_ratio < hi.vad_ratio and lo.no_speech_prob > hi.no_speech_prob
|
||||
assert judge_vad(0.15, 0.4, 1.0) and not judge_vad(0.15, 0.4, 0.0)
|
||||
assert lo.vad_min_speech_s < hi.vad_min_speech_s and lo.no_speech_prob > hi.no_speech_prob
|
||||
assert judge_vad(0.02, 0.2, 1.0) and not judge_vad(0.02, 0.2, 0.0)
|
||||
# 긴 잡음 속 짧은 한마디(0.3초)도 Whisper 로 넘긴다 (예전: 비율 5% 라 잡음)
|
||||
assert not judge_vad(0.05, 0.3, 0.5)
|
||||
|
||||
|
||||
def test_collapse_repetition() -> None:
|
||||
assert collapse_repetition("엘리베이 아이스페이스페이스페이스페이스페이스") == "엘리베이 아이스페이스"
|
||||
assert collapse_repetition("아 아 아 아 아 아 아 아") == "아"
|
||||
assert collapse_repetition("가자 가자") == "가자 가자"
|
||||
assert collapse_repetition("레이즈 궁 빠졌어") == "레이즈 궁 빠졌어"
|
||||
|
||||
32
worker/tests/test_tempo.py
Normal file
32
worker/tests/test_tempo.py
Normal file
@@ -0,0 +1,32 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from gvr_worker.protocol import WorkerError
|
||||
from gvr_worker.tempo import atempo_chain, change_tempo
|
||||
|
||||
SRC = Path(__file__).resolve().parents[2] / "app" / "resources" / "tts" / "announce-default.webm"
|
||||
|
||||
|
||||
def test_chain() -> None:
|
||||
assert atempo_chain(1.0) == [1.0]
|
||||
assert atempo_chain(0.2) == [0.5, 0.5, 0.8]
|
||||
assert atempo_chain(2.0) == [2.0]
|
||||
with pytest.raises(WorkerError):
|
||||
atempo_chain(0.01)
|
||||
|
||||
|
||||
@pytest.mark.skipif(not SRC.exists(), reason="기본 안내 음성 없음")
|
||||
def test_change_tempo(tmp_path: Path) -> None:
|
||||
import av
|
||||
|
||||
with av.open(str(SRC)) as f:
|
||||
base = sum(fr.samples / fr.sample_rate for fr in f.decode(audio=0))
|
||||
out = tmp_path / "slow.ogg"
|
||||
r = change_tempo(str(SRC), str(out), 0.4)
|
||||
assert abs(r["duration_s"] - base / 0.4) < 0.5
|
||||
with av.open(str(out)) as f:
|
||||
s = f.streams.audio[0]
|
||||
assert s.codec_context.name == "opus" and s.rate == 48000
|
||||
Reference in New Issue
Block a user