[voskstt] fix sdk update and disable internal info logs (#13536)

* [voskstt] fix sdk update
* [voskstt] change internal sdk log level to warning

Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>
This commit is contained in:
GiviMAD 2022-10-10 18:34:48 +02:00 committed by GitHub
parent f431bfc013
commit c63e596680
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 0 deletions

View File

@ -50,6 +50,8 @@ import org.osgi.service.component.annotations.Modified;
import org.osgi.service.component.annotations.Reference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.vosk.LibVosk;
import org.vosk.LogLevel;
import org.vosk.Model;
import org.vosk.Recognizer;
@ -75,6 +77,11 @@ public class VoskSTTService implements STTService {
logger.info("vosk dir created {}", VOSK_FOLDER);
}
}
try {
LibVosk.setLogLevel(LogLevel.WARNINGS);
} catch (UnsatisfiedLinkError e) {
logger.warn("UnsatisfiedLinkError: {}", e.getMessage());
}
}
private final Logger logger = LoggerFactory.getLogger(VoskSTTService.class);
private final ScheduledExecutorService executor = ThreadPoolManager.getScheduledPool("OH-voice-voskstt");