![]() ![]() Logger.warning("Synthesis canceled, error details %s", cancellation_details.error_details) ![]() bug("Synthesis completed %s", text)Įlif result.reason = :Ĭancellation_details = result.cancellation_details Result = synthesizer.speak_ssml_async(text).get() if self.is_ssml else \ Synthesizer.synthesis_nnect(lambda _: finished.append(True)) Synthesizer.synthesis_word_nnect(word_boundary_cb) With self.synthesizer_pool.borrow_synthesizer() as synthesizer: bug("Synthesis started %s", text)ĭef word_boundary_cb(evt: speechsdk.SpeechSynthesisWordBoundaryEventArgs) -> None: Return speechsdk.SpeechSynthesizer(config, audio_config=None)ĭef synthesize_text_once(self, text: str) -> Tuple[speechsdk.SpeechSynthesisResult, _RequestSentenceBoundary, 'true')Ĭonfig.speech_synthesis_voice_name = self.voice ![]() Self.synthesizer_pool = SynthesizerPool(self._create_synthesizer, self.parallel_threads)ĭef _create_synthesizer(self) -> speechsdk.SpeechSynthesizer:Ĭonfig = speechsdk.SpeechConfig(subscription=self.subscription, region=self.region)Ĭt_speech_synthesis_output_format(24Khz48KBitRateMonoMp3) Voice: str = 'en-US-JennyNeural', parallel_threads: int = 8) -> None: Import as speechsdkįrom synthesizer_pool import SynthesizerPoolĭef _init_(self, subscription: str, region: str, language: str = 'english', See LICENSE.md file in the project root for full license information.įrom multiprocessing.pool import ThreadPool
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |