diff --git a/hugvey/speech/google.py b/hugvey/speech/google.py index f976fee..cb36103 100644 --- a/hugvey/speech/google.py +++ b/hugvey/speech/google.py @@ -58,7 +58,7 @@ class GoogleVoiceClient(object): self.isRunning.set() def generator(self): - print('start generator') + self.logger.debug('start generator') while not self.toBeShutdown and self.isRunning.is_set(): try: # set a timeout, as not to wait infinitely for the buffer when @@ -66,8 +66,8 @@ class GoogleVoiceClient(object): yield self.buffer.get(timeout=.3) except queue.Empty as e: self.logger.debug('empty mic buffer - restart?') - print(self.isRunning.isSet()) - print('stop generator') +# print(self.isRunning.isSet()) + self.logger.info('stop generator') self.restart = False # don't trigger double restart # raise RequireRestart("Restart required (generator)") @@ -145,7 +145,7 @@ class GoogleVoiceClient(object): self.lastNonFinalTranscript = None if result.is_final: - print("native final") + self.logger.info("native final") msg = { "event": "speech", "is_final": result.is_final, diff --git a/hugvey/voice.py b/hugvey/voice.py index c13338b..11eba5f 100644 --- a/hugvey/voice.py +++ b/hugvey/voice.py @@ -134,7 +134,7 @@ class MSVoiceFetcher(VoiceFetcher): headers=headers, allow_nonstandard_methods=True ) - print(request.method, request.url, request.headers) + logger.debug(f"{request.method} {request.url} {request.headers}") try: response = await http_client.fetch(request) except Exception as e: @@ -148,7 +148,6 @@ class MSVoiceFetcher(VoiceFetcher): async def requestVoiceFile(self, text): - print(self.config['voice_url']) headers = { 'Authorization': 'Bearer ' + await self.getToken(), 'Content-Type': 'application/ssml+xml', @@ -159,7 +158,7 @@ class MSVoiceFetcher(VoiceFetcher): name='{self.config['ms_name']}'> {text} """ - print(headers, body) + logger.debug(body) http_client = AsyncHTTPClient() request = HTTPRequest( method="POST",