question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Speech SDK for Python crashes on text-to-speech synthesis

See original GitHub issue

Describe the bug Text-to-speech crashes in Google Colab (one of the most popular Jupyter Notebook environments). It’s the only Python environment I have at my disposal, so I simply don’t know the real extent of this bug.

To Reproduce Steps to reproduce the behavior:

  1. Open the provided quickstart notebook in Colab.
  2. Install requirements as instructed and proceed to running cells as usual.
  3. Observe crash & restart when running cell result = speech_synthesizer.speak_text_async(text).get() (second to last cell in the quickstart notebook)

Expected behavior System should not crash without an error message. Error should be handled correctly with a message, or better yet, error should not occur and synthesized speech audio should be provided instead.

Version of the Cognitive Services Speech SDK

!pip install azure-cognitiveservices-speech
... Successfully installed azure-cognitiveservices-speech-1.18.0

Platform, Operating System, and Programming Language

  • OS: Ubuntu 18.04.5 LTS
  • Hardware: x64
  • Programming language: Python
  • Browser Chrome

Additional context

Runtime logs:

Aug 11, 2021, 3:35:15 PM	WARNING	terminate called after throwing an instance of 'swig::stop_iteration'
Aug 11, 2021, 3:35:16 PM	WARNING	WARNING:root:kernel 96e7e1c1-dcdf-4092-ae40-0d0d3e40b262 restarted
Aug 11, 2021, 3:35:16 PM	INFO	KernelRestarter: restarting kernel (1/5), keep random ports

Speech SDK log:

