Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SPXConnection crashed when pre-connect for SPXSpeechSynthesizer #2371

Open
shannonchou opened this issue May 9, 2024 · 2 comments
Open

SPXConnection crashed when pre-connect for SPXSpeechSynthesizer #2371

shannonchou opened this issue May 9, 2024 · 2 comments
Assignees
Labels
in-review In review text-to-speech Text-to-Speech

Comments

@shannonchou
Copy link

IN ORDER TO ASSIST YOU, PLEASE PROVIDE THE FOLLOWING:

  • Speech SDK log taken from a run that exhibits the reported issue.
    See instructions on how to take logs.

  • A stripped down, simplified version of your source code that exhibits the issue. Or, preferably, try to reproduce the problem with one of the public samples in this repository (or a minimally modified version of it), and share the code.

  • If relevant, a WAV file of your input audio.

  • Additional information as shown below

Describe the bug

var speechConfig: SPXSpeechConfiguration?
var audioConfig: SPXAudioConfiguration?
do {
    let documentsDirectoryPathString = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true).first!
    let documentsDirectoryPath = NSURL(string: documentsDirectoryPathString)!
    let logFilePath = documentsDirectoryPath.appendingPathComponent("swift.log")
    
    try speechConfig = SPXSpeechConfiguration(subscription: GlobalConfig.audioSub, region: GlobalConfig.audioRegion)
    speechConfig?.setPropertyTo(logFilePath!.absoluteString, by: SPXPropertyId.speechLogFilename)
} catch {
    print("error \(error) happened")
}

speechConfig?.speechSynthesisVoiceName = GlobalConfig.voiceName

let synthesizer = try! SPXSpeechSynthesizer(speechConfiguration: speechConfig!, audioConfiguration: nil)
SPXConnection *connection = [[SPXConnection alloc]initFromSpeechSynthesizer:synthesizer];
[connection open: NO];  // crashed here

It's crashed when call open method.

Speech SDK log:

[142183]: 99291ms SPX_DBG_TRACE_VERBOSE:  resource_manager.cpp:133 Created 'CSpxThreadService' as '303073113'
[142183]: 99295ms SPX_DBG_TRACE_VERBOSE:  resource_manager.cpp:133 Created 'CSpxThreadService' as '303073113'
[142183]: 99295ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:479 ISpxPropertyBagImpl::SetStringValue: this=0x0x00000126c8a1f8; name='CodecAdapterAvailable'; value='true'
[142183]: 99296ms SPX_DBG_TRACE_VERBOSE:  usp_tts_engine_adapter.cpp:62 CSpxUspTtsEngineAdapter
[142183]: 99296ms SPX_DBG_TRACE_VERBOSE:  resource_manager.cpp:133 Created 'CSpxUspTtsEngineAdapter' as '919101823'
[142183]: 99296ms SPX_DBG_TRACE_VERBOSE:  resource_manager.cpp:133 Created 'CSpxNullAudioOutput' as '853898539'
[142183]: 99296ms SPX_DBG_TRACE_VERBOSE:  null_audio_output.h:93 SetFormat is called with format 0x0x300b3c4c0
[142183]: 99296ms SPX_DBG_TRACE_VERBOSE:  cloud_tts_engine_adapter.cpp:134 SetOutput
[142183]: 99296ms SPX_TRACE_INFO:  cloud_tts_engine_adapter.cpp:188 SetOutput: UseCompressedAudioOnWire is set to true, will use compressed format for transmission.
[142183]: 99297ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:111 CSpxHandleTable::TrackHandle p=0x0x126c89e28
[142183]: 99297ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:121 CSpxHandleTable::TrackHandle class=ISpxSynthesizer, h=0x0x126c89e28, p=0x0x126c89e28, tot=1
[142183]: 99297ms SPX_DBG_TRACE_SCOPE_EXIT:  speechapi_c_factory.cpp:548 synthesizer_create_speech_synthesizer_from_config
[142183]: 99297ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:111 CSpxHandleTable::TrackHandle p=0x0x126c8a1f8
[142183]: 99297ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:121 CSpxHandleTable::TrackHandle class=ISpxNamedProperties, h=0x0x126c8a1f8, p=0x0x126c8a1f8, tot=2
[142183]: 99298ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:180 CSpxHandleTable::StopTracking(h) h=0x0x303f3c518
[142183]: 99298ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:195 CSpxHandleTable::StopTracking(h) class=ISpxSpeechConfig, h=0x0x303f3c518, p=0x0x303f3c518, tot=0
[142183]: 99298ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:180 CSpxHandleTable::StopTracking(h) h=0x0x303f3c4b8
[142183]: 99298ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:195 CSpxHandleTable::StopTracking(h) class=ISpxNamedProperties, h=0x0x303f3c4b8, p=0x0x303f3c4b8, tot=1
[142183]: 99298ms SPX_DBG_TRACE_SCOPE_ENTER:  synthesizer_connection.cpp:19 CSpxSynthesizerConnection
[142183]: 99298ms SPX_DBG_TRACE_SCOPE_EXIT:  synthesizer_connection.cpp:19 CSpxSynthesizerConnection
[142183]: 99298ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:111 CSpxHandleTable::TrackHandle p=0x0x302a959a8
[142183]: 99298ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:121 CSpxHandleTable::TrackHandle class=ISpxConnection, h=0x0x302a959a8, p=0x0x302a959a8, tot=1
[142183]: 99298ms SPX_TRACE_INFO:  thread_service.cpp:96 Started thread User with ID [362144ll]
[142183]: 99298ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:180 CSpxHandleTable::StopTracking(h) h=0x0x302a959a8
[142183]: 99298ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:195 CSpxHandleTable::StopTracking(h) class=ISpxConnection, h=0x0x302a959a8, p=0x0x302a959a8, tot=0
[142183]: 99299ms SPX_DBG_TRACE_SCOPE_ENTER:  synthesizer_connection.cpp:24 ~CSpxSynthesizerConnection
[142183]: 99299ms SPX_DBG_TRACE_SCOPE_EXIT:  synthesizer_connection.cpp:24 ~CSpxSynthesizerConnection

Version of the Cognitive Services Speech SDK

'MicrosoftCognitiveServicesSpeech-iOS', '~> 1.37.0'

Platform, Operating System, and Programming Language

  • OS: iOS
  • Hardware - ARM,iPhone 14 Pro
  • Programming language: Objective-C and Swift
@pankopon
Copy link
Contributor

@yulin-li Can you check, should this work?

@pankopon pankopon added in-review In review text-to-speech Text-to-Speech labels May 16, 2024
@yulin-li
Copy link
Contributor

Thanks for reporting and we are investigating

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in-review In review text-to-speech Text-to-Speech
Projects
None yet
Development

No branches or pull requests

3 participants