AVSpeechSynthesizer speaker on

797 views Asked by At

I can hear the text read through my headphones when they are connected. However, if I disconnect headphones it doesn't play at all. How do I turn on speaker for this speech? This is my code:

[syn stopSpeakingAtBoundary:AVSpeechBoundaryImmediate];
syn = [[AVSpeechSynthesizer alloc] init];
syn.delegate = self;
utt = [AVSpeechUtterance  speechUtteranceWithString:rtext];
float speechSpeed = 0.3;
NSLog(@"Read***** text%@",rtext);
[utt setRate:speechSpeed];
utt.volume = 1;
[syn speakUtterance:utt];

0

There are 0 answers