[TTS] TTSPlaybackCreate unable to initialize dynamics: -3000

        NSString* msg = @"Hello, how are you?";
        AVSpeechUtterance *utterance = [AVSpeechUtterance
                                        speechUtteranceWithString: msg];
        utterance.rate = AVSpeechUtteranceMaximumSpeechRate;
        utterance.pitchMultiplier = 1.0f;
        utterance.voice =[AVSpeechSynthesisVoice voiceWithLanguage:@"en-US"];
        utterance.volume = 1.0f;
        utterance.postUtteranceDelay = 5;
       
        AVSpeechSynthesizer *synth = [[AVSpeechSynthesizer alloc] init];
        synth.delegate = self;
        [self log:@"Start Speech"];
        [synth speakUtterance:utterance];


Is it a bug on speech framework? It works on iOS 10, but now it doesn't work on iOS 11. I heard the voice of speech, but it never call didFinishSpeechUtterance.

Replies

More source code:


@interface SKSViewController () <AVSpeechSynthesizerDelegate> {
}


@implementation SKSViewController

...

- (void)speechSynthesizer:(AVSpeechSynthesizer *)synthesizer didFinishSpeechUtterance:(AVSpeechUtterance *)utterance

{

[self log:@"Finish Speech"];
}

...

@end

I get the exact same error when running on the new iOS11 ...


Did you get closer to a solution zhima2013 ?

I too have the same issue

I also have the same issue.

Got this reply from Apple:


Hello,

Thank you for contacting Apple Developer Technical Support (DTS). Our engineers have reviewed your request and have determined that this would be best handled as a bug report.

Please submit a complete bug report regarding this issue using the Bug Reporting tool at <https://developer.apple.com/bug-reporting/>.

If the problem you are describing is occurring on a build of the OS that isn’t the latest version, make sure you also test it on the latest version of the OS and include the results of your testing in the bug report.

While a Technical Support Incident (TSI) was initially debited from your Apple Developer Program account for this request, we have assigned a replacement incident back to your account.

Best Regards,

Developer Technical Support

Apple Worldwide Developer Relations

Did you get this resolved in the latest update? did it require a code change?

Nope, still doesn’t work. In the meantime I’ll use: import AudioToolbox .. AudioServicesPlayAlertSound(kSystemSoundID_Vibrate) That’s a short vibration. Hope this helps.

Sorry, I missread and answered something Not exactly related to this thread. Because I got the same error calling: UIImpactFeedbackGenerator(style: .heavy) That's only vibration of the device.

I just noticed the same issue only after SpeechRecognizer because audioSession was active.


If people may want to look at this post.

https://stackoverflow.com/questions/40270738/avspeechsynthesizer-does-not-speak-after-using-sfspeechrecognizer/43098873#43098873

Your synthesizer object must be a property for that to work 🙂
@property (strong, nonatomic) AVSpeechSynthesizer *synthesizer;
I have faced the same issue and tried with the property. It worked

the solution is simple: you have unlock the audio on the iphone. That meaning that you have to switch the fisical button of the audio. If you switch on, the audio get out. if you switch off, the audio is mute and the warning came out.


I've had the same problem. but in ios10 simply the audio don't came out.

Does anybody know where the console message in the title of this thread comes from, and how to avoid it? My console just clutters up with '[TTS] TTSPlaybackCreate unable to initialize dynamics: -3000' messages.


It does not seem be related to the issues discussed up to here in this thread. speechSynthesizer(_:didFinish:) fires up reliably in my Swift delegate, in iOS 11.0.3 and 11.1 beta 3 and in the simulator, also when the sound is physically switched off. The iOS release notes published since the start of this thread do mention audio fixes, but nothing specific on this method.

I had a similar issue after updating iOS to the latest version on my phone .

I spent much time trying to understand why my app stopped talking using TextToSpeech while all worked before and code seemed ok.

Siri was talking aloud fine, and the sound in other apps worked as well

Mine was giving no error message in the code and the following in the device log:



Error (730) / LearnByHeart.iOS(TTSSpeechBundle): TTSPlaybackCreate unable to initialize dynamics: -3000



As funny as it is, all got resolved by turning the physical sound button off and back on.



Hope this saves someone a day

Hi. Did anyone manage to solve this problem in iOS11? I have the same error when running my app on iPad, but it works just fine when used in Simulator. Tried turning the sound button on and off and made sure the sound is on. Nothing helps. Much appreciated!


EDIT: After a couple of days of trying everything, I think I have found the issue. It is preUtteranceDelay


let numberOfSeconds = 10.0
utterance.preUtteranceDelay = numberOfSeconds


As soon as I disable this code, I can hear the speech from my iOS device, despite the error in the console. Hm, it worked just fine before iOS11. Should I do the delay in a different way now? I do need this...


Thanks!

Is that problem resolved ?