debug(voice): verbose logging для wake-word pipeline
Some checks failed
Deploy / deploy (push) Has been cancelled
Some checks failed
Deploy / deploy (push) Has been cancelled
This commit is contained in:
@@ -176,11 +176,23 @@ export default function VoiceController() {
|
||||
|
||||
// 2. Запуск wake-word
|
||||
try {
|
||||
// Логируем периодически max-score и просто что pipeline жив, чтобы было
|
||||
// видно, что инференс идёт.
|
||||
let maxScore = 0
|
||||
let scoreCount = 0
|
||||
const wake = new WakeWordDetector({
|
||||
modelPath: '/wake/cosmo.onnx',
|
||||
threshold: WAKE_THRESHOLD,
|
||||
onWake: (s) => onWakeDetected(s),
|
||||
// onScore: (s) => { if (s > 0.1) console.log('[wake] score', s.toFixed(3)) },
|
||||
onScore: (s) => {
|
||||
if (s > maxScore) maxScore = s
|
||||
scoreCount++
|
||||
if (scoreCount % 25 === 0) {
|
||||
console.log(`[wake] alive · max score за окно=${maxScore.toFixed(3)} · scoreCount=${scoreCount}`)
|
||||
maxScore = 0
|
||||
}
|
||||
if (s > 0.15) console.log(`[wake] score=${s.toFixed(3)}`)
|
||||
},
|
||||
onError: (e) => console.warn('[wake] error', e),
|
||||
})
|
||||
await wake.start()
|
||||
|
||||
Reference in New Issue
Block a user