[637847]: 7633ms SPX_DBG_TRACE_VERBOSE:  resource_manager.cpp:92 Created 'CSpxThreadService' as '303073113'
[637847]: 7633ms SPX_TRACE_WARNING: resource_manager.cpp:100 Failed to create 'CSpxCodecAdapter' as '199052375'. Are all required extension libraries loaded?
[637847]: 7633ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:311 ISpxNamedProperties::GetStringValue: this=0x0x55cdb5047bf8; name='SPEECH-SynthBackend'; value=''
[637847]: 7633ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:311 ISpxNamedProperties::GetStringValue: this=0x0x55cdb5047bf8; name='SDK-INTERNAL-UseTtsEngine-Mock'; value='false'
[637847]: 7633ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:311 ISpxNamedProperties::GetStringValue: this=0x0x55cdb5047bf8; name='CARBON-INTERNAL-UseTtsEngine-Mock'; value='false'
[637847]: 7633ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:311 ISpxNamedProperties::GetStringValue: this=0x0x55cdb5047bf8; name='SDK-INTERNAL-UseTtsEngine-Rest'; value='false'
[637847]: 7633ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:311 ISpxNamedProperties::GetStringValue: this=0x0x55cdb5047bf8; name='CARBON-INTERNAL-UseTtsEngine-Rest'; value='false'
[637847]: 7633ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:311 ISpxNamedProperties::GetStringValue: this=0x0x55cdb5047bf8; name='SDK-INTERNAL-UseTtsEngine-Usp'; value='false'
[637847]: 7633ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:311 ISpxNamedProperties::GetStringValue: this=0x0x55cdb5047bf8; name='CARBON-INTERNAL-UseTtsEngine-Usp'; value='false'
[637847]: 7633ms SPX_DBG_TRACE_VERBOSE:  usp_tts_engine_adapter.cpp:44 CSpxUspTtsEngineAdapter
[637847]: 7633ms SPX_DBG_TRACE_VERBOSE:  resource_manager.cpp:92 Created 'CSpxUspTtsEngineAdapter' as '919101823'
[637847]: 7633ms SPX_DBG_TRACE_VERBOSE:  resource_manager.cpp:92 Created 'CSpxThreadService' as '303073113'
[637847]: 7633ms SPX_TRACE_INFO: AZ_LOG_INFO:  tlsio_openssl.c:2172 Using OpenSSL 1.1.1k  25 Mar 2021: 101010bf
[637847]: 7633ms SPX_DBG_TRACE_VERBOSE:  resource_manager.cpp:92 Created 'CSpxDefaultSpeaker' as '853898539'
[637847]: 7634ms SPX_TRACE_VERBOSE:  dynamic_module.cpp:75 dlopen('libMicrosoft.CognitiveServices.Speech.core.so') returned non-NULL
[637847]: 7634ms SPX_TRACE_VERBOSE:  dynamic_module.cpp:81 dlsym('GetModuleObject') returned non-NULL
[637847]: 7634ms SPX_DBG_TRACE_VERBOSE:  resource_manager.cpp:92 Created 'CSpxPullAudioOutputStream' as '853898539'
[637847]: 7634ms SPX_DBG_TRACE_VERBOSE:  cloud_tts_engine_adapter.cpp:121 SetOutput
[637847]: 7634ms SPX_TRACE_INFO:  cloud_tts_engine_adapter.cpp:170 SetOutput: request format [riff-16khz-16bit-mono-pcm] has header, using raw format instead for streaming.
[637847]: 7634ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:100 CSpxHandleTable::TrackHandle p=0x0x55cdb5047828
[637847]: 7634ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:110 CSpxHandleTable::TrackHandle iid=439569007 h=0x0x55cdb5047828, p=0x0x55cdb5047828, tot=1
[637847]: 7634ms SPX_DBG_TRACE_SCOPE_EXIT:  speechapi_c_factory.cpp:478 synthesizer_create_speech_synthesizer_from_config
[637847]: 7634ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:100 CSpxHandleTable::TrackHandle p=0x0x55cdb5047bf8
[637847]: 7634ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:110 CSpxHandleTable::TrackHandle iid=876984227 h=0x0x55cdb5047bf8, p=0x0x55cdb5047bf8, tot=3
[145745]: 22047ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:100 CSpxHandleTable::TrackHandle p=0x0x55cdb47e1f20
[145745]: 22047ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:110 CSpxHandleTable::TrackHandle iid=950656321 h=0x0x55cdb47e1f20, p=0x0x55cdb47e1f20, tot=1
[931928]: 22048ms SPX_DBG_TRACE_VERBOSE:  resource_manager.cpp:92 Created 'CSpxAudioDataStream' as '418301898'
[931928]: 22048ms SPX_DBG_TRACE_VERBOSE:  null_audio_output.h:93 SetFormat is called with format 0x0x55cdb47e1bc0
[931928]: 22048ms SPX_DBG_TRACE_FUNCTION:  synthesis_result.cpp:24 CSpxSynthesisResult
[931928]: 22048ms SPX_DBG_TRACE_VERBOSE:  resource_manager.cpp:92 Created 'CSpxSynthesisResult' as '3874248'
[822254]: 22048ms SPX_DBG_TRACE_SCOPE_ENTER:  synthesizer.cpp:925 DispatchEvent task started...
[822254]: 22048ms SPX_DBG_TRACE_VERBOSE:  synthesizer.cpp:423 [0x55cdb5047800]CSpxSynthesizer::FireResultEvent
[822254]: 22048ms SPX_DBG_TRACE_VERBOSE:  synthesizer.cpp:459 No listener connected to event
[822254]: 22048ms SPX_DBG_TRACE_SCOPE_EXIT:  synthesizer.cpp:925 DispatchEvent task complete!
[931928]: 22048ms SPX_DBG_TRACE_VERBOSE:  usp_tts_engine_adapter.cpp:76 Speak
[931928]: 22048ms SPX_DBG_TRACE_VERBOSE:  usp_tts_engine_adapter.cpp:94 Speak: start to send synthesis request, request id : d0530b80d293489d823b5ce3d59a118d, try: 0
[931928]: 22048ms SPX_DBG_TRACE_VERBOSE:  usp_tts_engine_adapter.cpp:167 SSML sent to TTS cognitive service: <speak version='1.0' xmlns='http://www.w3.org/2001/10/synthesis' xmlns:mstts='http://www.w3.org/2001/mstts' xmlns:emo='http://www.w3.org/2009/10/emotionml' xml:lang='en-us'><voice name='en-us-JennyNeural'>Testing one two</voice></speak>
[931928]: 22048ms SPX_DBG_TRACE_VERBOSE:  usp_tts_engine_adapter.cpp:443 UspInitialize: this=0x0x55cdb5196ec0
[931928]: 22048ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:311 ISpxNamedProperties::GetStringValue: this=0x0x55cdb5047bf8; name='SPEECH-SubscriptionKey'; value='******************************99'
[931928]: 22048ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:311 ISpxNamedProperties::GetStringValue: this=0x0x55cdb5196f10; name='SPEECHSDK-SPEECH-CONFIG-SYSTEM-LANGUAGE'; value='Python'
[931928]: 22048ms SPX_DBG_TRACE_VERBOSE:  resource_manager.cpp:92 Created 'CSpxUspCallbackWrapper' as '978711522'
[931928]: 22048ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:311 ISpxNamedProperties::GetStringValue: this=0x0x55cdb5047bf8; name='SPEECH-Region'; value='westeurope'
[931928]: 22048ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:311 ISpxNamedProperties::GetStringValue: this=0x0x55cdb5047bf8; name='SPEECH-ProxyHostBypass'; value=''
[931928]: 22048ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:311 ISpxNamedProperties::GetStringValue: this=0x0x55cdb5047bf8; name='OPENSSL_SINGLE_TRUSTED_CERT'; value=''
[931928]: 22048ms SPX_TRACE_INFO:  uspimpl.cpp:597 Connect: entering...
[931928]: 22048ms SPX_TRACE_INFO:  uspimpl.cpp:614 Adding subscription key headers
[931928]: 22048ms SPX_TRACE_INFO:  uspimpl.cpp:649 Set a user defined HTTP header 'User-agent':'SpeechSDK-Python/1.18.0 Linux Linux 5.4.104+ #1 SMP Sat Jun 5 09:50:34 PDT 2021 x86_64 5.4.104+'
[931928]: 22048ms SPX_TRACE_INFO:  uspimpl.cpp:655 Set an underlying io option 'tcp_nodelay'
[931928]: 22048ms SPX_TRACE_INFO:  uspimpl.cpp:664 connectionUrl=wss://westeurope.tts.speech.microsoft.com/cognitiveservices/websocket/v1
[931928]: 22048ms SPX_DBG_TRACE_SCOPE_ENTER:  web_socket.cpp:224 WebSocket
[931928]: 22048ms SPX_DBG_TRACE_SCOPE_EXIT:  web_socket.cpp:224 WebSocket
[931928]: 22049ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:311 ISpxPropertyBagImpl::SetStringValue: this=0x0x55cdb5047bf8; name='SPEECH-ConnectionUrl'; value='wss://westeurope.tts.speech.microsoft.com/cognitiveservices/websocket/v1'
[931928]: 22049ms SPX_DBG_TRACE_VERBOSE:  usp_tts_engine_adapter.cpp:336 speech.config {"context":{"system":{"version":"1.18.0","name":"SpeechSDK","build":"Linux-x64"},"os":{"platform":"Linux","name":"Linux 5.4.104+ #1 SMP Sat Jun 5 09:50:34 PDT 2021 x86_64","version":"5.4.104+"}}}
[931928]: 22049ms SPX_DBG_TRACE_VERBOSE:  usp_tts_engine_adapter.cpp:383 speech.config='{"context":{"system":{"version":"1.18.0","name":"SpeechSDK","build":"Linux-x64"},"os":{"platform":"Linux","name":"Linux 5.4.104+ #1 SMP Sat Jun 5 09:50:34 PDT 2021 x86_64","version":"5.4.104+"}}}'
[931928]: 22049ms SPX_DBG_TRACE_VERBOSE:  usp_tts_engine_adapter.cpp:383 synthesis.context='{"synthesis":{"audio":{"outputFormat":"raw-16khz-16bit-mono-pcm","metadataOptions":{"visemeEnabled":false,"bookmarkEnabled":false,"wordBoundaryEnabled":false,"sentenceBoundaryEnabled":false}},"language":{"autoDetection":false}}}'
[931928]: 22049ms SPX_DBG_TRACE_VERBOSE:  usp_tts_engine_adapter.cpp:368 ssml <speak version='1.0' xmlns='http://www.w3.org/2001/10/synthesis' xmlns:mstts='http://www.w3.org/2001/mstts' xmlns:emo='http://www.w3.org/2009/10/emotionml' xml:lang='en-us'><voice name='en-us-JennyNeural'>Testing one two</voice></speak>
[931928]: 22049ms SPX_DBG_TRACE_VERBOSE:  usp_tts_engine_adapter.cpp:383 ssml='<speak version='1.0' xmlns='http://www.w3.org/2001/10/synthesis' xmlns:mstts='http://www.w3.org/2001/mstts' xmlns:emo='http://www.w3.org/2009/10/emotionml' xml:lang='en-us'><voice name='en-us-JennyNeural'>Testing one two</voice></speak>'
[850514]: 22050ms SPX_TRACE_INFO:  web_socket.cpp:783 DoWork: open transport.
[850514]: 22050ms SPX_TRACE_INFO:  web_socket.cpp:535 Start to open websocket. WebSocket: 0xb5210580, wsio handle: 0xb39c3440
[850514]: 22050ms SPX_TRACE_INFO: AZ_LOG_INFO:  tlsio_openssl.c:1997 create_openssl_instance by TLS_method.
[850514]: 22052ms SPX_TRACE_INFO: AZ_LOG_INFO:  tlsio_openssl.c:1819 load_system_store not implemented on this platform
[850514]: 22052ms SPX_TRACE_INFO: AZ_LOG_INFO:  tlsio_openssl.c:1852 CRL check enabled.
[850514]: 22261ms SPX_TRACE_INFO:  uspimpl.cpp:890 Create requestId  for messageType 0
[850514]: 22370ms SPX_TRACE_INFO: AZ_LOG_INFO:  tlsio_openssl.c:1441 Not using CRL cache directory.
[850514]: 22809ms SPX_TRACE_INFO:  web_socket.cpp:859 Opening websocket completed. TransportRequest: 0xb5210580, wsio handle: 0xb39c3440
[850514]: 22809ms SPX_TRACE_INFO:  uspimpl.cpp:1005 TS:761, OnConnected: connection:0xb537e000
[822254]: 22809ms SPX_DBG_TRACE_SCOPE_ENTER:  synthesizer.cpp:925 DispatchEvent task started...
[822254]: 22809ms SPX_DBG_TRACE_SCOPE_ENTER:  synthesizer.cpp:495 FireConnectionChanged
[822254]: 22809ms SPX_DBG_TRACE_VERBOSE:  synthesizer.cpp:496 FireConnectionChanged: Connected
[822254]: 22809ms SPX_DBG_TRACE_VERBOSE:  resource_manager.cpp:92 Created 'CSpxConnectionEventArgs' as '189265475'
[822254]: 22809ms SPX_DBG_TRACE_SCOPE_EXIT:  synthesizer.cpp:495 FireConnectionChanged
[822254]: 22809ms SPX_DBG_TRACE_SCOPE_EXIT:  synthesizer.cpp:925 DispatchEvent task complete!
[850514]: 22911ms SPX_TRACE_INFO:  uspimpl.cpp:1243 Service originated request received with requestId: d0530b80d293489d823b5ce3d59a118d
[850514]: 22911ms SPX_TRACE_INFO:  uspimpl.cpp:1258 Response Message: content type: application/json; charset=utf-8.
[850514]: 22911ms SPX_TRACE_INFO:  uspimpl.cpp:1278 TS:863 Response Message: path: turn.start, size: 75.
[850514]: 23030ms SPX_TRACE_INFO:  uspimpl.cpp:1258 Response Message: content type: application/json; charset=utf-8.
[850514]: 23030ms SPX_TRACE_INFO:  uspimpl.cpp:1278 TS:982 Response Message: path: response, size: 133.
[850514]: 23169ms SPX_TRACE_INFO:  uspimpl.cpp:1258 Response Message: content type: audio/basic.
[850514]: 23169ms SPX_TRACE_INFO:  uspimpl.cpp:1278 TS:1121 Response Message: path: audio, size: 36864.
[850514]: 23169ms SPX_DBG_TRACE_VERBOSE:  resource_manager.cpp:92 Created 'CSpxPullAudioOutputStream' as '853898539'
[850514]: 23169ms SPX_DBG_TRACE_FUNCTION:  synthesis_result.cpp:24 CSpxSynthesisResult
[850514]: 23169ms SPX_DBG_TRACE_VERBOSE:  resource_manager.cpp:92 Created 'CSpxSynthesisResult' as '3874248'
[850514]: 23169ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:311 ISpxPropertyBagImpl::SetStringValue: this=0x0x55cdb408d190; name='RESULT-SynthesisBackend'; value='online (websocket)'
[822254]: 23169ms SPX_DBG_TRACE_SCOPE_ENTER:  synthesizer.cpp:925 DispatchEvent task started...
[822254]: 23169ms SPX_DBG_TRACE_VERBOSE:  synthesizer.cpp:423 [0x55cdb5047800]CSpxSynthesizer::FireResultEvent
[822254]: 23169ms SPX_DBG_TRACE_VERBOSE:  synthesizer.cpp:459 No listener connected to event
[822254]: 23169ms SPX_DBG_TRACE_SCOPE_EXIT:  synthesizer.cpp:925 DispatchEvent task complete!
[850514]: 23169ms SPX_DBG_TRACE_VERBOSE:  pull_audio_output_stream.cpp:26 CSpxPullAudioOutputStream::Write buffer 0x55cdb54d0087 size=36864
[850514]: 23169ms SPX_DBG_TRACE_VERBOSE:  audio_data_stream.cpp:148 CSpxAudioDataStream::Write buffer 0x55cdb54d0087 size=36864
[850514]: 23169ms SPX_DBG_TRACE_SCOPE_ENTER:  default_speaker.cpp:107 Write
[850514]: 23169ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:311 ISpxNamedProperties::GetStringValue: this=0x0x55cdb39c30c0; name='AudioConfig_DeviceNameForRender'; value=''
[850514]: 23169ms SPX_DBG_TRACE_VERBOSE:  default_speaker.cpp:219 The device name of speaker as a property is ''
[850514]: 23174ms SPX_TRACE_ERROR:  audio_sys.cpp:555 No playback device was found.
[850514]: 23174ms SPX_TRACE_ERROR:  audio_sys.cpp:682 Error opening audio playback device 0
[850514]: 23174ms SPX_DBG_TRACE_VERBOSE:  default_speaker.cpp:232 InitializeAudio: Speaker output initialization error
[850514]: 23174ms SPX_DBG_TRACE_SCOPE_EXIT:  default_speaker.cpp:107 Write
[850514]: 23174ms SPX_DBG_TRACE_VERBOSE:  pull_audio_output_stream.cpp:89 AvailableSize: current available size: 36864
[850514]: 23174ms SPX_DBG_TRACE_FUNCTION:  synthesis_result.cpp:29 ~CSpxSynthesisResult
[850514]: 23269ms SPX_TRACE_INFO:  uspimpl.cpp:1258 Response Message: content type: audio/basic.
[850514]: 23269ms SPX_TRACE_INFO:  uspimpl.cpp:1278 TS:1221 Response Message: path: audio, size: 20486.
[850514]: 23269ms SPX_DBG_TRACE_FUNCTION:  synthesis_result.cpp:24 CSpxSynthesisResult
[850514]: 23269ms SPX_DBG_TRACE_VERBOSE:  resource_manager.cpp:92 Created 'CSpxSynthesisResult' as '3874248'
[850514]: 23269ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:311 ISpxPropertyBagImpl::SetStringValue: this=0x0x55cdb408d190; name='RESULT-SynthesisBackend'; value='online (websocket)'
[822254]: 23269ms SPX_DBG_TRACE_SCOPE_ENTER:  synthesizer.cpp:925 DispatchEvent task started...
[822254]: 23269ms SPX_DBG_TRACE_VERBOSE:  synthesizer.cpp:423 [0x55cdb5047800]CSpxSynthesizer::FireResultEvent
[822254]: 23269ms SPX_DBG_TRACE_VERBOSE:  synthesizer.cpp:459 No listener connected to event
[822254]: 23269ms SPX_DBG_TRACE_SCOPE_EXIT:  synthesizer.cpp:925 DispatchEvent task complete!
[850514]: 23269ms SPX_DBG_TRACE_VERBOSE:  pull_audio_output_stream.cpp:89 AvailableSize: current available size: 36864
[850514]: 23269ms SPX_DBG_TRACE_VERBOSE:  pull_audio_output_stream.cpp:26 CSpxPullAudioOutputStream::Write buffer 0x55cdb45b4087 size=20486
[850514]: 23269ms SPX_DBG_TRACE_VERBOSE:  audio_data_stream.cpp:148 CSpxAudioDataStream::Write buffer 0x55cdb45b4087 size=20486
[850514]: 23269ms SPX_DBG_TRACE_SCOPE_ENTER:  default_speaker.cpp:107 Write
[850514]: 23269ms SPX_DBG_TRACE_SCOPE_EXIT:  default_speaker.cpp:107 Write
[850514]: 23269ms SPX_DBG_TRACE_FUNCTION:  synthesis_result.cpp:29 ~CSpxSynthesisResult
[850514]: 23270ms SPX_TRACE_INFO:  uspimpl.cpp:1258 Response Message: content type: audio/basic.
[850514]: 23270ms SPX_TRACE_INFO:  uspimpl.cpp:1278 TS:1222 Response Message: path: audio, size: 3450.
[850514]: 23270ms SPX_DBG_TRACE_FUNCTION:  synthesis_result.cpp:24 CSpxSynthesisResult
[850514]: 23270ms SPX_DBG_TRACE_VERBOSE:  resource_manager.cpp:92 Created 'CSpxSynthesisResult' as '3874248'
[850514]: 23270ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:311 ISpxPropertyBagImpl::SetStringValue: this=0x0x55cdb408d190; name='RESULT-SynthesisBackend'; value='online (websocket)'
[822254]: 23270ms SPX_DBG_TRACE_SCOPE_ENTER:  synthesizer.cpp:925 DispatchEvent task started...
[822254]: 23270ms SPX_DBG_TRACE_VERBOSE:  synthesizer.cpp:423 [0x55cdb5047800]CSpxSynthesizer::FireResultEvent
[822254]: 23270ms SPX_DBG_TRACE_VERBOSE:  synthesizer.cpp:459 No listener connected to event
[822254]: 23270ms SPX_DBG_TRACE_SCOPE_EXIT:  synthesizer.cpp:925 DispatchEvent task complete!
[850514]: 23270ms SPX_DBG_TRACE_VERBOSE:  pull_audio_output_stream.cpp:89 AvailableSize: current available size: 57350
[850514]: 23270ms SPX_DBG_TRACE_VERBOSE:  pull_audio_output_stream.cpp:26 CSpxPullAudioOutputStream::Write buffer 0x55cdb51cc087 size=3450
[850514]: 23270ms SPX_DBG_TRACE_VERBOSE:  audio_data_stream.cpp:148 CSpxAudioDataStream::Write buffer 0x55cdb51cc087 size=3450
[850514]: 23270ms SPX_DBG_TRACE_SCOPE_ENTER:  default_speaker.cpp:107 Write
[850514]: 23270ms SPX_DBG_TRACE_SCOPE_EXIT:  default_speaker.cpp:107 Write
[850514]: 23270ms SPX_DBG_TRACE_FUNCTION:  synthesis_result.cpp:29 ~CSpxSynthesisResult
[850514]: 23270ms SPX_TRACE_INFO:  uspimpl.cpp:1278 TS:1222 Response Message: path: audio, size: 0.
[850514]: 23270ms SPX_TRACE_INFO:  uspimpl.cpp:1258 Response Message: content type: application/json; charset=utf-8.
[850514]: 23270ms SPX_TRACE_INFO:  uspimpl.cpp:1278 TS:1222 Response Message: path: turn.end, size: 2.
[850514]: 23270ms SPX_DBG_TRACE_VERBOSE:  uspimpl.cpp:1345 Got turn end, clear m_streamIdLangMap.
[850514]: 23270ms SPX_TRACE_INFO:  usp_metrics.cpp:429 SendSerializedTelemetry: Send telemetry (requestId:d0530b80d293489d823b5ce3d59a118d): {"Metrics":[{"End":"2021-08-11T12:35:14.621Z","Id":"972467b0e4c5463a9b0ec9496267b2ee","Name":"Connection","Start":"2021-08-11T12:35:13.862Z"},{"DeviceId":["b0183999-f936-4906-9d63-33f6e42f9dab"],"Name":"device"}],"ReceivedMessages":[]}
[850514]: 23270ms SPX_TRACE_INFO:  usp_metrics.cpp:429 SendSerializedTelemetry: Send telemetry (requestId:d0530b80d293489d823b5ce3d59a118d): {"Metrics":[],"ReceivedMessages":[{"turn.start":["2021-08-11T12:35:14.723Z"]},{"turn.end":["2021-08-11T12:35:15.082Z"]},{"audio":["2021-08-11T12:35:14.981Z","2021-08-11T12:35:15.081Z","2021-08-11T12:35:15.082Z","2021-08-11T12:35:15.082Z"]},{"response":["2021-08-11T12:35:14.842Z"]}]}
[931928]: 23270ms SPX_DBG_TRACE_FUNCTION:  synthesis_result.cpp:24 CSpxSynthesisResult
[931928]: 23270ms SPX_DBG_TRACE_VERBOSE:  resource_manager.cpp:92 Created 'CSpxSynthesisResult' as '3874248'
[931928]: 23270ms SPX_DBG_TRACE_VERBOSE:  pull_audio_output_stream.cpp:161 Signal End of Writing is called
[931928]: 23270ms SPX_DBG_TRACE_VERBOSE:  pull_audio_output_stream.cpp:89 AvailableSize: current available size: 60800
[931928]: 23270ms SPX_DBG_TRACE_VERBOSE:  pull_audio_output_stream.cpp:89 AvailableSize: current available size: 60800
[931928]: 23270ms SPX_DBG_TRACE_VERBOSE:  pull_audio_output_stream.cpp:69 CSpxPullAudioOutputStream::Read: is called
[931928]: 23270ms SPX_DBG_TRACE_VERBOSE:  pull_audio_output_stream.cpp:136 CSpxPullAudioOutputStream::Read: bytesRead=60800
[931928]: 23270ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:311 ISpxPropertyBagImpl::SetStringValue: this=0x0x55cdb408cf10; name='RESULT-SynthesisBackend'; value='online (websocket)'
[931928]: 23270ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:311 ISpxPropertyBagImpl::SetStringValue: this=0x0x55cdb408cf10; name='RESULT-SynthesisFirstByteLatencyMs'; value='1121'
[931928]: 23270ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:311 ISpxPropertyBagImpl::SetStringValue: this=0x0x55cdb408cf10; name='RESULT-SynthesisFinishLatencyMs'; value='1222'
[931928]: 23270ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:311 ISpxPropertyBagImpl::SetStringValue: this=0x0x55cdb408cf10; name='RESULT-SyntheisisUnderrunTimeMs'; value='0'
[931928]: 23270ms SPX_DBG_TRACE_VERBOSE:  pull_audio_output_stream.cpp:161 Signal End of Writing is called
[931928]: 23270ms SPX_DBG_TRACE_VERBOSE:  pull_audio_output_stream.cpp:161 Signal End of Writing is called
[931928]: 23270ms SPX_DBG_TRACE_FUNCTION:  synthesis_result.cpp:29 ~CSpxSynthesisResult
[822254]: 23270ms SPX_DBG_TRACE_SCOPE_ENTER:  synthesizer.cpp:925 DispatchEvent task started...
[822254]: 23270ms SPX_DBG_TRACE_VERBOSE:  synthesizer.cpp:423 [0x55cdb5047800]CSpxSynthesizer::FireResultEvent
[822254]: 23270ms SPX_DBG_TRACE_VERBOSE:  synthesizer.cpp:459 No listener connected to event
[822254]: 23270ms SPX_DBG_TRACE_SCOPE_EXIT:  synthesizer.cpp:925 DispatchEvent task complete!
[145745]: 23270ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:100 CSpxHandleTable::TrackHandle p=0x0x55cdb408cf00
[145745]: 23270ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:110 CSpxHandleTable::TrackHandle iid=3874248 h=0x0x55cdb408cf00, p=0x0x55cdb408cf00, tot=1
[145745]: 23270ms SPX_RETURN_ON_FAIL:  handle_helpers.h:52 hr = 0x21
[145745]: 23270ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:169 CSpxHandleTable::StopTracking(h) h=0x0x55cdb47e1f20
[145745]: 23270ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:184 CSpxHandleTable::StopTracking(h) iid=950656321 h=0x0x55cdb47e1f20, p=0x0x55cdb47e1f20, tot=0
[145745]: 23270ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:100 CSpxHandleTable::TrackHandle p=0x0x55cdb408cf10
[145745]: 23270ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:110 CSpxHandleTable::TrackHandle iid=876984227 h=0x0x55cdb408cf10, p=0x0x55cdb408cf10, tot=4

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jhakulincommented, Aug 11, 2021

