Quantcast
Channel: Xojo Programming Forum - Latest topics
Viewing all articles
Browse latest Browse all 3798

Working around error in NSSpeechSynthesizerMBS

$
0
0

I have two users who have reported an error when creating a new NSSpeechSynthesizerMBS. This is the line of code in Xojo subclassing
NSSpeechSynthesizerMBS as a window property:

myNSSpeechSynthesizerMBS = new NSSpeechSynthesizerMBS()

This is the error message and the relevant portion of the error trace:

Error message: error A Cocoa NSInvalidArgumentException was not handled: -[NSNull firstObject]: unrecognized selector sent to instance 0x7ff852f40a90

Trace:

RuntimeRaiseException
_Z19RaiseNSExceptionMBSP11NSException
_ZL13initWithVoiceP16REALobjectStructP16REALstringStruct
NSSpeechSynthesizerMBS.Constructor%%o

Both are running macOS 14.5.

One user sees an error in System Settings when trying to access Speech preferences (I don’t know about the other), so I assume the exception is being thrown in the Constructor.

I’d like to trap that exception and return nil, then deal with a nil object in code, but I don’t know how to do that. I tried

try
myNSSpeechSynthesizerMBS = new NSSpeechSynthesizerMBS()
exception err
  return
end try

but it the user reports the same error trace.

Any suggestions?

4 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 3798

Trending Articles