@olaviinha Thanks for the report and log. The problem happens probably because playback device is not found.

[850514]: 23169ms SPX_DBG_TRACE_VERBOSE: default_speaker.cpp:219 The device name of speaker as a property is ‘’ [850514]: 23174ms SPX_TRACE_ERROR: audio_sys.cpp:555 No playback device was found. [850514]: 23174ms SPX_TRACE_ERROR: audio_sys.cpp:682 Error opening audio playback device 0 [850514]: 23174ms SPX_DBG_TRACE_VERBOSE: default_speaker.cpp:232 InitializeAudio: Speaker output initialization error

Clearly SDK should not crash and needs to inform about this with appropriate error. We have created internal work item about this and let you know once it is fixed.

1reaction
olaviinhacommented, Aug 11, 2021

Thanks! I further found that this way it works just fine and dandy:

audio_config = AudioOutputConfig(filename='/content/audiofile.wav')
synthesizer = SpeechSynthesizer(speech_config=speech_config, audio_config=audio_config)
result = speech_synthesizer.speak_text_async(text)

So it must be something in the .get() part:

result = speech_synthesizer.speak_text_async(text).get()
Read more comments on GitHub >

github_iconTop Results From Across the Web

NuGet microsoft.cognitiveservices.speech produces 0kb files
There are no errors, but when it attempts to synthesize the speech it "crashes" and creates a 0kb file. I have tried generating...
Read more >
Azure Text to Speech with Python without SDK
Speech synthesis is a different name for the text-to-speech ... changes to the SDK, your code won't crash (at least not because of...
Read more >
What's new in Azure AI Speech?
Text to speech Batch synthesis API is available in public preview. ... C++/C#/Java/Python/Objective-C/Go: Fixed an occasional crash when the ...
Read more >
Crashing when using SpeechRecognizer after TextToSpeech
I am using a SpeechRecognizer component in conjunction with a TextToSpeech component. It is working fine on Android.
Read more >
Azure Speech - Microsoft Q&A
Azure speech Python library crashes without outputting any error when using streams. I am using the Azure Speech Python library to transcribe audio...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found